Processes are not being started correctly with TIOCSCTTY, which does succeed after setsid().
None of that stuff is necessary, including the silencing of SIGHUP. It's not even executed when shellpipe is off. Signed-off-by: Felipe Contreras <[email protected]> --- src/os_unix.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/os_unix.c b/src/os_unix.c index 20c61106f..89d37740e 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -4753,33 +4753,12 @@ mch_call_shell_fork( ) { -# ifdef HAVE_SETSID - // Create our own process group, so that the child and all its - // children can be kill()ed. Don't do this when using pipes, - // because stdin is not a tty, we would lose /dev/tty. - if (p_stmp) - { - (void)setsid(); -# if defined(SIGHUP) - // When doing "!xterm&" and 'shell' is bash: the shell - // will exit and send SIGHUP to all processes in its - // group, killing the just started process. Ignore SIGHUP - // to avoid that. (suggested by Simon Schubert) - signal(SIGHUP, SIG_IGN); -# endif - } -# endif # ifdef FEAT_GUI if (pty_slave_fd >= 0) { // push stream discipline modules if (options & SHELL_COOKED) setup_slavepty(pty_slave_fd); -# ifdef TIOCSCTTY - // Try to become controlling tty (probably doesn't work, - // unless run by root) - ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL); -# endif } # endif set_default_child_environment(FALSE); -- 2.32.0.rc0 -- -- 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/20210531072230.150319-1-felipe.contreras%40gmail.com.
