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- }