Skip to content

Commit d55f5e6

Browse files
committed
feat(scp,sftp): prefer ssh from same dir to resolve options etc
1 parent 185b063 commit d55f5e6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

completions/ssh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ _comp_cmd_sftp()
384384
local configfile
385385
_comp_cmd_ssh__configfile
386386

387+
# Prefer `ssh` from same dir for resolving options, etc
388+
local pathcmd
389+
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
390+
387391
_comp_xfunc_ssh_suboption_check && return
388392

389393
local ipvx=
@@ -524,6 +528,10 @@ _comp_cmd_scp()
524528
local configfile
525529
_comp_cmd_ssh__configfile
526530

531+
# Prefer `ssh` from same dir for resolving options, etc
532+
local pathcmd
533+
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH
534+
527535
_comp_xfunc_ssh_suboption_check && {
528536
((${#COMPREPLY[@]})) && COMPREPLY=("${COMPREPLY[@]/%/ }")
529537
return

0 commit comments

Comments
 (0)