mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-15 02:11:07 +02:00
16566: show ls -F classifiers as display strings.
This commit is contained in:
parent
c6d589aadd
commit
6b932f3cf7
2 changed files with 21 additions and 8 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2002-02-04 Clint Adams <clint@zsh.org>
|
||||||
|
|
||||||
|
* 16566: Completion/Unix/Command/_ssh: show ls -F
|
||||||
|
classifiers as display strings.
|
||||||
|
|
||||||
2002-02-04 Bart Schaefer <schaefer@zsh.org>
|
2002-02-04 Bart Schaefer <schaefer@zsh.org>
|
||||||
|
|
||||||
* 16556: Src/builtin.c: Error messages added in 16503 should not
|
* 16556: Src/builtin.c: Error messages added in 16503 should not
|
||||||
|
|
|
@ -1,18 +1,26 @@
|
||||||
#compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen
|
#compdef ssh slogin=ssh scp ssh-add ssh-agent ssh-keygen
|
||||||
|
|
||||||
_remote_files () {
|
_remote_files () {
|
||||||
# Rather than simple directory discrimination, there should be
|
# There should be coloring based on all the different ls -F classifiers.
|
||||||
# coloring based on all the different ls -F classifiers.
|
local expl remfiles remdispf remdispd
|
||||||
local expl remfiles
|
|
||||||
|
|
||||||
if zstyle -T ":completion:${curcontext}:" remote-access; then
|
if zstyle -T ":completion:${curcontext}:" remote-access; then
|
||||||
remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"})
|
if [[ $options[globdots] == "on" ]] && [[ "$PREFIX" == */ || -z "$PREFIX" ]];
|
||||||
|
then
|
||||||
|
print ssh -a -x ${words[CURRENT]%:*} ls -a1F ${words[CURRENT]#*:}
|
||||||
|
remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -a1F ${words[CURRENT]#*:} 2>/dev/null)"})
|
||||||
|
else
|
||||||
|
remfiles=(${(f)"$(ssh -a -x ${words[CURRENT]%:*} ls -d1F ${words[CURRENT]#*:}\* 2>/dev/null)"})
|
||||||
|
fi
|
||||||
|
|
||||||
_wanted files expl 'remote files' \
|
remdispf=(${remfiles:#*/})
|
||||||
compadd ${${remfiles:#*/}/[*=@|](#e)/}
|
remdispd=(${(M)remfiles:#*/})
|
||||||
|
|
||||||
_wanted dirs expl 'remote directories' \
|
_wanted files expl 'remote files and directories' \
|
||||||
compadd -S/ ${${(M)remfiles:#*/}/\\/(#e)/}
|
compadd -d remdispf ${${remfiles:#*/}/[*=@|](#e)/}
|
||||||
|
|
||||||
|
_wanted files expl 'remote files and directories' \
|
||||||
|
compadd -S/ -d remdispd ${${(M)remfiles:#*/}/\\/(#e)/}
|
||||||
else
|
else
|
||||||
_message 'remote files'
|
_message 'remote files'
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue