mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 13:39:02 +00:00
ssh completions: Don't call __fish_print_hostnames twice
Saves about 40% of the time in this completion.
This commit is contained in:
parent
2137e197fc
commit
a4c03e3d7b
1 changed files with 4 additions and 5 deletions
|
@ -7,11 +7,10 @@ __fish_complete_ssh ssh
|
|||
# ssh specific completions
|
||||
#
|
||||
complete -x -c ssh -d Hostname -a "
|
||||
(__fish_print_hostnames)
|
||||
|
||||
(
|
||||
# Prepend any username specified in the completion to the hostname
|
||||
echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p'
|
||||
# First print an empty line to get just the hostname
|
||||
(echo;
|
||||
# Then prepend any username specified in the completion to the hostname
|
||||
commandline -ct | string replace -rf '(.*@).*' '$1'
|
||||
)(__fish_print_hostnames)
|
||||
"
|
||||
|
||||
|
|
Loading…
Reference in a new issue