<cbb>
that's your example from before, but with nohup before the first "sh -c"
<cbb>
it creates the log file, if you run it like that
<hardcoresushi>
cbb: Yes, it's strange
alexherbo2 has quit [Ping timeout: 260 seconds]
<hardcoresushi>
How do you explain it ?
<cbb>
running the second shell with the async operator (&) causes the process group to get killed with SIGHUP
<cbb>
I'm guessing you're using that so you can run your program from either a terminal or a launcher?
<cbb>
I was just tackling a similar problem in one of my scripts
<cbb>
if you can post a more complete example of what you're trying to do, I could take a look at it
<cbb>
hardcoresushi: (I keep forgetting to ping you)
<hardcoresushi>
cbb: but isn't "nohup" supposed to block SIGHUP ?
<cbb>
yes and it does, in that example I just sent
<hardcoresushi>
cbb: But why it doesn't when "nohup" is inside the shell ?
<hardcoresushi>
Yes I use foot to launch an emoji picker that starts wtype in background. Your solution solved my problem but I can't understand exactly why
<cbb>
hardcoresushi: I think it's because the whole process group gets a SIGHUP
<hardcoresushi>
cbb: Oh OK, but so why does a sleep also fixes the problem?
<cbb>
if you use nohup on the outermost shell, all the children inherit the ignored signal
<cbb>
hardcoresushi: I guess because it keeps the inner shell in the foreground for long enough for the aync echo to finish what it's doing
<cbb>
in that other example you posted
<hardcoresushi>
I don't think so because: foot sh -c "nohup sh -c 'sleep 1; echo 1 > log' & sleep .1"
<hardcoresushi>
Creates the file after foot closed