From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1904 invoked by alias); 24 Aug 2017 06:05:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41592 Received: (qmail 4227 invoked by uid 1010); 24 Aug 2017 06:05:57 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk0-f169.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.169):SA:0(-1.4/5.0):. Processed in 2.99807 secs); 24 Aug 2017 06:05:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_SPAM, SPF_PASS,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 X-Envelope-From: mr.progo@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YPgjf79IxfRdrOLfz+0GouMqvgpApXhsRnPYuh15Upg=; b=HjASYt+jo8ZdF6xu185mF58y6sGx2j1LsFk9VWW42lfHh4TW3UV80407D4zBcv0b4E 6Tsk1FIoMEJAnYrMyS1e800qg+c+SXll9Iag2gKjmjsZ03Dj0kVrkJ1/SbDreyyqb+ns DgH64TZa3lN7YuUKCo4QvbPvL57mP4dxNGiNC2/fBvrIftuN12oXbe4q+P+dximUDotX IjgRHv+1Y6PImPpwlMeRfbJMF6YdCTghaK+7m0bCSLCBl/cwpg2pyLV7cOXn+9126WCn 3MJV/ZnNLBBe2c0/DtYLfH5LP7evjZxtPtclDsPat0LIBcgssQKkP2bKkxu7JsJwir8L IyjQ== X-Gm-Message-State: AHYfb5hZnR+IJ1GV3jW5sDTGIqQXEfj1F81lKEIs/7uiJuxMKIwqu7w0 4cmhz0RRtH40IJOg0krc3OvjGvbI1wYT X-Received: by 10.55.159.134 with SMTP id i128mr7840168qke.72.1503554749659; Wed, 23 Aug 2017 23:05:49 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20170823191739.GA35723@tower.spodhuis.org> References: <20170823191739.GA35723@tower.spodhuis.org> From: Mikael Puhakka Date: Thu, 24 Aug 2017 09:05:49 +0300 Message-ID: Subject: Re: Two different zsh sessions handle $* differently To: Phil Pennock Cc: zsh-workers@zsh.org Content-Type: text/plain; charset="UTF-8" On 8/23/17, Phil Pennock 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 > instead. 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`? No, nothing. > 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. Hope this helps. BR, -- Mikael