diff --git a/init/completions/scp.fish b/init/completions/scp.fish index 6585bb404..f763da7c7 100644 --- a/init/completions/scp.fish +++ b/init/completions/scp.fish @@ -17,7 +17,7 @@ complete -c scp -d Hostname -a " ( #Prepend any username specified in the completion to the hostname - echo (commandline -ct)|grep -o '.*@' + echo (commandline -ct)|sed -nre 's/(.*@).*/\1/p' )( cat ~/.ssh/known_hosts{,2} ^/dev/null|cut -d ' ' -f 1| cut -d , -f 1 ): diff --git a/init/completions/ssh.fish b/init/completions/ssh.fish index e48f921a7..5cdccbb93 100644 --- a/init/completions/ssh.fish +++ b/init/completions/ssh.fish @@ -71,7 +71,7 @@ complete -x -c ssh -d Hostname -a " ( #Prepend any username specified in the completion to the hostname - echo (commandline -ct)|grep -o '.*@' + echo (commandline -ct)|sed -nre 's/(.*@).*/\1/p' )(__fish_print_hostnames) (__fish_print_users)@