baskerville / bspwm

A tiling window manager based on binary space partitioning
BSD 2-Clause "Simplified" License
7.61k stars 420 forks source link

Exec bspwmrc before setting up signal handlers. #1479

Closed falsifian closed 5 months ago

falsifian commented 5 months ago

Before this change, it seems everything I launch via bspwm ignored SIGPIPE, which is unexpected.

I have not thoroughly tested this change. I'm currently using bspwm with the change applied and will comment if I run into any trouble.

For example, if I ran find / | : (in an xterm launched via sxhkdrc which was launched from bspwmrc) then that command would hang until find finished; normally, with SIGPIPE having its default effect of terminating the process, find / | : should end right away because find dies.

falsifian commented 5 months ago

Thinking about it more, maybe it would be better to call at least signal(SIGCHLD, sig_handler) before run_config. My knowledge is pretty sketchy, but I guess without that handler there's a small chance of leaving a zombie if bspwmrc terminates quickly. If I'm understanding right, only SIG_IGN survives the execl call in run_config, so signal(SIGPIPE, SIG_IGN) is the only one that actually needs to be moved to after run_config.

falsifian commented 5 months ago

Please see this one instead: https://github.com/baskerville/bspwm/pull/1480