On Monday, January 20, 2020 at 6:22:18 PM UTC+1, Bram Moolenaar wrote: > > > > > then the Ctrl-C can mean "interrupt what is going on right now" > > > > Yes, where "going on right now" is from the user's perspective. > > Because even in this state Vim is still responsive to `govim` sending > > it messages. i.e. we only want to cancel the `ch_evalexpr` that > > resulted from the command (which in this case was `:w`) > > > > > Does that mean to give up on this request > > > > I think so, yes. Because my hope is that we will be able to tidy up > > sufficiently on the `govim` side to not require a restart. > > > > > or close the channel > > > > I don't think we need this. Because that means restarting `govim`, and > > that might well not be necessary. > > > > We might still want to have a `GOVIMRestart` command which does close > > the channel, tidy up and restart... but I think that's somewhat > > orthogonal to what we need in this case. > > > > Either way we will have to make sure we tidy up state etc after the > > cancel, just in case certain events didn't get handled etc. This is, > > perhaps, an argument somewhat more in favour of closing the channel > > and starting from scratch now that I come to think about it. > > > > Does interrupting the request feel like a good starting point for you? > > Interrupting the blocking wait sounds doable. But the implementation > isn't that simple. I guess the wait happens in channel_wait(), which > uses select() to wait for something to read or write. Handling keyboard > here would not work. So we might have to break up the timeout in 100 > msec parts, then check for CTRL-C typed, then back to waiting.
I am not sure how portable it would be but can't the signal handler be configured in such a way that it lets the select() fail with EINTR after it catches the SIGINT for CTRL-C? That way it wouldn't be necessary to break the waiting each 100 msec to check for CTRL-C and loop if none has come. Tom -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAD_dSXivO-c64zF%2BoRj_3oQLsdfezdD97p4SohC6r5_%2BOT42UQ%40mail.gmail.com.