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 23731
- From: Julien Nicoulaud <julien.nicoulaud@xxxxxxxxx>
- To: p.stephenson@xxxxxxxxxxx
- Subject: Re: Completion issue when zsh is not the default shell
- Date: Fri, 26 Oct 2018 20:49:43 +0200
- Cc: Mailing-list zsh-users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Ld86664+Qk5zfd/1oTd+PC6l3bsXeA6JAznaK4fGx50=; b=vOpB3nDhIxpfC5FH6O3X1HRx6E3RTf2PVFyjZbtTgVjgMUt2wKeMtvYZXMppSnCSnO ZwCYuB9SCCoHlFHKuy/hg/eomxPZd6i/mhuIWrYb+/wLL5F6V0PsqSUaZGNml8TPRni0 CqFMyI2E6PETQ2JUGOiTHys2tGF6bxG5jFnQ/QLdsksxpe2/6MqXwmeIf4bQuTP+Tayb qJk+46ZZbXL5Gt7UsdKFllOFouWSOCs5OynrNa3OD8Cevy/u6qJr4/4AG2Co7xPQaakW jRrVrx2MbOIypz09ukiQOwrUs/95Xsl79dmoC9DbbvBuAakL1HULhwJzPMuH+qklqh64 y+WA==
- In-reply-to: <20181026145522eucas1p245580c8ddf13dca70b5eae45af9a0205~hMFzZ7wLw1740617406eucas1p2G@eucas1p2.samsung.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> <20181026145522eucas1p245580c8ddf13dca70b5eae45af9a0205~hMFzZ7wLw1740617406eucas1p2G@eucas1p2.samsung.com>
Thanks for the detailed answer !
Your second guess was the right one: deleting zcompdump solved the issue. I
suspect this is related to bytecode compilation, I have this snippet at the
end of my zshrc:
autoload -U zrecompile && zrecompile -p $MAIN_USER_HOME/.{zcompdump,zshrc}
&>/dev/null
So it also could be zrecompile failing to detect changes in zcompdump, I
guess ?
Unfortunately I deleted the files before thinking of checking the
modification times... The home partition is using xfs with options
rw,relatime,attr2,inode64,noquota, maybe there is a gotcha.
Le ven. 26 oct. 2018 à 17:02, Peter Stephenson <p.stephenson@xxxxxxxxxxx> a
écrit :
> 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