Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion issue when zsh is not the default shell
- X-seq: zsh-users 23729
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-users@xxxxxxx>
- Subject: Re: Completion issue when zsh is not the default shell
- Date: Fri, 26 Oct 2018 15:55:21 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181026145524euoutp02ed2dea3338426d6b26c711af8b6a5318~hMF0lRwYR0639806398euoutp02W
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1540565724; bh=Lt9B+rGcJlO3rfPZ8gOlU/duk/UnaM7ZIR8ttewpa1I=; h=Subject:From:To:Date:In-Reply-To:References:From; b=QYUZ16VMbn/rdrZf2rqvl1BG9Jx8vLPfFHlucpgN5Rv+XRRPxRQmMXQpmpiLTnqv7 /HuhdZsOZy9z6VSE9FckxuS3m7RtOD6L9/zLAwbP+z99Ql8L7vJdyD4lbMMXjj2mz3 CEx1EU9NNSXW++1OA1LYsBSQwQ3tbzKZfcgJZMOA=
- In-reply-to: <CA+mcLN5PjYfJ_yv1xDZW1+0XC7Lok85UGzChq0iUdKXrHD2ULA@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CGME20181026142713epcas1p2bcbd7c6efff6d9e809fdbedb51eb6eba@epcas1p2.samsung.com> <CA+mcLN5PjYfJ_yv1xDZW1+0XC7Lok85UGzChq0iUdKXrHD2ULA@mail.gmail.com>
On Fri, 2018-10-26 at 16:25 +0200, Julien Nicoulaud wrote:
> On my work machine bash is the default shell (AD accounts...), and I have
> an issue with the SSH completion:
>
> ssh sto<TAB>bash: _ssh_hosts: command not found...
>
> Trace file (see line 622): https://pastebin.com/raw/eE6XJbg2
>
> It looks like at some point bash is invoked, which tries to resolve
> _ssh_hosts and fails.
>
> If I explicitly "autoload _ssh_hosts", it works correctly. It looks like a
> bug to me ?
It clearly shouldn't be running bash, but it's entirely unclear from
what you say why it actually is. So I'm just having to guess.
Presumably _ssh_hosts is being found by your $path, rather than your
$fpath, so being executed as a command rather than function It's not
clear why your system would be set up to find _ssh_hosts that way --- it
means your shell function directory is being searched for commands --- but
it's not actually a problem in general so long as the "autoload" has
been done.
Given that explicitly using "autoload" works, that means _ssh_hosts *is*
also being found along $fpath.
So the issue is it's not being marked for autoload automatically. I can
think of a few reasons for this:
1. When "compinit" is run, $fpath isn't yet set up properly. You'd
need to track this down in the initialisation sequence. "compinit"
clearly is being run, or the shell wouldn't know about any association
between ssh completion _ssh_hosts.
2. You're hitting an old .zcompdump file that doesn't autoload this
but for some reason doesn't get detected as out of date. This isn't
particularly likely but "rm ~/.zcompdump*" is an easy thing to try and
only incurs a one-off reload penalty.
3. There's an alternative _ssh_hosts early in your $fpath and it
doesn't contain the first line needed by the completion system,
#autoload
that you'll see in the file that comes with zsh. This is probably my
top guess. Have a look at
print -l $^fpath/_ssh_hosts(N)
(expand fpath to include any occurence of _ssh_hosts but remove any
entries that aren't matched as files).
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author