> 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.
Vim works in raw mode where CTRL-C does not cause a SIGINT. Vim needs to read the input to check for typed characters. That is done by calling ui_breakcheck(). -- BLACK KNIGHT: I'm invincible! ARTHUR: You're a looney. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- 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/202001211740.00LHe2PW020523%40masaka.moolenaar.net.