Marius Gedminas wrote:
> On Wed, Oct 28, 2020 at 11:32:42AM +0100, Bram Moolenaar wrote: > > Brennan Vincent wrote: > > > > > Let's simulate a read that will block forever: > > > > > > $ mkfifo /tmp/myfifo > > > $ vim /tmp/myfifo > > > > > > Now vim hangs permanently; it cannot be killed or suspended except by > > > going to another terminal and running `pkill -9 vim`. (Or, of course, > > > writing stuff to the fifo, but the point here wasn't about fifos > > > specifically, but just about reads that are slow to return for whatever > > > reason). > > > > > > Same story with :w or :w! to a file that is slow to write. > > > > > > IMO, this "hang forever and give the user no way to recover" behavior is > > > a bug, but reasonable people might disagree. > > > > It's not so easy to make this work, especially with a fifo. Vim is in > > raw mode, thus a CTRL-C is not turned into an interrupt. We could > > switch to cooked mode for that, but then any typeahead is becoming a > > problem. > > Would switching to cbreak mode help? It works like raw, but converts ^C > to an interrupt. It's worth a try: basically use RAW mode, with the exception that the "ISIG" flag is set. This can be implemented in mch_settmode() with a new argument TMODE_RAW. Would have to do this for all implementations of mch_settmode(). > (I'm not sure exactly when, but it seems to me that in the last year or > so modern versions of Vim became harder to interrupt with ^C, especially > when a plugin is running.) Well, if a plugin keeps the CPU busy, it may not checked for typed characters. -- hundred-and-one symptoms of being an internet addict: 149. You find your computer sexier than your girlfriend /// Bram Moolenaar -- [email protected] -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/202010291834.09TIYok32508641%40masaka.moolenaar.net.
