Files
neovim/runtime
Justin M. Keyes 9706664b88 system('foo &', 'bar'): Show error, don't crash.
Closes #3529
Closes #5241

In Vim,
    :echo system('cat - &', 'foo')
works because for both system() and :! Vim writes input to a temp file and uses
shell syntax to redirect the file to the backgrounded `cat` (get_cmd_output()
.. make_filter_cmd()).

In Nvim,
    :echo system('cat - &', 'foo')
fails because we write the input directly via pipes (shell.c:do_os_system()),
but (per POSIX[1]) backgrounded process input stream is redirected from
/dev/null (unless overridden by shell redirection; supported only by some shells
[2]), so our writes are ignored, the process exits quickly, and if we are
writing data larger than the buffer size we'll see EPIPE.

This still works:
    :%w !tee > foo1358.txt &
but this does not:
    :%w !tee foo1358.txt &
though it *should* (why doesn't it?) because we still do the temp file dance
in do_bang() .. do_filter().

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09_03_02
[2] http://unix.stackexchange.com/a/71218
2016-10-19 01:39:05 +02:00
..
2016-10-04 23:33:28 +09:00
2016-10-04 23:33:28 +09:00
2016-08-03 08:07:28 -04:00
2016-08-03 08:07:28 -04:00
2014-12-19 15:28:49 -05:00
doc
2016-10-16 18:08:53 +02:00
2015-11-28 10:59:21 +01:00
2016-04-16 23:06:24 -07:00
2014-12-19 15:28:49 -05:00
2014-07-29 02:12:31 +00:00
2015-01-04 19:42:30 +01:00
2016-10-04 23:34:28 +09:00
2016-10-04 23:14:47 +09:00