Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [BUG] Line number in prompt after `zle reset-prompt'



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