Zsh Mailing List Archive
Messages sorted by:
Re: Two different zsh sessions handle $* differently
- X-seq: zsh-workers 41592
- From: Mikael Puhakka <mr.progo@xxxxxxxxx>
- To: Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx>
- Subject: Re: Two different zsh sessions handle $* differently
- Date: Thu, 24 Aug 2017 09:05:49 +0300
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YPgjf79IxfRdrOLfz+0GouMqvgpApXhsRnPYuh15Upg=; b=A+vlXMH2R5VphfKFm2wGD+9KzKKhzTDUAKKx4dUXsnga8Kuq1J7j2p4vWkw0LgBwZF 1rP8ZwX0zF1mLKREwLSgcBYyJZryypv4BCTjJWkOSJimlmjXbyh++v3jwcHaq68GNXMj rzGeTW63O2WgbnZ9bTQyj3zHtG+dNEnehrQw/EC45lNOCerk39tTr/JO+MtVQlA4zGws dggdZGdXw5m/ztqir7B+3bDt47jZkFA7JGsZs9/qxUNMoUWxWCjP5z6o7uNrrXXyEQwl rTZbMLafvwsUHieQO6S50tf6TBa/2HKZGUYykHlkk0xjetnWOXyfhjiKv8bE+8y0zfuQ JGOQ==
- In-reply-to: <20170823191739.GA35723@tower.spodhuis.org>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAD1ad9bLy7cV8JByJcLg91ms1Eu27VDVQa8RA9H2Yf-tuBp4hA@mail.gmail.com> <20170823191739.GA35723@tower.spodhuis.org>
On 8/23/17, Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> This is broken. If you invoke >> j f* << then the argument list passed
> to the function is already expanded. In this case, you want an alias
Thanks for pointing this out. I knew it didn't work as intended and I
was pondering why's that the case -- I had it as an alias originally
when things worked and then started to functionize things. Wasn't using
the alias much at the time so the regression went largely unnoticed.
> Which python3 is used? Is it the same one in both environments, or is
> pyenv or equivalent using shell environment variables or .pyenv-version
> files to dispatch to a different interpreter, with one having sys.argv
> getting mangled in the start-up files?
Both examples run on home directory, the env points to the same python3
version 3.4.5, no virtualenvs.
> Is os.environ[PYTHONSTARTUP] defined, causing logic to happen before
> your code sees sys.argv?
Nothing defined there.
> Do you have any suffix or global aliases defined in the older zsh
> instance? `alias -s`, `alias -g`?
> 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.
+precmd:0> print -Pn '\e]2;zsh: %~\a'
+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.
Hope this helps.
Messages sorted by: