mirror of
https://github.com/junegunn/fzf.git
synced 2025-11-17 15:53:39 -05:00
[bash,zsh] Skip comments in ~/.ssh/config
For the line "Host host1 # this is a comment", the current implementation generates words in an inline comment as hostnames. This patch removes the comment before generating the hostname.
This commit is contained in:
committed by
Junegunn Choi
parent
2bd29c3172
commit
f6c589c606
@@ -277,6 +277,7 @@ if ! declare -f __fzf_list_hosts > /dev/null; then
|
||||
# 16-year-old mawk unfortunately. We need to use [ \t] instead.
|
||||
match(tolower($0), /^[ \t]*host(name)?[ \t]*[ \t=]/) {
|
||||
$0 = substr($0, RLENGTH + 1) # Remove "Host(name)?=?"
|
||||
sub(/#.*/, "")
|
||||
for (i = 1; i <= NF; i++)
|
||||
if ($i !~ /[*?%]/)
|
||||
print $i
|
||||
|
||||
Reference in New Issue
Block a user