I am trying to get hollywood
to run in a way that I can exit it with a normal Ctrl+C signal.
Currently I have to press Ctrl+C a bunch of times just to get stuck in the tmux
instance that hollywood
created. Looking at the source code, there is a trap command:
trap "pkill -f -9 lib/hollywood/ >/dev/null 2>&1; exit 0" INT
But apparently that is not enough. I've tried replacing it with several different ones, but none of them was able to do it right:
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT
trap 'kill $(jobs -p)' EXIT
trap 'pkill -f -9 lib/hollywood/ >/dev/null 2>&1; kill -9 $(ps -eo pid,command | grep tmux | grep byobu | grep hollywood | sed -r "s/^[^0-9]*([0-9]+).*/\1/") >/dev/null 2>&1; exit 0' INT
trap "exit" INT TERM
trap "kill 0" EXIT
I've tried several answers of this question: How do I kill background processes / jobs when my shell script exits? But none of those worked. (I still had to press Ctrl+C a bunch of times and then manually exit the tmux session.)
Is there a simple way to fix this? (I would prefer to having to mess with the source code too much.)