zsh-users
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: Cannot use LBUFFER+= nor print -zr from zsh/sched call
Date: Wed, 14 Sep 2016 07:13:00 +0200	[thread overview]
Message-ID: <CAKc7PVAqrMcig6NsTQM0J_ehCu9bEO4XGLxFujVa3ppG415OOQ@mail.gmail.com> (raw)
In-Reply-To: <160913184702.ZM30221@torch.brasslantern.com>

On 14 September 2016 at 03:47, Bart Schaefer <schaefer@brasslantern.com> wrote:
> However, you can certainly accomplish displaying what's being done
> without having to poke it into the editor buffer.  Minimally, you
> can do (again using "sched -o")
>
>     for histent in "$commands[@]"; do
>       # sched -o will clean up zle for us, so fake a prompt ...
>       print -Prn -- "$PS1"
>       # ... show the command we're about to run ...
>       print -r -- "$histent"
>       # ... put it in the history ...
>       print -Sr -- "$histent"
>       # ... and then run it
>       eval "$histent"
>     done
>
> This has to vary a little depending on the format of $commands (the
> above presumes it's an array of one command per element) but you get
> the idea.

That's interesting. It would allow to do cool things like displaying
"STATUS: preparing to run; 5.. 4.. 3.. 2.. 1.. run!" with colors,
maybe other things, instead of simulating prompt. Could even use
zcurses and do some full screen pre-launch animation ;)

Best regards,
Sebastian Gniazdowski


  reply	other threads:[~2016-09-14 10:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-11  9:28 Sebastian Gniazdowski
2016-09-11 10:35 ` Sebastian Gniazdowski
2016-09-12  1:13   ` Bart Schaefer
2016-09-12 15:06     ` Bart Schaefer
2016-09-12 15:24       ` Sebastian Gniazdowski
2016-09-12 17:34         ` Bart Schaefer
2016-09-13 15:44           ` Sebastian Gniazdowski
2016-09-13 16:55             ` Bart Schaefer
2016-09-13 17:29               ` Sebastian Gniazdowski
2016-09-14  1:47                 ` Bart Schaefer
2016-09-14  5:13                   ` Sebastian Gniazdowski [this message]
2016-09-12  0:58 ` Bart Schaefer
2016-09-12  8:49   ` 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=CAKc7PVAqrMcig6NsTQM0J_ehCu9bEO4XGLxFujVa3ppG415OOQ@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@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).