Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kitty can't open scripts with no extension in MacOS #5160

Closed
DUOLabs333 opened this issue Jun 1, 2022 · 7 comments
Closed

Kitty can't open scripts with no extension in MacOS #5160

DUOLabs333 opened this issue Jun 1, 2022 · 7 comments
Labels

Comments

@DUOLabs333
Copy link

DUOLabs333 commented Jun 1, 2022

Describe the bug
If you try to open an executable/script with no extension with Kitty via the "Open With" menu, it will fail with Unknown URL type, cannot open:

To Reproduce
Steps to reproduce the behavior:

  1. Make an exectuable with no extension
  2. Right click to open it with Kitty
  3. See error

Screenshots
If applicable, add screenshots to help explain your problem.

Environment details

Frozen: True
Paths:
  kitty: /Applications/kitty.app/Contents/MacOS/kitty
  base dir: /Applications/kitty.app/Contents/Resources/kitty
  extensions dir: /Applications/kitty.app/Contents/Resources/Python/lib/kitty-extensions
  system shell: /bin/zsh
Loaded config files:
  /Users/system/.config/kitty/kitty.conf

Config options different from defaults:
Added shortcuts:
        ctrl+c → copy_to_clipboard
        ctrl+t → new_tab
        ctrl+v → paste_from_clipboard
        ctrl+w → close_tab

Important environment variables seen by the kitty process:
        PATH                                /Applications/kitty.app/Contents/MacOS:/usr/bin:/bin:/u
        LANG                                en_US.UTF-8
        SHELL                               /bin/zsh
        USER                                system

Additional context
Try to reproduce the problem with kitty --config NONE if you cannot then post a minimal kitty.conf that reproduces the problem. If the problem involves interaction with some other terminal program post a minimal config for that program to reproduce the problem as well.

@DUOLabs333 DUOLabs333 added the bug label Jun 1, 2022
@kovidgoyal
Copy link
Owner

You didnt post the full debug output so I dont know what version of
kitty you are running. I cannot reproduce with kitty 0.25.1

echo "echo hello world\nread" > test.sh
open -a kitty test.sh

opens a kitty window showing hello world as expected.

@DUOLabs333
Copy link
Author

Sorry, I should have specified "if the script has no extension".

@DUOLabs333 DUOLabs333 changed the title Kitty can't open scripts in MacOS Kitty can't open scripts with no extensions in MacOS Jun 2, 2022
@DUOLabs333 DUOLabs333 changed the title Kitty can't open scripts with no extensions in MacOS Kitty can't open scripts with no extension in MacOS Jun 2, 2022
@kovidgoyal
Copy link
Owner

yes, there is no way to create a file association for filenames without
extensions as far as I know.

@DUOLabs333
Copy link
Author

But I can associate iTerm2 with such files, or is that a special case?

@kovidgoyal
Copy link
Owner

In kitty, open associations work by file extension/mime type. See https://sw.kovidgoyal.net/kitty/open_actions/#scripting-the-opening-of-files-with-kitty-on-macos

there is no mime-type/extension for filenames without extensions so you
cant associate them. I suppose one could add a custom mimetype like
application/executable to the matching rules for this.

@kovidgoyal kovidgoyal reopened this Jun 2, 2022
@snoblenet
Copy link

Could the open-actions.conf file perhaps allow us to specify a fallback application for otherwise unmatched files?

@kovidgoyal
Copy link
Owner

kovidgoyal commented Jul 16, 2022

the mime matcher supports wildcards, so use */*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants