Ji4n1ng / OpenInTerminal

✨ Finder Toolbar app for macOS to open the current directory in Terminal, iTerm, Hyper or Alacritty.
MIT License
5.88k stars 235 forks source link

[FR] support kitty to open in existing instance new tabs instead of new instance window #203

Closed truebit closed 8 months ago

truebit commented 10 months ago

Summarize this feature

launch kitty in one instance new tab instead of new instance new windows

Why should this feature be included?

We would like to open kitty terminal in one instance instead of multiple instance windows

Additional information

kitty could be opened with single instance with -1 --instance-group xxx parameters.

Ji4n1ng commented 8 months ago

This is supported in v2.3.7.

jqtmviyu commented 7 months ago

--instance-group Used in combination with the kitty --single-instance option. All kitty invocations with the same kitty --instance-group will result in new windows being created in the first kitty instance within that group.

  1. add Kitty config

~/.config/kitty/kitty.conf

allow_remote_control yes
listen_on unix:/tmp/kitty
  1. add Automator.app
#!/bin/sh
exit=$(ls /tmp | grep '^kitty')

if [ $exit ]; then
  sock="unix:/tmp/$exit"
  /usr/local/bin/kitty @ --to $sock launch --type=tab --cwd $1 --no-response && open -a kitty
else
  open -a kitty --args $1
fi
tim-hilde commented 3 weeks ago

The core issue of the current workings is that opening a directory via the app results in a new kitty app instance. This results in two apps open. The tab thing is something unrelated to the problem.