Hi, It describes what files are loaded by zsh. But I like to monitor the progress in action. Is there a way to print the file whenever a file is loaded? Thanks. http://zsh.sourceforge.net/Doc/Release/Files.html -- Regards, Peng
On Fri, Sep 6, 2019 at 8:47 AM Peng Yu <pengyu.ut@gmail.com> wrote:
>
> It describes what files are loaded by zsh. But I like to monitor the
> progress in action. Is there a way to print the file whenever a file
> is loaded? Thanks.
In ~/.zshenv, add
setopt SOURCE_TRACE
This will miss /etc/zshenv but report everything else. This is a
fairly recent option, older versions do not have it.
On Fri, Sep 06, 2019 at 10:49:23AM -0700, Bart Schaefer wrote:
> On Fri, Sep 6, 2019 at 8:47 AM Peng Yu <pengyu.ut@gmail.com> wrote:
> >
> > It describes what files are loaded by zsh. But I like to monitor the
> > progress in action. Is there a way to print the file whenever a file
> > is loaded? Thanks.
>
> In ~/.zshenv, add
>
> setopt SOURCE_TRACE
>
> This will miss /etc/zshenv but report everything else. This is a
> fairly recent option, older versions do not have it.
Starting the shell with
zsh -o SOURCE_TRACE
should cover /etc/zshenv
I don't follow the documentation of `-o`. Could you please explain
what it means?
Options may be specified by name using the -o option. -o acts like a
single-letter option, but takes a following string as the option name.
On 9/6/19, Andreas Kusalananda Kähäri <andreas.kahari@abc.se> wrote:
> On Fri, Sep 06, 2019 at 10:49:23AM -0700, Bart Schaefer wrote:
>> On Fri, Sep 6, 2019 at 8:47 AM Peng Yu <pengyu.ut@gmail.com> wrote:
>> >
>> > It describes what files are loaded by zsh. But I like to monitor the
>> > progress in action. Is there a way to print the file whenever a file
>> > is loaded? Thanks.
>>
>> In ~/.zshenv, add
>>
>> setopt SOURCE_TRACE
>>
>> This will miss /etc/zshenv but report everything else. This is a
>> fairly recent option, older versions do not have it.
>
> Starting the shell with
>
> zsh -o SOURCE_TRACE
>
> should cover /etc/zshenv
>
--
Regards,
Peng
On Fri, Sep 6, 2019 at 11:45 AM Peng Yu <pengyu.ut@gmail.com> wrote:
>
> I don't follow the documentation of `-o`. Could you please explain
> what it means?
If you read "man zshoptions" you'll see that every option has a long
name (e.g., AUTO_CD or SOURCE_TRACE or XTRACE etc.), and a subset of
options also have a "single letter option" (prefixed by a hyphen).
The long name is for use with "setopt" and the single letter is for
use either with the builtin "set" command or as startup options to the
"zsh" invocation itself. In the event that you want to pass to "zsh"
an option that does not have a "single letter" variation, you can use
"zsh -o name" where "name" is the long name of the option; in the
current example: "zsh -o SOURCE_TRACE".