zsh-users
 help / color / mirror / code / Atom feed
* How reliable is %x prompt expansion?
@ 2023-02-13 16:26 Sebastian Gniazdowski
  2023-02-13 16:39 ` Roman Perepelitsa
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Gniazdowski @ 2023-02-13 16:26 UTC (permalink / raw)
  To: Zsh Users

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

Hi , currently, I'm doing:

0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}

on entry to each function or script. It works well, however, I'm planning
to update the plugin standard recommendation for $0 support and I'm
thinking if there are any circumstances where it might fail? $0 is to point
to the script/function source.

Also, I'm looking for a way to disable the promptsubst/print -P for a
single variable, something like `print -P ${(!%)var}`, where !% is to
denote that prompt expansion should not be done.

-- 
Best regards,
Sebastian Gniazdowski

[-- Attachment #2: Type: text/html, Size: 1570 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-02-13 16:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 16:26 How reliable is %x prompt expansion? Sebastian Gniazdowski
2023-02-13 16:39 ` Roman Perepelitsa

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).