0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.1761: job in terminal window with no output channel is killed

Problem:    Job in terminal window with no output channel is killed.
Solution:   Keep the job running when the input is a tty. (Ozaki Kiichi,
            closes #2734)
This commit is contained in:
Bram Moolenaar
2018-04-24 20:54:07 +02:00
parent 4994373c5d
commit 4e9d443a25
4 changed files with 59 additions and 15 deletions

View File

@@ -5638,13 +5638,14 @@ mch_job_start(char **argv, job_T *job, jobopt_T *options)
close(fd_err[1]);
if (channel != NULL)
{
channel_set_pipes(channel,
use_file_for_in || use_null_for_in
? INVALID_FD : fd_in[1] < 0 ? pty_master_fd : fd_in[1],
use_file_for_out || use_null_for_out
? INVALID_FD : fd_out[0] < 0 ? pty_master_fd : fd_out[0],
use_out_for_err || use_file_for_err || use_null_for_err
? INVALID_FD : fd_err[0] < 0 ? pty_master_fd : fd_err[0]);
int in_fd = use_file_for_in || use_null_for_in
? INVALID_FD : fd_in[1] < 0 ? pty_master_fd : fd_in[1];
int out_fd = use_file_for_out || use_null_for_out
? INVALID_FD : fd_out[0] < 0 ? pty_master_fd : fd_out[0];
int err_fd = use_out_for_err || use_file_for_err || use_null_for_err
? INVALID_FD : fd_err[0] < 0 ? pty_master_fd : fd_err[0];
channel_set_pipes(channel, in_fd, out_fd, err_fd);
channel_set_job(channel, job, options);
}
else