Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: DEBUG_CMD_LINE (Was Re: PATCH: skip command from debug trap)
- X-seq: zsh-workers 25414
- From: Stephane Chazelas <Stephane_Chazelas@xxxxxxxx>
- To: Peter Stephenson <pws@xxxxxxx>
- Subject: Re: DEBUG_CMD_LINE (Was Re: PATCH: skip command from debug trap)
- Date: Thu, 7 Aug 2008 10:31:40 +0100
- Cc: Rocky Bernstein <rocky.bernstein@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxxxxx>
- In-reply-to: <20080807095441.3058605d@news01>
- Mail-followup-to: Peter Stephenson <pws@xxxxxxx>, Rocky Bernstein <rocky.bernstein@xxxxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <6cd6de210808061419q2a81856cv62969490069e8f3e@xxxxxxxxxxxxxx> <20080807095441.3058605d@news01>
On Thu, Aug 07, 2008 at 09:54:41AM +0100, Peter Stephenson wrote:
[...]
> It would be possible with a bit of fiddling to get the DEBUG trap to happen
> at the level of elements of a sublist, i.e. commands separated by && and
> ||, but I'm not sure if that's worth it. Beyond that you run into the
> hideous complexity of pipelines and I don't think it can be pushed that far
> down.
[...]
But see how PS4 is expanded for every command:
$ zsh -o PROMPT_SUBST -c 'PS4="\$(od -vAn -N2 -x /dev/urandom) "
set -x; : a | : b; : c && : d'
4542 : a
e866 : b
a7ad : c
6051 : d
BTW, shouldn't PROMPT_SUBST be enabled by default in sh and ksh
emulation?
Is there a way to run shell code (other than assignments and
arithmetic expansion) upon the expansion of PS4? I thought of
/(e:code:), but in scalar context I couldn't find a way for
globbing to be performed.
--
Stéphane
Messages sorted by:
Reverse Date,
Date,
Thread,
Author