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.

The hang actually already happens on open(), thus using select() or some
other mechanism to check if the file handle is readable doesn't help
much.  Not sure if there is any other way.

BTW: Vim can be killed with a TERM signal in this situation, at least on
Linux.

-- 
hundred-and-one symptoms of being an internet addict:
138. You develop a liking for cold coffee.

 /// 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/202010281032.09SAWgUf2111204%40masaka.moolenaar.net.

Raspunde prin e-mail lui