Fix completion of remote scp filenames with spaces.
Backslash escaping adds 3 backslashes, of which we want to remove 2, not 4 when unescaping.
This commit is contained in:
parent
3191d14a55
commit
ff0f741dcf
2
CHANGES
2
CHANGES
@ -24,7 +24,7 @@ bash-completion (2.x)
|
||||
* Apply pine completion to alpine too.
|
||||
* Remove many unnecessary short option completions where long ones exist.
|
||||
* Improve configure, cvs, gkrellm, lftp, mdadm, modprobe, mplayer,
|
||||
mysqladmin, service, ssh, and general hostname completions.
|
||||
mysqladmin, service, scp, ssh, and general hostname completions.
|
||||
* Add abook and wtf completion, based on work by Raphaël Droz.
|
||||
* Add k3b and lftpget completion.
|
||||
* Don't overwrite other host completions when completing from multiple
|
||||
|
@ -177,7 +177,7 @@ _scp()
|
||||
userhost=${cur%%?(\\):*}
|
||||
path=${cur#*:}
|
||||
# unescape spaces
|
||||
path=${path//\\\\\\\\ / }
|
||||
path=${path//\\\\ / }
|
||||
if [ -z "$path" ]; then
|
||||
# default to home dir of specified user on remote host
|
||||
path=$(ssh -o 'Batchmode yes' $userhost pwd 2>/dev/null)
|
||||
|
Loading…
x
Reference in New Issue
Block a user