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

Re: PATCH: pws-24: prompt escapes for script/function and lineno



Peter Stephenson wrote:

> This implements the prompt escape %N for the nearest enclosing
> script/sourced file/function, and %i for the corresponding line number
> (sorry, %l, %L and %n were taken).  The main reason for having these is
> that the PROMPT_SUBST option is set by emulation, so an `emulate zsh' will
> turn it off, hence sticking $0 and $LINENO in PS4 is only partially
> successful, and expecting functions to set it seems unfair.  Another reason
> is that, because of FUNCTION_ARGZERO, it's not always possible to get the
> name of whatever's being executed as the internal scriptname variable isn't
> directly accessible.  I hope this seems reasonable.  People used to
> complain when you added new % sequences, but with the size of the code
> nowadays maybe they don't.

;-) That's why I  didn't dare to suggest something like this.

> Maybe we should make '+%N:%i:%_> ' or something such the default PS4?

Fine. (Many users wouldn't realise it otherwise, I think.)


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author