zsh-workers
 help / color / mirror / code / Atom feed
* invoking a procedure to print the prompt
@ 2007-10-18 11:43 Dave Yost
  2007-10-18 11:48 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Yost @ 2007-10-18 11:43 UTC (permalink / raw)
  To: zsh-workers

I need my prompt to contain one thing in one situation and another 
thing in another situation.

It occurs to me that a more clean and powerful way to implement a 
custom prompt would be via a procedure rather than via the 
traditional prompt string variable substitution syntax.

I can't find a way to do this in the zsh man page.

It seems to me that the only reason prompts weren't implemented using 
functions would have to be the historical accident that shell 
functions came many years later.

Dave


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

* Re: invoking a procedure to print the prompt
  2007-10-18 11:43 invoking a procedure to print the prompt Dave Yost
@ 2007-10-18 11:48 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 2007-10-18 11:48 UTC (permalink / raw)
  To: zsh-workers

Dave Yost wrote:
> I need my prompt to contain one thing in one situation and another 
> thing in another situation.
> 
> It occurs to me that a more clean and powerful way to implement a 
> custom prompt would be via a procedure rather than via the 
> traditional prompt string variable substitution syntax.
> 
> I can't find a way to do this in the zsh man page.

It should be as simple as setting up a precmd function that defines
PS1.  If you are up-to-date you can use a suitable precmd_functions
element.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


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

end of thread, other threads:[~2007-10-18 11:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18 11:43 invoking a procedure to print the prompt Dave Yost
2007-10-18 11:48 ` Peter Stephenson

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