zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <Stephane_Chazelas@yahoo.fr>
To: Peter Stephenson <pws@csr.com>
Cc: Rocky Bernstein <rocky.bernstein@gmail.com>,
	Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: DEBUG_CMD_LINE (Was Re: PATCH: skip command from debug trap)
Date: Thu, 7 Aug 2008 10:31:40 +0100	[thread overview]
Message-ID: <20080807093139.GA6839@sc.homeunix.net> (raw)
In-Reply-To: <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


  reply	other threads:[~2008-08-07  9:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06 21:19 Rocky Bernstein
2008-08-07  8:54 ` Peter Stephenson
2008-08-07  9:31   ` Stephane Chazelas [this message]
2008-08-07 10:14     ` Peter Stephenson
2008-08-07 10:40       ` Stephane Chazelas
2008-08-07 12:06         ` Peter Stephenson
2008-08-07 13:37           ` Rocky Bernstein
2008-08-07 15:10             ` Bart Schaefer

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=20080807093139.GA6839@sc.homeunix.net \
    --to=stephane_chazelas@yahoo.fr \
    --cc=pws@csr.com \
    --cc=rocky.bernstein@gmail.com \
    --cc=zsh-workers@sunsite.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).