From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28116 invoked from network); 19 Jun 2020 17:09:46 -0000 Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with ESMTPUTF8; 19 Jun 2020 17:09:46 -0000 Received: (qmail 7446 invoked by alias); 19 Jun 2020 17:09:35 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: Sender: zsh-users@zsh.org X-Seq: 24937 Received: (qmail 17893 invoked by uid 1010); 19 Jun 2020 17:09:34 -0000 X-Qmail-Scanner-Diagnostics: from mout-p-103.mailbox.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.3/25842. spamassassin: 3.4.4. Clear:RC:0(80.241.56.161):SA:0(-2.0/5.0):. Processed in 2.317749 secs); 19 Jun 2020 17:09:34 -0000 X-Envelope-From: sstark+zsh@mailbox.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at mailbox.org designates 80.241.56.161 as permitted sender) X-Virus-Scanned: amavisd-new at heinlein-support.de Date: Fri, 19 Jun 2020 19:08:47 +0200 From: Sebastian Stark To: Daniel Shahaf Cc: zsh-users@zsh.org Subject: Re: Dynamic parameters for PROMPT_SUBST functions Message-ID: <20200619170847.iq2bjrnrmon5cctd@singold> Mail-Followup-To: Daniel Shahaf , zsh-users@zsh.org References: <20200619063233.zybs27xvqp56t4p5@singold> <20200619105640.17bd3107@tarpaulin.shahaf.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200619105640.17bd3107@tarpaulin.shahaf.local2> X-MBO-SPAM-Probability: 0 X-Rspamd-Score: -2.85 / 15.00 / 15.00 X-Rspamd-Queue-Id: 6CCF61693 X-Rspamd-UID: a0fd39 Am Freitag, den 19. Juni 2020 um 13:04 schrieb Daniel Shahaf: >Sebastian Stark wrote on Fri, 19 Jun 2020 08:32 +0200: >> I am trying to have a function call in my prompt that gets the return >> value of the last command as a parameter (%?). > >What would you do with «%?» if you could get its value? I would try to split it into signal and return value information, so I do not get "130" if I ctrl-c, but something like 0 and INT. >> In this example I write the parameter to a file, because if I just print >> it it would get printed as a literal %? and expanded later and thus hide >> the issue I am facing > >You could also print to /dev/tty. That's at least something I can take away from this, thanks :) Sebastian