diff --git a/share/completions/mosh.fish b/share/completions/mosh.fish index 1aa92f895..36a00b36f 100644 --- a/share/completions/mosh.fish +++ b/share/completions/mosh.fish @@ -1,13 +1,5 @@ -complete -x -c mosh -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 mosh -d Hostname -a "(__fish_complete_user_at_hosts)" complete -x -c mosh -d User -a " (__fish_print_users)@ diff --git a/share/completions/scp.fish b/share/completions/scp.fish index f6c959198..73e4bb552 100644 --- a/share/completions/scp.fish +++ b/share/completions/scp.fish @@ -30,13 +30,7 @@ end # Hostname # complete -c scp -d Hostname -n "commandline --cut-at-cursor --current-token | string match -v '*:*'" -a " -(__fish_print_hostnames): - -( - #Prepend any username specified in the completion to the hostname - commandline -ct |sed -ne 's/\(.*@\).*/\1/p' -)(__fish_print_hostnames): -" +(__fish_complete_user_at_hosts):" # # Local path diff --git a/share/completions/ssh.fish b/share/completions/ssh.fish index f9f4dc328..b90c7117e 100644 --- a/share/completions/ssh.fish +++ b/share/completions/ssh.fish @@ -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 " diff --git a/share/completions/sshfs.fish b/share/completions/sshfs.fish index 88de8db3b..1f224b0fe 100644 --- a/share/completions/sshfs.fish +++ b/share/completions/sshfs.fish @@ -1,19 +1,7 @@ # # Completions for sshfs # -# Host combinations, borrowed from ssh.fish -# -complete -x -c sshfs -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): - -(__fish_print_users)@ -" +complete -x -c sshfs -d Hostname -a "(__fish_complete_user_at_hosts):" # # Mount Points #