Skip to content

Commit

Permalink
launch --hold: Fix hold not working if kernel signals process group w…
Browse files Browse the repository at this point in the history
…ith SIGINT

Fixes #7466
  • Loading branch information
kovidgoyal committed May 22, 2024
1 parent 506d7a4 commit 3f6b1a9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ Detailed list of changes

- Fix kitten @ set-background-opacity limited to min opacity of 0.1 instead of 0 (:iss:`7463`)

- launch --hold: Fix hold not working if kernel signals process group with SIGINT (:iss:`7466`)

0.34.1 [2024-04-19]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down
11 changes: 10 additions & 1 deletion tools/tui/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"kitty"
"os"
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"strings"
Expand Down Expand Up @@ -216,7 +217,15 @@ func RunCommandRestoringTerminalToSaneStateAfter(cmd []string) {
defer term.Close()
}
}
err = c.Run()
func() {
if err = c.Start(); err != nil {
fmt.Fprintln(os.Stderr, cmd[0], "failed with error:", err)
return
}
signal.Ignore(os.Interrupt)
defer signal.Reset(os.Interrupt)
err = c.Wait()
}()
if err != nil {
fmt.Fprintln(os.Stderr, cmd[0], "failed with error:", err)
}
Expand Down

0 comments on commit 3f6b1a9

Please sign in to comment.