mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
jobs: ensure calling jobclose() on a pty job sends SIGHUP. Closes #5619
This commit is contained in:
parent
927e3e32d7
commit
1d4563771b
@ -4411,7 +4411,8 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()*
|
|||||||
Close {job}'s {stream}, which can be one of "stdin", "stdout",
|
Close {job}'s {stream}, which can be one of "stdin", "stdout",
|
||||||
"stderr" or "rpc" (closes the rpc channel for a job started
|
"stderr" or "rpc" (closes the rpc channel for a job started
|
||||||
with the "rpc" option.) If {stream} is omitted, all streams
|
with the "rpc" option.) If {stream} is omitted, all streams
|
||||||
are closed.
|
are closed. If the job is a pty job, this will then close the
|
||||||
|
pty master, sending SIGHUP to the job process.
|
||||||
|
|
||||||
jobpid({job}) {Nvim} *jobpid()*
|
jobpid({job}) {Nvim} *jobpid()*
|
||||||
Return the pid (process id) of {job}.
|
Return the pid (process id) of {job}.
|
||||||
|
@ -11459,6 +11459,9 @@ static void f_jobclose(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
process_close_err(proc);
|
process_close_err(proc);
|
||||||
} else {
|
} else {
|
||||||
process_close_streams(proc);
|
process_close_streams(proc);
|
||||||
|
if (proc->type == kProcessTypePty) {
|
||||||
|
pty_process_close_master(&data->proc.pty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -480,6 +480,12 @@ describe('jobs', function()
|
|||||||
nvim('command', 'call jobresize(j, 10, 40)')
|
nvim('command', 'call jobresize(j, 10, 40)')
|
||||||
eq('rows: 40, cols: 10', next_chunk())
|
eq('rows: 40, cols: 10', next_chunk())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('calling jobclose()', function()
|
||||||
|
-- this should send SIGHUP to the process
|
||||||
|
nvim('command', 'call jobclose(j)')
|
||||||
|
eq({'notification', 'exit', {0, 1}}, next_msg())
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user