paulklemm / rvisidata

Open any dataframe with visidata, a terminal-based spreadsheet application
Other
30 stars 2 forks source link

feat: support kitty remote control along with tmux #11

Open kofm opened 1 year ago

kofm commented 1 year ago

Hey there, thanks for this helpful package!

This is my attempt at adding support for the kitty (https://github.com/kovidgoyal/kitty) terminal emulator. I prefer kitty over tmux for being much more lightweight and less of a "hacky" solution (see kovidgoyal/kitty#2422)

Unfortunately, I couldn't find a way to "automagically" check if we're working inside a kitty instance, except for $TERMINAL or $TERMINFO environment variables which are, of course, set globally by the user irrespective of the current terminal effectively being used. If you have any suggestions on how to do this (or if the author of kitty will read this and have one), I'm happy to integrate it. However, with this PR, the user can set the "rvisidata.cmd" option to the string "kitty" to use the default cmd that I provided within the package, which opens visidata in a new tab. If you try to run a kitty remote cmd outside kitty, it simply goes on timeout after 10 secs, so we shouldn't worry too much about breaking things.

I hope this is of interest to you and the users of the package, and I look forward to hearing your thoughts about this :)