mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 20:31:19 -03:00
Use __fish_complete_user_at_hosts
for various completions. This makes the code a bit nicer, removes one of the __fish_print_hostnames calls (which are slow) and a sed call, thereby improving performance by about 33% (600ms to 400ms). Fixes #4511.
This commit is contained in:
@@ -6,14 +6,7 @@ __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'
|
||||
)(__fish_print_hostnames)
|
||||
"
|
||||
complete -x -c ssh -d Hostname -a "(__fish_complete_user_at_hosts)"
|
||||
|
||||
# Disable as username completion is not very useful.
|
||||
# complete -x -c ssh -d User -a "
|
||||
|
||||
Reference in New Issue
Block a user