Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] Line number in prompt after `zle reset-prompt'
- X-seq: zsh-workers 37043
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [BUG] Line number in prompt after `zle reset-prompt'
- Date: Sun, 1 Nov 2015 16:18:13 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=fvuvEHTruzxI6LtRyz3kBfMdIbhxfjC7XT6fper2Sc0=; b=X+cTMAGWNIrDOZdjLZ0O0mT3eTwWgxZstNlpo43ygHzWm4/SH9yAf74/aFicT0f0oI VQhEaXf2Vbupdl8No84VEG0ktyZCxwZq06X+WDLBtKgctXFsSaMBGhnCi5ClUqUz32Qr aeVQDZ3/5UAetMar48AV7rC61N8BPo3P6YZy08+xvDqfswxhUtQjs/5RpEzSySMq6X4A GKDYMpCe3D38+Er9exeYN9UXgxCZgBWitHCImLlok4hkhgPrAeJGKWqMG1We/3fG9jC/ qlRoovoSEtgVKQqpg/mTY1wJlEtabIN2nT4vUCP7Kv9sXuVG9ZJ/3bie0UUJ42WV7NAM 6zzg==
- In-reply-to: <151031132331.ZM21501@torch.brasslantern.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CAKc7PVDMKDHq+0nHrUa=VnTAVT6_iLLuLY4TM-fbV4HmROqd3g@mail.gmail.com> <151031132331.ZM21501@torch.brasslantern.com>
I would say it's not a bug. I found it possible to replace
"reset-prompt" with "redisplay" which doesn't re-expand prompt.
However, there is one interesting thing:
PROMPT=" %i # "
a() { zle redisplay }
zle -N a
b() { zle redisplay; zle -M "test" }
zle -N b
c() { zle -M "test" }
zle -N c
bindkey "^E" a
bindkey "^R" b
bindkey "^T" c
"a" and "c" will not reexpand prompt, while "b" will, apparently with no reason
Best regards,
Sebastian Gniazdowski
On 31 October 2015 at 21:23, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Oct 31, 7:42pm, Sebastian Gniazdowski wrote:
> }
> } PROMPT="%i # "
> } a() { zle reset-prompt }
> } zle -N a
> } bindkey "^E" a
> }
> } and press Ctrl-E. Line number will change
>
> Not sure this is a bug:
>
> %N
> The name of the script, sourced file, or shell function that zsh is
> currently executing, whichever was started most recently.
>
> %i
> The line number currently being executed in the script, sourced
> file, or shell function given by %N.
>
> If you use:
>
> PROMPT="%N %i # "
>
> and then press ^E, you will see
>
> a 0 #
>
> which is correct, the line number in the function "a" is 0.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author