mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-13 20:14:12 +02:00
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:
@@ -60,7 +60,7 @@ func extra_for(width, screen_width int) int {
|
||||
return utils.Max(0, screen_width-width)/2 + 1
|
||||
}
|
||||
|
||||
func choices(o *Options) (response string, err error) {
|
||||
func GetChoices(o *Options) (response string, err error) {
|
||||
response = ""
|
||||
lp, err := loop.New()
|
||||
if err != nil {
|
||||
|
||||
@@ -33,7 +33,7 @@ func main(_ *cli.Command, o *Options, args []string) (rc int, err error) {
|
||||
}
|
||||
switch o.Type {
|
||||
case "yesno", "choices":
|
||||
result.Response, err = choices(o)
|
||||
result.Response, err = GetChoices(o)
|
||||
if err != nil {
|
||||
return 1, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user