zsh-workers
 help / color / mirror / code / Atom feed
From: Michael Prokop <news@michael-prokop.at>
To: zsh-workers@sunsite.dk
Subject: Some questions regarding prompt themes
Date: Mon, 16 Aug 2004 09:20:52 +0200	[thread overview]
Message-ID: <2004-08-16T08-32-23@devnull.michael-prokop.at> (raw)

Hello,

I've tested the below documented behaviour with zsh versions 4.2.0
and 4.2.1 (CVS-sources). Some time ago I wrote my own prompt-themes
and noticed a (at least for me) strange and maybe unwanted
behaviour:

$ zsh -f
$ echo $PROMPT $PS1 $PS2 $PS3 $PS4
%m%#  %m%#  %_>  ?#  +%N:%i>
$ autoload promptinit && promptinit
$ prompt -p           # Preview given themes (defaults to all)
[...]
mika@tweety ~ %

Now I've a PROMPT-variable different from the above ("%m%# ").

Bart Schaefer wrote:

,---- [ Quoting http://www.zsh.org/mla/workers/2003/msg00434.html ]
| } One problem I noticed the other day is if one prompt sets PS3, PS4, or
| } RPS1, then those vars won't get reset when changing prompts, even when
| } setting the prompt to "off".
|
| It's a general shortcoming that themes only change the parts of the prompt
| that they're interested in; "off" is just another theme with a silly name.
|
| To really have "prompt off" mean what it seems to mean, the theme system
| would have to save and restore the original values of all the variables.
`----

My questions:

* In the prompt-theme "walters" exists a "export PROMPT=...":

$ grep -l export /usr/share/zsh/4.2.0/functions/Prompts/prompt*
  /usr/share/zsh/4.2.0/functions/Prompts/prompt_walters_setup

  Is using 'export PROMPT' in prompt-themes reasonable?

* Is it possible to "break out" of a precmd­statement?
  Some themes are using the precmd-option:

$ pwd && grep -l precmd *prompt*  | wc -l
  /usr/share/zsh/4.2.0/functions/Prompts
  13
$ grep 'precmd.*prompt_' *prompt* | wc -l
  8

  e.g. prompt_adam1_setup sets the prompt via the precmd statement.
  AFAICS this results in problems when running stuff like
    export PS1='test'
  manually ­ which IMHO does not work as it should.

* Would it be possible that 'prompt -p' does *not* export any
  prompt-variables so the prompt doesn't get modified by just
  running a preview of one/some/all themes?

* Does there exist a way to reset all prompt-values? Something like
  'prompt reset' would be very nice IMHO.

* What's the "right" way to set variables in a prompt-theme to avoid
  problems with other themes?  Would it make sense to "unset PS1
  PS2..." at the beginning of a prompt-theme to avoid any
  side-effects from other themes?

thanks for any feedback && regards,
(-: Michael
-- 
A german webpage for zsh / eine deutsche Webpage zur zsh:
http://www.michael-prokop.at/computer/tools_zsh.html
Die Zsh-Liebhaber-Seite:
http://www.michael-prokop.at/computer/tools_zsh_liebhaber.html


             reply	other threads:[~2004-08-16  7:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-16  7:20 Michael Prokop [this message]
2004-08-16  8:37 ` Bart Schaefer
2004-08-16 11:00   ` Michael Prokop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2004-08-16T08-32-23@devnull.michael-prokop.at \
    --to=news@michael-prokop.at \
    --cc=zsh-workers@sunsite.dk \
    --cc=zsh@michael-prokop.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).