From: Sebastian Stark <sstark+zsh@mailbox.org>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: zsh-users@zsh.org
Subject: Re: Dynamic parameters for PROMPT_SUBST functions
Date: Fri, 19 Jun 2020 19:08:47 +0200 [thread overview]
Message-ID: <20200619170847.iq2bjrnrmon5cctd@singold> (raw)
In-Reply-To: <20200619105640.17bd3107@tarpaulin.shahaf.local2>
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
next prev parent reply other threads:[~2020-06-19 17:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-19 6:32 Sebastian Stark
2020-06-19 6:58 ` Lawrence Velázquez
2020-06-19 10:56 ` Daniel Shahaf
2020-06-19 17:08 ` Sebastian Stark [this message]
2020-06-20 11:06 ` Daniel Shahaf
2020-06-21 15:17 ` Sebastian Stark
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200619170847.iq2bjrnrmon5cctd@singold \
--to=sstark+zsh@mailbox.org \
--cc=d.s@daniel.shahaf.name \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).