mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-21 20:09:56 +08:00
completions/scp: silence error on unexpected version
There seem to be versions of ssh (possibly not from OpenSSH) that don't print the version number in -V, so make sure not to pass an empty string as numeric arg to test. Fixes #10445
This commit is contained in:
parent
85b3dbbec0
commit
2e42d80dc9
@ -44,8 +44,7 @@ complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)"
|
|||||||
|
|
||||||
# Remote path
|
# Remote path
|
||||||
# Get the list of remote files from the scp target.
|
# Get the list of remote files from the scp target.
|
||||||
string match -rq 'OpenSSH(_for_Windows)?_(?<major>\d+)\.*' -- (ssh -V 2>&1)
|
if string match -rq 'OpenSSH(_for_Windows)?_(?<major>\d+)\.*' -- (ssh -V 2>&1) && test "$major" -ge 9
|
||||||
if test "$major" -ge 9
|
|
||||||
complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
|
complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
|
||||||
(__scp_remote_target):( \
|
(__scp_remote_target):( \
|
||||||
command ssh (__scp2ssh_port_number) -o 'BatchMode yes' (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix)\* 2>/dev/null
|
command ssh (__scp2ssh_port_number) -o 'BatchMode yes' (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix)\* 2>/dev/null
|
||||||
|
Loading…
x
Reference in New Issue
Block a user