Skip to content

Commit

Permalink
fix(scp remote_files): do not filter generated paths with "$cur"
Browse files Browse the repository at this point in the history
This is a regression introduced by commit f2df91d, where
`_comp_split` was replaced by `_comp_compgen_split` assuming that the
generated words are starting with "$cur".  However, we here would like
to generate the paths essentially starting with `_path=${cur#*:}`
instead of $cur because the caller re-assembles $cur with `-n :`, yet
Readline expects the words after `:`.

Fixes #1157
  • Loading branch information
akinomyoga committed Apr 5, 2024
1 parent 50865aa commit bc812df
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion completions/ssh
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ _comp_xfunc_scp_compgen_remote_files()
command sed -e 's/'"$_comp_cmd_scp__path_esc"'/\\\\\\&/g' -e 's/[*@|=]$//g' \
-e 's/[^\/]$/& /g')
fi
_comp_compgen_split -l -- "$_files"
_comp_compgen -R split -l -- "$_files"
}

# @deprecated 2.12 use `_comp_compgen -ax ssh remote_files` instead
Expand Down

0 comments on commit bc812df

Please sign in to comment.