Skip to content

Commit 9dc3f8c

Browse files
committed
Always use 'ps -ao' to detect commands
Previously we used 'ps -eo' for some operating systems. It turns out flags '-ao' work fine for all, and it should also be fine per posix spec http://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html#tag_20_96
1 parent 6feae65 commit 9dc3f8c

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
- allow using '$HOSTNAME' in @resurrect-dir
2323
- add zsh history saving and restoring
2424
- delete resurrect files older than 30 days, but keep at least 5 files
25+
- add save and restore hooks
26+
- always use `-ao` flags for `ps` command to detect commands
2527

2628
### v2.4.0, 2015-02-23
2729
- add "tmux-test"

save_command_strategies/ps.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,8 @@ exit_safely_if_empty_ppid() {
1010
fi
1111
}
1212

13-
ps_command_flags() {
14-
case $(uname -s) in
15-
FreeBSD) echo "-ao" ;;
16-
OpenBSD) echo "-ao" ;;
17-
*) echo "-eo" ;;
18-
esac
19-
}
20-
2113
full_command() {
22-
ps "$(ps_command_flags)" "ppid command" |
14+
ps -ao "ppid command" |
2315
sed "s/^ *//" |
2416
grep "^${PANE_PID}" |
2517
cut -d' ' -f2-

0 commit comments

Comments
 (0)