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

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



On 13 September 2016 at 18:55, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> If I understand your desired end state correctly, I'd implement it
> more like the following:
>
> __convey_from_somwhere() {
>     # Reschedule ourself ...
>     sched -o +2 __convey_from_somwhere
>     # Setup ...
>     local commands
>     __get_commands_from_somewhere
>
>     # Ok, now we have the commands to run.  We want them recorded
>     # in the history as if they were user input, so first do that.
>     print -S "$commands"
>
>     # Now just run them.  This assumes we're running from "sched -o"
>     # (see above) which will handle saving/restoring ZLE state for
>     # us in case any of these commands interact with the terminal.
>     eval "${(j.;.)commands"
> }

Nice trick with print -S, thanks. I had in mind the
execute-without-simulating-input and plan to include it as option. Am
quite afraid to run things without people's eyes. I think that this
will be good when user starts to trust Zconvey, and firstly I should
trust it, after it is ran for few months at users' boxes.

Best regards,
Sebastian Gniazdowski



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