From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21317 invoked from network); 16 Aug 2004 07:22:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 16 Aug 2004 07:22:33 -0000 Received: (qmail 17807 invoked from network); 16 Aug 2004 07:22:27 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 16 Aug 2004 07:22:27 -0000 Received: (qmail 12151 invoked by alias); 16 Aug 2004 07:22:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 20261 Received: (qmail 12142 invoked from network); 16 Aug 2004 07:22:15 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 16 Aug 2004 07:22:15 -0000 Received: (qmail 17110 invoked from network); 16 Aug 2004 07:20:57 -0000 Received: from www.vc-graz.ac.at (HELO proxy.vc-graz.ac.at) (193.171.121.30) by a.mx.sunsite.dk with SMTP; 16 Aug 2004 07:20:55 -0000 Received: from localhost (b-55.vc-graz.ac.at [193.171.241.55]) by proxy.vc-graz.ac.at (8.12.11/8.12.11) with ESMTP id i7G7KqgB002770 for ; Mon, 16 Aug 2004 09:20:52 +0200 (MEST) Date: Mon, 16 Aug 2004 09:20:52 +0200 From: Michael Prokop To: zsh-workers@sunsite.dk Subject: Some questions regarding prompt themes Message-ID: <2004-08-16T08-32-23@devnull.michael-prokop.at> Reply-To: Michael Prokop Mail-Followup-To: zsh-workers@sunsite.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-URL: http://www.michael-prokop.at/ X-Operating-System: Debian GNU/Linux - 2.6.2 on a i686 X-Registered-Linux-User: 224337 X-Crypto: GnuPG/1.2.3 http://www.gnupg.org X-GPG-Key-ID: 0x37E272E8 X-GPG-Key: http://www.michael-prokop.at/gpg X-GPG-Fingerprint: 04AE E62C 9502 CD34 A7DA 857B D8DF 53FB 37E2 72E8 User-Agent: Mutt/1.5.6i X-Virus-Scanned: clamd / ClamAV version 0.75.1, clamav-milter version 0.75c on proxy.vc-graz.ac.at X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=-0.0 required=6.0 tests=BAYES_40 autolearn=no version=2.63 X-Spam-Hits: -0.0 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