From: Julien Nicoulaud <julien.nicoulaud@gmail.com>
To: p.stephenson@samsung.com
Cc: Mailing-list zsh-users <zsh-users@zsh.org>
Subject: Re: Completion issue when zsh is not the default shell
Date: Fri, 26 Oct 2018 20:49:43 +0200 [thread overview]
Message-ID: <CA+mcLN4E3Ggqy1aWubue1VyNMoKoyBuvshgXRN+YnAhSnZ9Rfw@mail.gmail.com> (raw)
In-Reply-To: <20181026145522eucas1p245580c8ddf13dca70b5eae45af9a0205~hMFzZ7wLw1740617406eucas1p2G@eucas1p2.samsung.com>
[-- Attachment #1: Type: text/plain, Size: 2903 bytes --]
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@samsung.com> 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
>
>
>
next prev parent reply other threads:[~2018-10-26 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20181026142713epcas1p2bcbd7c6efff6d9e809fdbedb51eb6eba@epcas1p2.samsung.com>
2018-10-26 14:25 ` Julien Nicoulaud
2018-10-26 14:55 ` Peter Stephenson
2018-10-26 18:49 ` Julien Nicoulaud [this message]
2018-10-28 4:20 ` Phil Pennock
2018-10-30 15:19 ` Julien Nicoulaud
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CA+mcLN4E3Ggqy1aWubue1VyNMoKoyBuvshgXRN+YnAhSnZ9Rfw@mail.gmail.com \
--to=julien.nicoulaud@gmail.com \
--cc=p.stephenson@samsung.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).