Closed branflakes2 closed 6 months ago
Heh, I did exactly this, but for some reason it wasn't working. I just re-implemented it on my fork and it works fine, so I guess I sent the wrong signal by mistake?
The alternative I went with in the meantime is to remove the AnyEvent dependency, as URxvt has a built-in AnyEvent implementation (urxvt::anyevent
), but that version of AnyEvent doesn't have the signal watcher. I prefer the version using AnyEvent->signal
.
I have been thinking about this for some time and all ways of handling singals seem simply too messy. Perhaps it would be best to use a pipe or socket instead...
Ah, a problem I ran into which has cropped up again here is that even when you undef $watch
, the AnyEvent signal handler doesn't close, keeping the URxvt process alive and holding the fd open. I'm not sure if there's a way to force-destroy the handler but I haven't found one.
ah nice catch. I didn't notice that until now
I tested this and it works but is somewhat slower at picking up the signal than with Linux::FD. Also it sometimes happens the colors are not updated until I resize or click on the window.
I'm not sure if you had a specific reason for using Linux::FD, but Linux::FD broke with a recent Perl update for me and I was too lazy to figure out how to fix it so I did some reading instead. I found AnyEvent has built in support for catching signals, so I thought it might be nice to remove a dependency. I've literally never written any Perl in my life though, so if you have a good reason please ignore me :)