zsh-users
 help / color / mirror / code / Atom feed
* zshrc alias
@ 2013-10-02 19:37 shawn wilson
  2013-10-02 19:45 ` Jérémie Roquet
  2013-10-02 22:19 ` Phil Pennock
  0 siblings, 2 replies; 6+ messages in thread
From: shawn wilson @ 2013-10-02 19:37 UTC (permalink / raw)
  To: Zsh Users

Is there a way to see what zsh is doing when it loads the rc file?

I've got a perl alias that isn't showing up when I loging or source
~/.zshrc or . ~/.zshrc but the aliases before and after do:
alias torexit="curl
http://torstatus.blutmagie.de/ip_list_exit.php/Tor_ip_list_EXIT.csv"
alias perl="perl -MData::Dumper"
alias dicepass="perl -MCrypt::XkcdPassword -e 'print
Crypt::XkcdPassword->make_password(\$_)'"

I'm not sure how best to debug this - something outside of these lines
is messing with me (I get the same result when I move that line to the
beginning of the aliases).

PS - if anyone goes to use that dicepass alias, note it only gives 4
words no matter whether you specify something else.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: zshrc alias
  2013-10-02 19:37 zshrc alias shawn wilson
@ 2013-10-02 19:45 ` Jérémie Roquet
  2013-10-02 19:54   ` shawn wilson
  2013-10-02 22:19 ` Phil Pennock
  1 sibling, 1 reply; 6+ messages in thread
From: Jérémie Roquet @ 2013-10-02 19:45 UTC (permalink / raw)
  To: shawn wilson; +Cc: Zsh Users

Hi,

2013/10/2 shawn wilson <ag4ve.us@gmail.com>:
> Is there a way to see what zsh is doing when it loads the rc file?

Try “zsh -x” or “setopt xtrace” in a already running shell.

Best regards,

-- 
Jérémie


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: zshrc alias
  2013-10-02 19:45 ` Jérémie Roquet
@ 2013-10-02 19:54   ` shawn wilson
  2013-10-02 20:09     ` Jérémie Roquet
  0 siblings, 1 reply; 6+ messages in thread
From: shawn wilson @ 2013-10-02 19:54 UTC (permalink / raw)
  To: Jérémie Roquet; +Cc: Zsh Users

ok, I like zsh -x but it's running out of the buffer. How do I dump it?

I'm guessing it's comming out of another fd?

% zsh -x > trace 2>&1

didn't produce any info


On Wed, Oct 2, 2013 at 3:45 PM, Jérémie Roquet <arkanosis@gmail.com> wrote:
> Hi,
>
> 2013/10/2 shawn wilson <ag4ve.us@gmail.com>:
>> Is there a way to see what zsh is doing when it loads the rc file?
>
> Try “zsh -x” or “setopt xtrace” in a already running shell.
>
> Best regards,
>
> --
> Jérémie


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: zshrc alias
  2013-10-02 19:54   ` shawn wilson
@ 2013-10-02 20:09     ` Jérémie Roquet
  0 siblings, 0 replies; 6+ messages in thread
From: Jérémie Roquet @ 2013-10-02 20:09 UTC (permalink / raw)
  To: shawn wilson; +Cc: Zsh Users

2013/10/2 shawn wilson <ag4ve.us@gmail.com>:
> ok, I like zsh -x but it's running out of the buffer. How do I dump it?
>
> I'm guessing it's comming out of another fd?
>
> % zsh -x > trace 2>&1
>
> didn't produce any info

AFAIK, this should work. Have you exited the shell launched with the
-x flag? Eg.:

$ zsh -x > trace 2>&1
$ exit
$ cat trace

-- 
Jérémie


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: zshrc alias
  2013-10-02 19:37 zshrc alias shawn wilson
  2013-10-02 19:45 ` Jérémie Roquet
@ 2013-10-02 22:19 ` Phil Pennock
  2013-10-02 22:27   ` shawn wilson
  1 sibling, 1 reply; 6+ messages in thread
From: Phil Pennock @ 2013-10-02 22:19 UTC (permalink / raw)
  To: shawn wilson; +Cc: Zsh Users

On 2013-10-02 at 15:37 -0400, shawn wilson wrote:
> Is there a way to see what zsh is doing when it loads the rc file?

I keep this at the top of my .zshenv file and uncomment the first line
when I want to debug something:

----------------------------8< cut here >8------------------------------
#TRACE_ZSH_TIME=t TRACE_ZSH=t TRACE_ZSH_FILE=/tmp/pdp-zsh.$$.log

[[ -n $TRACE_ZSH_PROF ]] && zmodload -i zsh/zprof
[[ -n $TRACE_ZSH_TIME ]] && PS4='+[%D{%M:%S}]%N:%i> '
if [[ -n $TRACE_ZSH ]]; then
        [[ -n "$TRACE_ZSH_FILE" ]] && exec 2> "${TRACE_ZSH_FILE}"
        setopt xtrace
fi
----------------------------8< cut here >8------------------------------

Yes, you lose stderr to a file, I can accept that for the purpose of
this debugging.

-Phil


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: zshrc alias
  2013-10-02 22:19 ` Phil Pennock
@ 2013-10-02 22:27   ` shawn wilson
  0 siblings, 0 replies; 6+ messages in thread
From: shawn wilson @ 2013-10-02 22:27 UTC (permalink / raw)
  To: shawn wilson, Zsh Users

Very cool. Thanks.

On Wed, Oct 2, 2013 at 6:19 PM, Phil Pennock
<zsh-workers+phil.pennock@spodhuis.org> wrote:
> On 2013-10-02 at 15:37 -0400, shawn wilson wrote:
>> Is there a way to see what zsh is doing when it loads the rc file?
>
> I keep this at the top of my .zshenv file and uncomment the first line
> when I want to debug something:
>
> ----------------------------8< cut here >8------------------------------
> #TRACE_ZSH_TIME=t TRACE_ZSH=t TRACE_ZSH_FILE=/tmp/pdp-zsh.$$.log
>
> [[ -n $TRACE_ZSH_PROF ]] && zmodload -i zsh/zprof
> [[ -n $TRACE_ZSH_TIME ]] && PS4='+[%D{%M:%S}]%N:%i> '
> if [[ -n $TRACE_ZSH ]]; then
>         [[ -n "$TRACE_ZSH_FILE" ]] && exec 2> "${TRACE_ZSH_FILE}"
>         setopt xtrace
> fi
> ----------------------------8< cut here >8------------------------------
>
> Yes, you lose stderr to a file, I can accept that for the purpose of
> this debugging.
>
> -Phil


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-10-02 22:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-02 19:37 zshrc alias shawn wilson
2013-10-02 19:45 ` Jérémie Roquet
2013-10-02 19:54   ` shawn wilson
2013-10-02 20:09     ` Jérémie Roquet
2013-10-02 22:19 ` Phil Pennock
2013-10-02 22:27   ` shawn wilson

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).