From e42043f20e824db25ee8502ab0aca1bc63c7a826 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Fri, 17 May 2024 13:52:26 +0300 Subject: [PATCH] fix: enable interactive scripts (#720) --- internal/lefthook/runner/exec/execute_unix.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/internal/lefthook/runner/exec/execute_unix.go b/internal/lefthook/runner/exec/execute_unix.go index 9d3bd563..9958e8b7 100644 --- a/internal/lefthook/runner/exec/execute_unix.go +++ b/internal/lefthook/runner/exec/execute_unix.go @@ -14,7 +14,6 @@ import ( "github.com/creack/pty" "github.com/mattn/go-isatty" - "github.com/mattn/go-tty" "github.com/evilmartians/lefthook/internal/log" ) @@ -35,10 +34,10 @@ func (e CommandExecutor) Execute(ctx context.Context, opts Options, out io.Write in = os.Stdin } if opts.Interactive && !isatty.IsTerminal(os.Stdin.Fd()) { - tty, err := tty.Open() + tty, err := os.Open("/dev/tty") if err == nil { defer tty.Close() - in = tty.Input() + in = tty } else { log.Errorf("Couldn't enable TTY input: %s\n", err) }