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.

(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.)

Marius Gedminas
-- 
Apologies for taking up the bandwidth with the apology.  Anything else I
can apologise for ...... er no can't think of anything, sorry about that.
                Andy Hunt (Member of British Olympic Apology Squad)

-- 
-- 
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/20201028164531.24xp3yolhy64ef7d%40blynas.

Attachment: signature.asc
Description: PGP signature

Raspunde prin e-mail lui