Skip to content

Commit

Permalink
feat(exec) ignore ctrl-c when exec
Browse files Browse the repository at this point in the history
  • Loading branch information
sadayuki-matsuno authored and RamiAwar committed Apr 20, 2024
1 parent e9e1947 commit f887959
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package cmd
import (
"fmt"
"os"
"os/signal"
"strings"
"syscall"

"github.com/knqyf263/pet/config"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -34,6 +36,7 @@ func execute(cmd *cobra.Command, args []string) (err error) {

// Show final command before executing it
fmt.Printf("> %s\n", command)
signal.Ignore(syscall.SIGINT)

return run(command, os.Stdin, os.Stdout)
}
Expand Down

0 comments on commit f887959

Please sign in to comment.