Remove dependency on pgrep; use ps to get process names

Fixes #43
This commit is contained in:
Bruno Sutic 2014-09-20 22:33:14 +02:00
parent 618769b62f
commit 1d09f07d2b
No known key found for this signature in database
GPG Key ID: 66D96E4F2F7EF26C
3 changed files with 5 additions and 3 deletions

View File

@ -1,6 +1,7 @@
# Changelog # Changelog
### master ### master
- remove dependency on `pgrep` command. Use `ps` for fetching process names.
### v1.2.1, 2014-09-02 ### v1.2.1, 2014-09-02
- tweak 'new_pane' creation strategy to fix #36 - tweak 'new_pane' creation strategy to fix #36

View File

@ -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 (optional). More details in
[restoring vim sessions](#restoring-vim-sessions). [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 `tmux-resurrect` is idempotent! It will not try to restore panes or windows that
already exist. already exist.

View File

@ -66,8 +66,9 @@ dump_panes_raw() {
} }
pane_full_command() { pane_full_command() {
pane_pid="$1" local pane_pid="$1"
\pgrep -lf -P "$pane_pid" | ps -eo "ppid command" |
grep "^${pane_pid}" |
cut -d' ' -f2- cut -d' ' -f2-
} }