diff options
author | Oliver Kiddle <opk@zsh.org> | 2016-09-13 17:43:38 +0200 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2016-09-13 17:43:38 +0200 |
commit | c5a3b170d431e10a4f82e91ce9e6347163393695 (patch) | |
tree | 609177019955b5d1f73328624bc416323e0cfeb5 /Completion/Base | |
parent | 1993a3cd2a7b479530da8f37f6fb3ea05a0efb71 (diff) | |
download | zsh-c5a3b170d431e10a4f82e91ce9e6347163393695.tar.gz zsh-c5a3b170d431e10a4f82e91ce9e6347163393695.tar.xz zsh-c5a3b170d431e10a4f82e91ce9e6347163393695.zip |
39299: better Freebsd support in _external_pwds using procstat
Diffstat (limited to 'Completion/Base')
-rw-r--r-- | Completion/Base/Completer/_external_pwds | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Completion/Base/Completer/_external_pwds b/Completion/Base/Completer/_external_pwds index 79e3ba0eb..a9dc859f1 100644 --- a/Completion/Base/Completer/_external_pwds +++ b/Completion/Base/Completer/_external_pwds @@ -22,9 +22,13 @@ case $OSTYPE in ) ;; linux*) - dirs=( /proc/${^$(pidof zsh):#$$}/cwd(N:P) ) + dirs=( /proc/${^$(pidof -- -zsh zsh):#$$}/cwd(N:P) ) dirs=( $^dirs(N^@) ) ;; + freebsd*) + dirs=( $(pgrep -U $UID -x zsh) ) + dirs=( $(procstat -h -f $dirs|awk '{if ($3 == "cwd") print $NF}') ) + ;; *) if (( $+commands[lsof] )); then dirs=( ${${${(M)${(f)"$(lsof -a -u $EUID -c zsh -p \^$$ -d cwd -F n -w |