Fix scp completion for WSL (with ssh.exe) (#10290)

* Fix scp completion for WSL (with ssh.exe)

* Be more explicit
This commit is contained in:
RomainGiraud 2024-03-09 22:39:57 +01:00 committed by GitHub
parent 6d30363090
commit f8757d154c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -44,7 +44,7 @@ complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)"
# Remote path
# Get the list of remote files from the scp target.
string match -rq 'OpenSSH_(?<major>\d+)\.*' -- (ssh -V 2>&1)
string match -rq 'OpenSSH(_for_Windows)?_(?<major>\d+)\.*' -- (ssh -V 2>&1)
if test "$major" -ge 9
complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
(__scp_remote_target):( \