ssh/scp autocompletion broken in Karmic
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash-completion (Ubuntu) |
New
|
Undecided
|
Unassigned | ||
Bug Description
Binary package hint: bash-completion
When passwordless authentication is setup, scp allows autocompletion of the nature:
scp host:/home/
This appears to be broken in Karmic (Kubuntu anyway) as this line in /etc/bash_
_expand || return 0
This means that, typing the above expands to /home/martin/
My revised version, that now works, looks like this for the _scp function:
_scp()
{
local cur userhost path
# replaced by the above 2 lines
## Removed to avoid local expansion
#_expand || return 0
if [[ "$prev" == *:* ]]; then
# This happens when there is a : in the path
# remove backslash escape from :
# unescape spaces
if [ -z "$path" ]; then
fi
# escape spaces; remove executables, aliases, pipes and
# sockets;
# add space at end of file names
fi
[[ "$cur" == */* ]] || _known_hosts -c -a
return 0
}
complete -F _scp $nospace scp
I have written a succinct patch that appears to fix the issue.
Regards,
Martin