From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27642 invoked from network); 28 Jun 1999 17:34:54 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Jun 1999 17:34:54 -0000 Received: (qmail 17718 invoked by alias); 28 Jun 1999 17:34:45 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6899 Received: (qmail 17709 invoked from network); 28 Jun 1999 17:34:44 -0000 Message-Id: <9906281705.AA30579@ibmth.df.unipi.it> To: zsh-workers@sunsite.auc.dk Subject: Re: PATCH: pws-24: prompt escapes for script/function and lineno In-Reply-To: ""Andrej Borsenkow""'s message of "Mon, 28 Jun 1999 17:08:36 DFT." <003601bec167$55404460$21c9ca95@mow.siemens.ru> Date: Mon, 28 Jun 1999 19:05:56 +0200 From: Peter Stephenson "Andrej Borsenkow" wrote: > > > > > Maybe we should make '+%N:%i:%_> ' or something such the default PS4? > > Probably, %_ is a bit overkill. I tried it, and the resulting output is hard > to > read (mostly, because executed lines are no more aligned). > > I would suggest just '+%N:%i> '. It gives enough information to track down > problems. OK, this makes sense --- %N:%i is certainly unambiguous, and `content over form' is the zsh motto. (All right, that was a lie.) It's already long enough when you have lines like +/usr/local/lib/hepix/shells/site/aliases.sh:54> [ -r /u/theor/pubtheor/group_aliases.sh ] being executed by zsh -f. The default stays the same for sh and ksh emulations where promptpercent is not set. Another similar thing: It would be clearer to have xtrace output for `for' and `case' statements, to show what is being assigned to, or what is being tested against what. Any suggestions for an output format (xtrace doesn't usually show the full gory shell syntax)? --- Doc/Zsh/params.yo.ps4 Mon Jun 28 10:57:32 1999 +++ Doc/Zsh/params.yo Mon Jun 28 19:01:59 1999 @@ -650,7 +650,9 @@ ) vindex(PS4) item(tt(PS4) )( -The execution trace prompt. Default is `tt(PLUS() )'. +The execution trace prompt. Default is `tt(PLUS()%N:%i> )', which displays +the name of the current shell structure and the line number within it. +In sh or ksh emulation, the default is `tt(PLUS() )'. ) vindex(PROMPT) xitem(tt(PROMPT) ) --- Doc/Zsh/prompt.yo.ps4 Mon Jun 28 10:30:26 1999 +++ Doc/Zsh/prompt.yo Mon Jun 28 18:44:07 1999 @@ -132,7 +132,9 @@ The status of the parser, i.e. the shell constructs (like `tt(if)' and `tt(for)') that have been started on the command line. If given an integer number that many strings will be printed; zero or no integer means -print as many as there are. +print as many as there are. This is most useful in prompts tt(PS2) for +continuation lines and tt(PS4) for debugging with the tt(XTRACE) option; in +the latter case it will also work non-interactively. ) item(tt(%E))( Clears to end of line. --- Src/init.c.ps4 Sat Jun 26 15:58:22 1999 +++ Src/init.c Mon Jun 28 18:42:21 1999 @@ -624,7 +624,8 @@ prompt2 = ztrdup("%_> "); } prompt3 = ztrdup("?# "); - prompt4 = ztrdup("+ "); + prompt4 = (emulation == EMULATE_KSH || emulation == EMULATE_SH) + ? ztrdup("+ ") : ztrdup("+%N:%i> "); sprompt = ztrdup("zsh: correct '%R' to '%r' [nyae]? "); ifs = ztrdup(DEFAULT_IFS); -- Peter Stephenson Tel: +39 050 844536 WWW: http://www.ifh.de/~pws/ Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy