Hi I have zstat on my system (mint) & works just fine. > zstat daily.log But I don't remember how/if I installed or configured it. I don't have it if I run > zsh -f e.g. I don't have this zmodload -F zsh/stat in my .zsh* configs Q1) Can you help Q2) How do you find out where you might have configured an zsh add-on etc zzapper
On Tue, May 3, 2022 at 7:25 AM zzapper <zsh@rayninfo.co.uk> wrote: > > I have zstat on my system (mint) & works just fine. > > I don't have it if I run > > > zsh -f > > e.g. I don't have this zmodload -F zsh/stat in my .zsh* configs And presumably you also don't have zmodload without the -F. > Q1) Can you help That remains to be seen. > Q2) How do you find out where you might have configured an zsh add-on etc Place this in your .zshenv: function zmodload() { builtin zmodload "$@" } functions -T zmodload This should print a trace each time zmodload is run. (If it doesn't, check that you haven't changed $ZDOTDIR) Then run zsh -o sourcetrace which traces one line for every file read with the "source" or "." commands. Between the two you should be able to see exactly where zsh/stat is coming from.
On 03/05/2022 15:54, Bart Schaefer wrote:
> On Tue, May 3, 2022 at 7:25 AM zzapper <zsh@rayninfo.co.uk> wrote:
>
> Place this in your .zshenv:
>
> function zmodload() { builtin zmodload "$@" }
> functions -T zmodload
>
> This should print a trace each time zmodload is run. (If it doesn't,
> check that you haven't changed $ZDOTDIR)
>
> Then run
>
> zsh -o sourcetrace
>
> which traces one line for every file read with the "source" or "."
> commands. Between the two you should be able to see exactly where
> zsh/stat is coming from.
Bart
function zmodload() { builtin zmodload "$@" }
functions -T zmodload
I guess the following generically loads anything in zsh/files ?
+zmodload:0> zmodload -F zsh/files b:zf_chown b:zf_mv b:zf_rm
zzapper
> On 03 May 2022 at 16:11 zzapper <zsh@rayninfo.co.uk> wrote:
> function zmodload() { builtin zmodload "$@" }
> functions -T zmodload
>
> I guess the following generically loads anything in zsh/files ?
>
> +zmodload:0> zmodload -F zsh/files b:zf_chown b:zf_mv b:zf_rm
No, if you consult the manual page you'll see that's exactly what
it doesn't do.
-F is for features, so you're explicitly loading just those three
builtins, zf_chown, zf_mv, zf_rm from zsh/files, and nothing else.
pws
On 03/05/2022 16:57, Peter Stephenson wrote:
>> On 03 May 2022 at 16:11 zzapper <zsh@rayninfo.co.uk> wrote:
>> function zmodload() { builtin zmodload "$@" }
>> functions -T zmodload
>>
>> I guess the following generically loads anything in zsh/files ?
>>
>> +zmodload:0> zmodload -F zsh/files b:zf_chown b:zf_mv b:zf_rm
> No, if you consult the manual page you'll see that's exactly what
> it doesn't do.
>
> -F is for features, so you're explicitly loading just those three
> builtins, zf_chown, zf_mv, zf_rm from zsh/files, and nothing else.
>
> pws
>
then bart's other suggestion reveals:-
> zsh -o sourcetrace
+/home/david/.zshenv:1> <sourcetrace>
+/home/david/.zshrc:1> <sourcetrace>
+/home/david/.zcompdump:1> <sourcetrace>
+/home/david/key-bindings.zsh:1> <sourcetrace>
+/usr/local/bin/plugin/z/zsh-z.plugin.zsh:1> <sourcetrace>
+/usr/local/bin/plugin/alias-tips/alias-tips.plugin.zsh:1> <sourcetrace>
On Tue, May 3, 2022 at 9:34 AM zzapper <zsh@rayninfo.co.uk> wrote:
>
> > zsh -o sourcetrace
> +/home/david/.zshenv:1> <sourcetrace>
> +/home/david/.zshrc:1> <sourcetrace>
> +/home/david/.zcompdump:1> <sourcetrace>
> +/home/david/key-bindings.zsh:1> <sourcetrace>
> +/usr/local/bin/plugin/z/zsh-z.plugin.zsh:1> <sourcetrace>
> +/usr/local/bin/plugin/alias-tips/alias-tips.plugin.zsh:1> <sourcetrace>
What do you get from
zsh -ic 'whence -v zstat'
??
On 04/05/2022 01:36, Bart Schaefer wrote:
> On Tue, May 3, 2022 at 9:34 AM zzapper <zsh@rayninfo.co.uk> wrote:
>> > zsh -o sourcetrace
>> +/home/david/.zshenv:1> <sourcetrace>
>> +/home/david/.zshrc:1> <sourcetrace>
>> +/home/david/.zcompdump:1> <sourcetrace>
>> +/home/david/key-bindings.zsh:1> <sourcetrace>
>> +/usr/local/bin/plugin/z/zsh-z.plugin.zsh:1> <sourcetrace>
>> +/usr/local/bin/plugin/alias-tips/alias-tips.plugin.zsh:1> <sourcetrace>
> What do you get from
>
> zsh -ic 'whence -v zstat'
>
> ??
> zsh -ic 'whence -v zstat'
> zstat is a shell builtin
>
On Tue, May 3, 2022 at 11:43 PM zzapper <zsh@rayninfo.co.uk> wrote:
>
> > zsh -ic 'whence -v zstat'
> > zstat is a shell builtin
Hm. Well, if making zmodload a function didn't uncover it, then it's
time to bring out the big guns:
disable zmodload
(in ~/.zshenv) and look for the errors.
If zstat still shows up after that, it's either being loaded from
/etc/zshenv, or zsh has been compiled with zstat as an autoloadable
builtin, both of which seem unlikely since you said it's not there for
"zsh -f".
On 04/05/2022 08:18, Bart Schaefer wrote:
> On Tue, May 3, 2022 at 11:43 PM zzapper <zsh@rayninfo.co.uk> wrote:
>>> zsh -ic 'whence -v zstat'
>>> zstat is a shell builtin
> Hm. Well, if making zmodload a function didn't uncover it, then it's
> time to bring out the big guns:
>
> disable zmodload
>
> (in ~/.zshenv) and look for the errors.
>
> If zstat still shows up after that, it's either being loaded from
> /etc/zshenv, or zsh has been compiled with zstat as an autoloadable
> builtin, both of which seem unlikely since you said it's not there for
> "zsh -f".
>
# OK I have now 'deleted' my .zshrc (kept a copy of course)
# I get the following 'odd' behaviour
If I start a new gnome terminal I have zstat
mint-HP-600B% zstat
zstat: no files given
# but if i reload zsh
mint-HP-600B% zsh
mint-HP-600B% zstat
zsh: command not found: zstat
So this has falsified my testing as I have always launched a new terminal
# confused.com
zzapper
> # OK I have now 'deleted' my .zshrc (kept a copy of course)
>
> # I get the following 'odd' behaviour
>
> If I start a new gnome terminal I have zstat
>
> mint-HP-600B% zstat
>
> zstat: no files given
>
>
> # but if i reload zsh
>
> mint-HP-600B% zsh
> mint-HP-600B% zstat
>
> zsh: command not found: zstat
Which terminal are you using?
There are several terminals out there that inject extra initialization
code into the shell that they spawn. This initialization code usually
runs between global and user zshenv and is meant to enable tighter
integration between the terminal and the shell. In practice all such
code has side effects and can leak or break things. The terminals I'm
aware of that do this are Kitty, Integrated Visual Studio Terminal,
Integrated IntelliJ Terminal, Warp, and Fig. When you manually run
`zsh` in a terminal of this kind, the new shell won't run the extra
initialization code.
Roman.
On 04/05/2022 10:49, Roman Perepelitsa wrote:
>> # OK I have now 'deleted' my .zshrc (kept a copy of course)
>>
>> # I get the following 'odd' behaviour
>>
>> If I start a new gnome terminal I have zstat
>>
>> mint-HP-600B% zstat
>>
>> zstat: no files given
>>
>>
>> # but if i reload zsh
>>
>> mint-HP-600B% zsh
>> mint-HP-600B% zstat
>>
>> zsh: command not found: zstat
> Which terminal are you using?
>
> There are several terminals out there that inject extra initialization
> code into the shell that they spawn. This initialization code usually
> runs between global and user zshenv and is meant to enable tighter
> integration between the terminal and the shell. In practice all such
> code has side effects and can leak or break things. The terminals I'm
> aware of that do this are Kitty, Integrated Visual Studio Terminal,
> Integrated IntelliJ Terminal, Warp, and Fig. When you manually run
> `zsh` in a terminal of this kind, the new shell won't run the extra
> initialization code.
>
> Roman.
Just the standard Mint 'Gnome Terminal' I guess I used chsh -s zsh to
make zsh default
zzapper
>> Roman.
>
> Just the standard Mint 'Gnome Terminal' I guess I used chsh -s zsh to
> make zsh default
>
> zzapper
>
>
# the following gives me zstat
autoload -U compinit && compinit -i
~ > zsh -f
~ > zstat
zsh: command not found: zstat
~ > autoload -U compinit && compinit -i
~ > zstat
zstat: no files given
zzapper
> On 04 May 2022 at 13:26 zzapper <zsh@rayninfo.co.uk> wrote:
> # the following gives me zstat
>
> autoload -U compinit && compinit -i
Looks like that's probably from compaudit. There are lots
of other completions that appear to load zstat for their
own use, too. The thing in compaudit could probably run
in a subshell, at the expense of some complexity passing
back names, but I don't know how worth while that is.
pws