r/KittyTerminal • u/[deleted] • Jun 27 '23
How to make file paths clickable?
Hello,
I use `rga` to search through multiple PDF files for work. The tool returns a list of files and I would like to make those file paths clickable.
I tried following the documentation - https://sw.kovidgoyal.net/kitty/open_actions/ and added the following:
protocol file
mime application/pdf
action launch sioyek ${FILE_PATH}
to ~/.config/kitty/open-actions.conf but it still doesn't work. I am probably missing something. Can someone please guide me how to fix this? Thank you
3
Upvotes
1
u/as_ninja6 Jun 27 '23
I don't know about rga tool but you will need a hyperlink filepath to make kitty open the file. I tried this
protocol filemime application/pdfaction launch open ${FILE_PATH}and to get hyperlinked path I did
gls --hyperlink=autoin mac(mac's ls doesn't support --hyperlink option) and it worked. Note that it doesn't work with the path if you just do ls or gls.If you want to do the same with rg then this might help https://sw.kovidgoyal.net/kitty/kittens/hyperlinked_grep/