mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-18 00:31:15 -03:00
Update __fish_print_hostnames.fish
There was an issue in autocomplete of ssh.
When you put in ~/.ssh/config line like this:
"Include Include ${HRL_SSH}/onprem_config"
and then trying to use fish complete for ssh, for example:
"ssh -J" and press key <Tab> it throughs an error that fish cannot understand ${HRL_SSH} with brackets.
This commit is contained in:
@@ -76,6 +76,11 @@ function __fish_print_hostnames -d "Print a list of known hostnames"
|
||||
|
||||
set -l new_paths
|
||||
for path in $paths
|
||||
# while ssh_config is using brackets to resolve env, they should be removed
|
||||
# example
|
||||
# in ssh_config: ${SOME_PATH}
|
||||
# in fish: $SOME_PATH
|
||||
set path (string replace -r '\${([^}]+)}' '$1' $path)
|
||||
set -l expanded_path
|
||||
# Scope "relative" paths in accordance to ssh path resolution
|
||||
if string match -qrv '^[~/]' $path
|
||||
|
||||
Reference in New Issue
Block a user