From: Pascal Wittmann <PascalWittmann@gmx.net>
To: zsh-workers@zsh.org
Subject: Re: Is there some postexec function?
Date: Wed, 06 Jul 2011 22:28:17 +0200 [thread overview]
Message-ID: <4E14C561.3050204@gmx.net> (raw)
In-Reply-To: <110706130726.ZM8132@torch.brasslantern.com>
On 07/06/2011 10:07 PM, Bart Schaefer wrote:
> On Jul 6, 5:39pm, Pascal Wittmann wrote:
> }
> } I wonder whether there exists a postexec function, a function that is
> } called, after a command is executed. I need something like that, because
> } I'm trying to print (redraw the prompt) the exit code of a program in
> } the prompt where it was called.
>
> What does "in the prompt where it was called" mean, exactly? Can you
> give an example?
>
> If it means what it appears to, you can't do it without subverting the
> edit/execute paradigm. The line editor is active, and thus the prompt
> modifiable, right up until you commit to executing the command; then
> the line editor exits, the command runs, and after the command is done
> a new line editor starts up with a fresh prompt.
>
> You could create a widget that runs the command, captures its status,
> and updates the prompt, all within the line editor context, but that
> would do odd things with job control and pipelines. Or you could try
> to play cursor movement games to overwrite the previous prompt with
> something that was output with "print -P", but depending on what the
> command does with the screen that may be impractical.
Thanks for clearing things up! I didn't knew about the edit/execute
paradigm and I don't wont to subvert it, so I'll forget about my idea.
next prev parent reply other threads:[~2011-07-06 20:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 15:39 Pascal Wittmann
2011-07-06 15:48 ` Jérémie Roquet
2011-07-06 17:01 ` ZyX
2011-07-06 20:07 ` Bart Schaefer
2011-07-06 20:28 ` Pascal Wittmann [this message]
2011-07-07 3:27 ` 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=4E14C561.3050204@gmx.net \
--to=pascalwittmann@gmx.net \
--cc=zsh-workers@zsh.org \
/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).