avahe-kellenberger / nimdow

A window manager written in Nim (In Development)
GNU General Public License v2.0
317 stars 19 forks source link

Child processes that expect stdin will lock up the process #191

Open avahe-kellenberger opened 2 years ago

avahe-kellenberger commented 2 years ago

Describe the bug

Have one of the autostart programs wait for stdin. It will block and the process will lock up.

Additional context

Probably can just use nohup to get around this, e.g.

nohup "$@" &>/dev/null &

Need to ensure redirection from within the user command still works as intended.

avahe-kellenberger commented 2 years ago

@PMunch we were discussing this a while ago - have you found any way to replicate the issue? I'm trying to recreate it, but have been unsuccessful. I'm starting to wonder if this is actually a stdin issue, or if it's already been fixed (as of the latest commit to master)

PMunch commented 2 years ago

Haven't noticed it recently after I upgraded to the latest version. But I have modified my configuration to just start one script with nohup and that script then runs all my startup tasks..

PMunch commented 2 years ago

You could try to write a small Nim program which just writes out a whole bunch to the terminal, and then set that as a startup program. It should fill up the buffer and lock up. And I don't think it was Nimdow itself locking up was it? I think it was only that process locking up (which in my case meant that my statusbar stopped working).

avahe-kellenberger commented 2 years ago

Aha, thanks for the reminder. I'll try this out.

avahe-kellenberger commented 2 years ago

Through some testing, I've also found that processes spawned when Nimdow starts do not close when Nimdow exits.

This can lead to some undesirable behavior, since multiple instances of the same process will be running if Nimdow is "restarted".