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 #69

Open rianhunter opened 7 years ago

rianhunter commented 7 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

hakujin commented 7 years ago

Thanks for opening this PR! If accepted, it'll be exciting to use dvtm on macOS again.

hakujin commented 6 years ago

@rianhunter I still observe occasional freezing on macOS Sierra (10.12.6) using HEAD with your patch applied. Does this work for you?

edit: see comment below.

rianhunter commented 6 years ago

@hakujin Hmm with casual testing I'm not seeing any freezing. I'll check on this more later but I'm worried @martanne doesn't care about this patch.

hakujin commented 6 years ago

@rianhunter apologies, I was mistakenly testing a version of dvtm aliased to my system install instead of the patched copy. Confirmed this PR works great.

@martanne anything we can do to get this PR merged?

jteppinette commented 6 years ago

@rianhunter @martanne I can confirm that this patch works on High Sierra (10.13.1) with 311a8c0c28296f8f87fb63349e0f3254c7481e14 (current HEAD).

rianhunter commented 6 years ago

Ping! This PR is necessary for allowing dvtm to work on macOS, and probably other unix like systems as well. pselect() is a bad linuxism.

rianhunter commented 6 years ago

@martanne ping again :)

luke-clifton commented 5 years ago

Would love to get this merged. I've been using this patch on macOS and linux without issue for a while.

rianhunter commented 5 years ago

@martanne ping again :pray:

luke-clifton commented 5 years ago

Some further motivation for the self-pipe trick.

http://cr.yp.to/docs/selfpipe.html

rianhunter commented 5 years ago

Is this repo still maintained? It would be better to close this PR than ignore it indefinitely if it's not going to be accepted.

rpmohn commented 5 years ago

I'm considering forking and dealing with the pull requests. It's a tool that I live in every single day

-Ross

On March 18, 2019 1:16:54 PM EDT, Rian Hunter notifications@github.com wrote:

Is this repo still maintained? It would be better to close this PR than ignore it indefinitely if it's not going to be accepted.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/martanne/dvtm/pull/69#issuecomment-474014774

-- sent from phone

travankor commented 5 years ago

I'm considering forking and dealing with the pull requests. It's a tool that I live in every single day

+1 I really like dvtm, too, but the lack of maintenance updates will eventually force me to switch to tmux since that one is well maintained.