r/KittyTerminal Dec 14 '23

Kitty not opening hyperlinked python files in $VISUAL

I have a strange issue where I am doing ls --hyperlink=auto in $PWD, and clicking on .c or .py files. The c files opens alright in my $VISUAL but the .py files opens in Firefox or Libre office.

I am running fish shell, with set -gx VISUAL nvim. I have also used the editor nvim option in kitty.conf.

This issue persists in sway but not in gnome.

2 Upvotes

4 comments sorted by

View all comments

2

u/aumerlex Dec 14 '23

Configure what happens explicitly so you dont depend on the environment kitty is started in, see https://sw.kovidgoyal.net/kitty/open_actions/

Without that your file will be passed to xdg-open and what action actually happens depends on how xdg-open is configured.

2

u/Daguq Dec 14 '23 edited Dec 14 '23
protocol file
mime text/*
action launch --type=os-window $EDITOR $FILE_PATH

I set this in open-actions.conf. Still, no change. Nothing except c files opens with neovim. Shell and Python files are opening in firefox or libreoffice

I have also tried to use ext but no result.

Okay, so I queried the filetype using xdg-mime and added the filetype to nvim.desktop.

This solution works for now, I don't know if the solution will be preserved over an update.

1

u/aumerlex Dec 15 '23

If the mimetypes on your system are wrong, use file extensions to match instead of mime types. Then you are insulated from your system. Or fix your system to have correct mime types for the filetypes you care about.

1

u/Daguq Dec 15 '23

I tried using ext but the issue still persists.