zsh-users
 help / color / mirror / code / Atom feed
* functions in prompts evaluated twice?
@ 2008-03-09 11:56 Frank Terbeck
  0 siblings, 0 replies; only message in thread
From: Frank Terbeck @ 2008-03-09 11:56 UTC (permalink / raw)
  To: zsh users

Hey list,

I was about to use the output of a function in my prompt, when I
noticed, that it was evaluated twice.

[snip]
(6006)-~% zsh -f
zsh% setopt promptsubst
zsh% foo () { sleep 2 ; }
zsh% PROMPT='$(foo)%# '
% set -x
+zsh:1> foo
+foo:0> sleep 2
+zsh:1> foo
+foo:0> sleep 2
% 
[snap]

Is that supposed to be the way it is or is that a bug?

Regards, Frank

-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-09 12:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-09 11:56 functions in prompts evaluated twice? Frank Terbeck

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).