Skip to content

Commit

Permalink
feat(scp,sftp): prefer ssh from same dir to resolve options etc
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed May 22, 2023
1 parent 185b063 commit d55f5e6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions completions/ssh
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ _comp_cmd_sftp()
local configfile
_comp_cmd_ssh__configfile

# Prefer `ssh` from same dir for resolving options, etc
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH

_comp_xfunc_ssh_suboption_check && return

local ipvx=
Expand Down Expand Up @@ -524,6 +528,10 @@ _comp_cmd_scp()
local configfile
_comp_cmd_ssh__configfile

# Prefer `ssh` from same dir for resolving options, etc
local pathcmd
pathcmd=$(type -P "$1") && local PATH=${pathcmd%/*}:$PATH

_comp_xfunc_ssh_suboption_check && {
((${#COMPREPLY[@]})) && COMPREPLY=("${COMPREPLY[@]/%/ }")
return
Expand Down

0 comments on commit d55f5e6

Please sign in to comment.