scp: Recognise symlinks to directories as directories (Debian: #666055).
When auto-completing an scp command, slashes are added after (local or remote) directories, and spaces after files AND after symlinks to directories. Expected behaviour would be slashes after directories or symlinks to such.
This commit is contained in:
parent
709d6e0690
commit
89acac9910
@ -266,13 +266,13 @@ _scp_remote_files()
|
|||||||
if [[ $1 == -d ]]; then
|
if [[ $1 == -d ]]; then
|
||||||
# escape problematic characters; remove non-dirs
|
# escape problematic characters; remove non-dirs
|
||||||
files=$( ssh -o 'Batchmode yes' $userhost \
|
files=$( ssh -o 'Batchmode yes' $userhost \
|
||||||
command ls -aF1d "$path*" 2>/dev/null | \
|
command ls -aF1dL "$path*" 2>/dev/null | \
|
||||||
sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e '/[^\/]$/d' )
|
sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e '/[^\/]$/d' )
|
||||||
else
|
else
|
||||||
# escape problematic characters; remove executables, aliases, pipes
|
# escape problematic characters; remove executables, aliases, pipes
|
||||||
# and sockets; add space at end of file names
|
# and sockets; add space at end of file names
|
||||||
files=$( ssh -o 'Batchmode yes' $userhost \
|
files=$( ssh -o 'Batchmode yes' $userhost \
|
||||||
command ls -aF1d "$path*" 2>/dev/null | \
|
command ls -aF1dL "$path*" 2>/dev/null | \
|
||||||
sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e 's/[*@|=]$//g' \
|
sed -e 's/'$_scp_path_esc'/\\\\\\&/g' -e 's/[*@|=]$//g' \
|
||||||
-e 's/[^\/]$/& /g' )
|
-e 's/[^\/]$/& /g' )
|
||||||
fi
|
fi
|
||||||
@ -294,10 +294,10 @@ _scp_local_files()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if $dirsonly ; then
|
if $dirsonly ; then
|
||||||
COMPREPLY+=( $( command ls -aF1d $cur* 2>/dev/null | \
|
COMPREPLY+=( $( command ls -aF1dL $cur* 2>/dev/null | \
|
||||||
sed -e "s/$_scp_path_esc/\\\\&/g" -e '/[^\/]$/d' -e "s/^/$1/") )
|
sed -e "s/$_scp_path_esc/\\\\&/g" -e '/[^\/]$/d' -e "s/^/$1/") )
|
||||||
else
|
else
|
||||||
COMPREPLY+=( $( command ls -aF1d $cur* 2>/dev/null | \
|
COMPREPLY+=( $( command ls -aF1dL $cur* 2>/dev/null | \
|
||||||
sed -e "s/$_scp_path_esc/\\\\&/g" -e 's/[*@|=]$//g' \
|
sed -e "s/$_scp_path_esc/\\\\&/g" -e 's/[*@|=]$//g' \
|
||||||
-e 's/[^\/]$/& /g' -e "s/^/$1/") )
|
-e 's/[^\/]$/& /g' -e "s/^/$1/") )
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user