Trap signals?
I'm trying to do something like:
debug: fmt
#!/usr/bin/env bash
function build() {
echo "Building for debug"
go build -gcflags='all=-N -l' -o debug.out
}
build
trap build SIGUSR1
gdlv -r stdout:/dev/stdout exec ./debug.out -debug
But then just debug doesn't respond to CtrlT in the same shell (nor the gdlv window), kill -USR1 on the PID of the bash /tmp/just<random>/debug process does nothing, and the same on the just debug process terminates it (and also seems to propagate the signal to the parent shell).
Is there a way of doing this?
Similar story here: just doesn't seem to forward signals to the command it's running. My app terminates nicely when it receives SIGTERM, but nothing happens if the same command is invoked via just.
just 1.5.0
I believe the same issues causes https://github.com/casey/just/issues/1558
This also creates an issue where I need to still cache some data even if a command fails, but currently ctrl+c isn't counted as a command failure and simply terminates just entirely.
Closing in favor of #2473, where I tried to collect everything related to signals in one place. just should not touch SIGUSR1 or SIGINFO (generated by CTRL-T) at all, so if that's happening, please reopen this issue. @stefanchrobot just ignores SIGTERM, but should not change whether or not children of just receive SIGTERM. So I'm not sure what's going on there.