On Tue, Jun 1, 2021 at 3:12 AM Bram Moolenaar <[email protected]> wrote: > Felipe Contreras wrote: > > > > > > > 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. > > > > > > > > > > I suspect removing setsid() will cause trouble if a terminal with a > > > > > shell is started and that shell exits. > > > > > > > > No, I tested that. > > > > > > On which systems? > > > > Linux (5.12.8). > > There are a dozen different Unix-like systems with slightly different > behavior. I care about all of them. It should be possible to at least > test some BSD versions. But there are also SYSV derivatives that > matter, such as HPUX.
Yes, but they all try to follow POSIX, and what setsid is supposed to do is defined: https://pubs.opengroup.org/onlinepubs/009604599/functions/setsid.html setsid isn't going to create a new session on Linux, and kill your cat on HPUX. It's supposed to be used when you want to start a daemon that is detached from the parent process, and the terminal. https://unix.stackexchange.com/questions/240646/why-we-use-setsid-while-daemonizing-a-process :! should not start a daemon (especially depending on gui_running and shelltmp). > It's difficult to test everything, that is why I prefer to make minimal > changes that actually solve a problem. I agree. For this particular problem the minimal change is enough. > If we don't know why that > setsid() was there, then removing it probably breaks something. But I don't agree with this. It's not a good practice to leave code we don't know what it's doing, and it has been there for 25 years. At some point you need to revise code. I can do an investigation of what's going on and why it might have been desirable in 1996 to do setsid(). But to blankly state that it probably breaks something is an assumption. We don't know that. It's possible it simply was copied from somewhere because somebody else did it for some reason. Either way that's a separate topic. Cheers. -- Felipe Contreras -- -- 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/CAMP44s0RzCRAdYf804phHttB7zOxF2GJKy38JVZa_OGG1D%2BcZQ%40mail.gmail.com.
