Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Dynamic parameters for PROMPT_SUBST functions
- X-seq: zsh-users 24935
- From: Lawrence Velázquez <vq@xxxxxxxxx>
- To: Sebastian Stark <sstark+zsh@xxxxxxxxxxx>
- Subject: Re: Dynamic parameters for PROMPT_SUBST functions
- Date: Fri, 19 Jun 2020 02:58:18 -0400
- Cc: zsh-users@xxxxxxx
- In-reply-to: <20200619063233.zybs27xvqp56t4p5@singold>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <20200619063233.zybs27xvqp56t4p5@singold>
- Sender: zsh-users@xxxxxxx
Hi Sebastian,
> On Jun 19, 2020, at 2:32 AM, Sebastian Stark <sstark+zsh@xxxxxxxxxxx>
> wrote:
>
> I am trying to have a function call in my prompt that gets the
> return value of the last command as a parameter (%?).
>
> However I am having trouble to get this right. Instead of an actual
> number, what is handed to the function is the literal string %?.
Yes, that is because the PROMPT_SUBST expansions (parameter, command,
and arithmetic) are done before the percent-escape sequences are
expanded.
vq
Messages sorted by:
Reverse Date,
Date,
Thread,
Author