martanne / dvtm

dvtm brings the concept of tiling window management, popularized by X11-window managers like dwm to the console. As a console window manager it tries to make it easy to work with multiple console based programs.
MIT License
848 stars 105 forks source link

Use self-pipe instead of signal-blocking for SIGCHLD/SIGWINCH #93

Closed g0xA52A2A closed 5 years ago

g0xA52A2A commented 5 years ago

pselect() is broken on macOS. This isn't officially documented anywhere but there are hints of it in this article:

https://daniel.haxx.se/blog/2016/10/11/poll-on-mac-10-12-is-broken/

To safely handle SIGCHLD/SIGWINCH without blocking them, use the "self-pipe" trick, i.e. write to a pipe when those signals occur and select() on the read-end of that pipe.

Fixes #19

g0xA52A2A commented 5 years ago

Cherry picked from Rian's fork.

g0xA52A2A commented 5 years ago

Whoops sorry was meant to merge this to my fork.