just icon indicating copy to clipboard operation
just copied to clipboard

Trap signals?

Open OJFord opened this issue 2 years ago • 3 comments

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?

OJFord avatar Mar 02 '23 20:03 OJFord

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

stefanchrobot avatar Mar 21 '23 17:03 stefanchrobot

I believe the same issues causes https://github.com/casey/just/issues/1558

LLBlumire avatar Mar 27 '23 09:03 LLBlumire

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.

vadixidav avatar Apr 24 '24 01:04 vadixidav

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.

casey avatar Nov 19 '24 21:11 casey