From 1d09f07d2b766b855b861183d8c4915b404e96da Mon Sep 17 00:00:00 2001 From: Bruno Sutic Date: Sat, 20 Sep 2014 22:33:14 +0200 Subject: [PATCH] Remove dependency on `pgrep`; use `ps` to get process names Fixes #43 --- CHANGELOG.md | 1 + README.md | 2 +- scripts/save.sh | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a90d10b..5d97ecf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### master +- remove dependency on `pgrep` command. Use `ps` for fetching process names. ### v1.2.1, 2014-09-02 - tweak 'new_pane' creation strategy to fix #36 diff --git a/README.md b/README.md index e77415c..bfa9b6a 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ This plugin goes to great lengths to save and restore all the details from your - restoring vim sessions (optional). More details in [restoring vim sessions](#restoring-vim-sessions). -Requirements / dependencies: `tmux 1.9` or higher, `pgrep`, `bash`. +Requirements / dependencies: `tmux 1.9` or higher, `bash`. `tmux-resurrect` is idempotent! It will not try to restore panes or windows that already exist. diff --git a/scripts/save.sh b/scripts/save.sh index 22a47e0..685ba00 100755 --- a/scripts/save.sh +++ b/scripts/save.sh @@ -66,8 +66,9 @@ dump_panes_raw() { } pane_full_command() { - pane_pid="$1" - \pgrep -lf -P "$pane_pid" | + local pane_pid="$1" + ps -eo "ppid command" | + grep "^${pane_pid}" | cut -d' ' -f2- }