dvtm icon indicating copy to clipboard operation
dvtm copied to clipboard

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

Open rianhunter opened this issue 8 years ago • 13 comments

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

rianhunter avatar Sep 04 '17 02:09 rianhunter

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

hakujin avatar Sep 09 '17 13:09 hakujin

~~@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.

hakujin avatar Dec 09 '17 00:12 hakujin

@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.

rianhunter avatar Dec 09 '17 20:12 rianhunter

@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?

hakujin avatar Dec 10 '17 01:12 hakujin

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

josheppinette avatar Apr 30 '18 22:04 josheppinette

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 avatar Aug 03 '18 19:08 rianhunter

@martanne ping again :)

rianhunter avatar Aug 27 '18 02:08 rianhunter

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

luke-clifton avatar Sep 21 '18 12:09 luke-clifton

@martanne ping again :pray:

rianhunter avatar Oct 27 '18 04:10 rianhunter

Some further motivation for the self-pipe trick.

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

luke-clifton avatar Jan 26 '19 04:01 luke-clifton

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.

rianhunter avatar Mar 18 '19 17:03 rianhunter

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 [email protected] 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

rpmohn avatar Mar 18 '19 22:03 rpmohn

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.

travankor avatar Jun 28 '19 01:06 travankor