From d82edad2bea0ca2e2085360d073164ddf1911bae Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 20 Mar 2025 12:50:51 +0530 Subject: [PATCH] ... --- tools/cmd/tool/confirm_and_run_shebang.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/cmd/tool/confirm_and_run_shebang.go b/tools/cmd/tool/confirm_and_run_shebang.go index f8102bae9..2c1dcecbd 100644 --- a/tools/cmd/tool/confirm_and_run_shebang.go +++ b/tools/cmd/tool/confirm_and_run_shebang.go @@ -74,6 +74,9 @@ func confirm_and_run_shebang(args []string, confirm_policy ConfirmPolicy) (rc in // pager will still be visible. fmt.Print("Execute the script? (y/n): ") q, err := tty.ReadSingleByteFromTerminal() + if err != nil { + return 1, err + } if q != 'y' && q != 'Y' { fmt.Println() return 1, permission_denied(script_path)