mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-04 15:41:12 -03:00
ssh completions: Don't call __fish_print_hostnames twice
Saves about 40% of the time in this completion.
This commit is contained in:
@@ -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)
|
||||
"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user