Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Two different zsh sessions handle $* differently



Mikael Puhakka wrote on Thu, 24 Aug 2017 09:05 +0300:
> On 8/23/17, Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> > You can use `setopt xtrace` (or `set -x`) to have zsh emit diagnostics
> > of what it's doing, so if you do that before invoking `j` then you might
> > see something different in the two environments.
> 
> This shows something alright:
> 
>     (~) j Test. ABC ABC ABC.
>     +preexec:0> print -Pn '\e]2;zsh: %~\a'
>     +zsh:1165> j Test. ABC ABC ABC.
> (*) +j:0> journal.py Test.ABCABCABC.
>     argv ['Test.']
>     +precmd:0> print -Pn '\e]2;zsh: %~\a'
>     +zsh:1166> parse_git_branch
>     +parse_git_branch:1> git branch --no-color
>     +parse_git_branch:2> sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
> 
> The starred line doesn't look correct. With a fresh session the same
> line goes like this:
> 
>     +j:0> journal.py 'Test. ABC ABC ABC.'
> 
> Now I'm not sure what happens. The faulty one strips whitespace and
> concatenates, (there doesn't seem to be nulls or anything separating the
> arguments) yet python sees only a part of the argument.

Have you set $IFS to $'\0'?  Check with 'typeset -p IFS'.



Messages sorted by: Reverse Date, Date, Thread, Author