russelltg / wl-screenrec

High performance wlroots screen recording, featuring hardware encoding
Apache License 2.0
266 stars 10 forks source link

Killing with SIGTERM exits with 1 instead of 0 #76

Open grazzolini opened 2 weeks ago

grazzolini commented 2 weeks ago

I have scripted using wl-screenrec on sway and, given that I'm not starting it from a terminal directly, I want to be able to just send SIGTERM to wl-screenrec for it to stop recording. With this change: https://github.com/russelltg/wl-screenrec/commit/ad0dd42ae5ade9b0a8efa81a995855a71b7a4000#diff-42cb6807ad74b3e201c5a7ca98b911c5fa08380e942be6e4ac5807f8377f87fcR1747, it made it to exit with return value 1 on SIGTERM.

hholst80 commented 5 days ago

It is reasonable to terminate with 1 if there was an error gracefully terminating the recording. I use the same workflow but I use kill -INT instead of the default TERM ;-)

grazzolini commented 2 days ago

Unless the recording failed for some reason, I don't think the program should exit with 1, even if terminated with SIGTERM. I'll try using SIGINT as well.