Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Cannot use LBUFFER+= nor print -zr from zsh/sched call



On 14 September 2016 at 03:47, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author