If Vim receives a SIGWINCH (_sig_nal that the _win_dow _ch_anged size)
while editing stdin, a program piping input to Vim gets killed
prematurely. Is there an easy way to avoid this?
With a PHP cli script I'm writing, I've changed it to write minimal
status updates to stderr while it's processing items of input, each of
which takes several seconds to process. After each item, the script
produces a large amount of output which includes '{{{n' and '}}}n'
markers for folding (the main reason I'm doing it this way). So, while
the output is being produced and fed into Vim, I still get some
indication of progress.
A simple demonstration of the problem: (shell script, all one line)
$ perl -lwe '$|=1; print $_ and warn "$_\n" and sleep 1 for 1..100' | vim +'w!
testoutput' +'q!' - ; cat testoutput
While running in a terminal emulator, resize the window. The output is
cut off.
Just curious as to whether there's a straightforward way to change this
behavior. I'd much rather keep using Vim as a filter (editing stdin)
than using any kind of temporary files, since I do a lot of test runs
with this script. The piping process doesn't seem to be dying from
getting a signal (return code is 0), so I'm guessing it's something
Vim's doing. If I'm wrong, though, what signal should I be looking for?
(Easier to deal with for the Perl example than for PHP, unfortunately.)
$ vi --version
VIM - Vi IMproved 7.3c BETA (2010 Jul 25, compiled Jul 27 2010 13:49:34)
Compiled by 'http://www.opensuse.org/'
Huge version without GUI.
--
Best,
Ben
--
You received this message from the "vim_use" 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