Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: SSH hostname completion with common suffix and globcomplete inserts characters
- X-seq: zsh-workers 39056
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: SSH hostname completion with common suffix and globcomplete inserts characters
- Date: Wed, 17 Aug 2016 15:36:18 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=+0Yx8eb61Gt77Vz1ryFaWu/CW12nOXJw7p5i9lQGy0E=; b=FSZh7Wk3zmBDSAJlmCHFh5WVuiokRanR/9lX8UPaKODIyCBdrH+6jkk3va6ktnqH0Y X+iMhYvWI48ynXBkoqNKESqjeGpiS0Lx7ZCFx6BiyrE4wgXydwjX3f53JIQGRbdsPaW1 EklLCeiV6m0gUXNMdn+Il+a78kJJN7VHIaXrlxIVA6EROJjF5miLa2UDTWp7WM2YQPfp EzIGN6fB518f6P9irEst7AB0LxwWVESSfdIfvH5le/ZG0vXwjHDIJvnURf9DA9xyWk8q VVvkZvtwJnYmO31ZJCb6Lrendq/WXrJsHulSIjBwM1Bx+sokPF4zINJRx5YnbyYUqO8s CEhA==
- In-reply-to: <705fb246-abcf-176b-d4fa-eb0e01cded05@thequod.de>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <705fb246-abcf-176b-d4fa-eb0e01cded05@thequod.de>
On Aug 17, 9:16pm, Daniel Hahler wrote:
}
} % echo "Host test-05827d88.foo.bar test-6cae9ce0.foo.bar" > ssh_config
} % setopt globcomplete
} % ssh -F ssh_config test-<TAB>
} % ssh -F ssh_config test-|.foo.bar
} % ssh -F ssh_config test-|BR.foo.bar
I compared _complete_debug output for the two cases and there's no
significant difference until the value of compstate[unambiguous] is
displayed near the end, so this looks like an off-by-one error in
the internals.
Cursory examination seems to point to implicit addition/removal of
the "*" pattern at the cursor position when doing globcomplete. If
instead one explicitly completes
% ssh -F ssh_config test-*<TAB>
then a listing of possible matches appears and the update of the line
is correct.
} The characters being inserted seem to come from the "bar".
I think the characters being inserted are just stack (or heap) garbage;
it may coincidentally be garbage derived from trying a case replacement,
but I don't think that's directly related.
Places to look more closely seem to be computil.c:cfp_opt_pats() and
compcore.c:addmatches(), look for comppatmatch. For example, most of
cfp_opt_pats() is skipped if the prefix or suffix already contains a
pattern (as in "test-*") but is active if the prefix has no pattern
and comppatmatch is non-empty (as is the case for globcomplete).
Messages sorted by:
Reverse Date,
Date,
Thread,
Author