From: Peter Stephenson <pws@ibmth.df.unipi.it>
To: zsh-workers@sunsite.auc.dk
Subject: Re: PATCH: pws-24: prompt escapes for script/function and lineno
Date: Mon, 28 Jun 1999 19:05:56 +0200 [thread overview]
Message-ID: <9906281705.AA30579@ibmth.df.unipi.it> (raw)
In-Reply-To: ""Andrej Borsenkow""'s message of "Mon, 28 Jun 1999 17:08:36 DFT." <003601bec167$55404460$21c9ca95@mow.siemens.ru>
"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) <S>)(
-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) <S> <Z>)
--- 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 <pws@ibmth.df.unipi.it> Tel: +39 050 844536
WWW: http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy
next prev parent reply other threads:[~1999-06-28 17:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-28 9:32 Sven Wischnowsky
1999-06-28 13:08 ` Andrej Borsenkow
1999-06-28 17:05 ` Peter Stephenson [this message]
1999-06-29 15:31 ` Bart Schaefer
1999-06-29 15:40 ` Andrej Borsenkow
-- strict thread matches above, loose matches on Subject: below --
1999-07-02 13:05 Sven Wischnowsky
1999-07-02 15:54 ` Peter Stephenson
1999-06-28 9:00 Peter Stephenson
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=9906281705.AA30579@ibmth.df.unipi.it \
--to=pws@ibmth.df.unipi.it \
--cc=zsh-workers@sunsite.auc.dk \
/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).