This commit is contained in:
Kovid Goyal
2025-03-20 12:50:51 +05:30
parent 0afa6d5b3d
commit d82edad2be

View File

@@ -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)