mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-29 06:51:03 +02:00
43183: fix '_ttys -o' and use it in _gdb/_pgrep
This commit is contained in:
parent
71bc1296ed
commit
218a7e324d
4 changed files with 8 additions and 4 deletions
|
@ -3,6 +3,10 @@
|
|||
* 43189: Completion/Unix/Command/_install: similar fix as 43187
|
||||
for option -f (_flags was renamed to _file_flags)
|
||||
|
||||
* 43183: Completion/Unix/Type/_ttys, Completion/Unix/Command/_gdb,
|
||||
Completion/Unix/Command/_pgrep: fix '_ttys -o' on Linux, and use
|
||||
it in _gdb and _pgrep.
|
||||
|
||||
2018-07-19 Yasuhiro KIMURA <yasu@utahime.org>
|
||||
|
||||
* 43187: Completion/Unix/Command/_install: Fix completion error
|
||||
|
|
|
@ -5,12 +5,12 @@ local cur="$words[CURRENT]" prev w list ret=1 expl
|
|||
[[ "$PREFIX" = --* ]] &&
|
||||
_arguments -- '*=(CORE|SYM)FILE:core file:_files' \
|
||||
'*=EXECFILE:executable:_files -g \*\(-\*\)' \
|
||||
'*=TTY:terminal device:_ttys' && return 0
|
||||
'*=TTY: :_ttys -o' && return 0
|
||||
|
||||
if compset -P '-(cd|directory)='; then
|
||||
_files -/
|
||||
elif compset -P '-tty='; then
|
||||
_wanted devices expl 'terminal device' _ttys
|
||||
_ttys -o
|
||||
elif compset -P '-(exec|se)='; then
|
||||
_description files expl executable
|
||||
_files "$expl[@]" -g '*(-*)'
|
||||
|
|
|
@ -40,7 +40,7 @@ arguments=(
|
|||
# _signals is OK here — we do it differently below
|
||||
'(ss)--signal=[specify signal to send to process]: :_signals -s'
|
||||
'-T+[match only on specified routing table]:routing table'
|
||||
'(-t --terminal)'{-t+,--terminal=}'[match only on specified controlling terminals]:terminal device:_sequence _ttys -d'
|
||||
'(-t --terminal)'{-t+,--terminal=}'[match only on specified controlling terminals]: :_sequence _ttys -do'
|
||||
'(-U --uid)'{-U+,--uid=}'[match only on specified real user IDs]: :_sequence _users'
|
||||
'(-u --euid)'{-u+,--euid=}'[match only on specified effective user IDs]: :_sequence _users'
|
||||
'(-v --inverse)'{-v,--inverse}'[negate matching]'
|
||||
|
|
|
@ -12,7 +12,7 @@ local stripdev optdev open
|
|||
zparseopts -D -K -E d=stripdev D=optdev o=open
|
||||
|
||||
if [[ -n $open ]]; then
|
||||
ttys=( ${(u)${(f)"$(_call_program open-ttys ps -ao tty=)"}%% *} )
|
||||
ttys=( ${(u)${${(f)"$(_call_program open-ttys ps -Ao tty=)"}:#\?*}%% *} )
|
||||
_description open-ttys expl 'open tty'
|
||||
else
|
||||
ttys=( /dev/tty?*(N) /dev/pts/^ptmx(N) )
|
||||
|
|
Loading…
Reference in a new issue