From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8305 invoked by alias); 1 Nov 2015 15:18:38 -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: 37043 Received: (qmail 11192 invoked from network); 1 Nov 2015 15:18:37 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 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== X-Received: by 10.112.130.138 with SMTP id oe10mr2655439lbb.54.1446391112554; Sun, 01 Nov 2015 07:18:32 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <151031132331.ZM21501@torch.brasslantern.com> References: <151031132331.ZM21501@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Sun, 1 Nov 2015 16:18:13 +0100 Message-ID: Subject: Re: [BUG] Line number in prompt after `zle reset-prompt' To: Zsh hackers list Content-Type: text/plain; charset=UTF-8 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 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.