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

Re: Can $_ substitute $0 when nofunctionargzero



On 10 June 2016 at 08:12, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> On 9 June 2016 at 22:46, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>>     $(print -P %N), which works for any zsh of the past 16 years
>>     ${(%):-%N}, which has worked for the past 13 years
>>     ${funcstack[1]} (or $funcstack[0] if ksharrays), somewhat newer
>
> That's just great, thanks! I already added "0=${(%):-%N}" to my
> plugins. Should have just asked earlier.

Just noted that when recording asciinema video, $0 nor %N do work.
Both contain only file name, without path. Seems pretty weird?

~ Asciicast recording started.
~ Hit Ctrl-D or type "exit" to finish.
# PATH="$PATH:`pwd`"
test_program
0: test_program, ZERO: test_program
# exit
~ Asciicast recording finished.
~ Press <Enter> to upload, <Ctrl-C> to cancel.
^C%
# PATH="$PATH:`pwd`"
# test_program
0: /Users/sgniazdowski/test_program, ZERO: /Users/sgniazdowski/test_program

Best regards,
Sebastian Gniazdowski



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