kitty +open: Ask for permission before executing script files that are not marked as executable

This prevents accidental execution of script files via MIME type
association from programs that unconditionally "open"
attachments/downloaded files via MIME type associations.
This commit is contained in:
Kovid Goyal
2023-05-07 08:11:39 +05:30
parent 79c19562b5
commit 537cabca71
6 changed files with 64 additions and 3 deletions

View File

@@ -67,4 +67,13 @@ func KittyToolEntryPoints(root *cli.Command) {
return
},
})
// __confirm_and_run_shebang__
root.AddSubCommand(&cli.Command{
Name: "__confirm_and_run_shebang__",
Hidden: true,
OnlyArgsAllowed: true,
Run: func(cmd *cli.Command, args []string) (rc int, err error) {
return confirm_and_run_shebang(args)
},
})
}