Focus an existing Kitty window and a specific tab #8136
-
I usually run a single Kitty window with multiple tabs in it, created by a session (so they are always the same). To help with this, I use jumpapp. I have mapped a key binding to the following command: jumpapp kitty --start-as maximized Pressing the key binding will either start a new maximized Kitty window, or focus the existing one. That's fine but I'd like to push this further and focus one specific tab in that window. I read this page and tried modifying my command like this: jumpapp kitty -o allow_remote_control=yes -o enabled_layouts=tall --start-as maximized; kitten @ focus-tab --match "id:2" I get the same result as with the first command. Kitty is focused, but on the last tab used and not tab number 2. I also read #7936 with a similar topic. I'm not sure I understood it well, but I don't think this is the same use case. Any idea how I could achieve this ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Use sessions. https://sw.kovidgoyal.net/kitty/overview/#sessions
the example there shows you how to focus specific windows.
|
Beta Was this translation helpful? Give feedback.
-
On Fri, Dec 27, 2024 at 07:39:13AM -0800, Halibut Git Wiz wrote:
I had to wrap this in `zsh -c` to make sure both commands were fired. Not sure why, this may be specific to my environment.
That's because kitty just runs the command directly not via a shell. If
you want to run multiple commands you have to wrap it in a shell or an
interpreter or whatever.
|
Beta Was this translation helpful? Give feedback.
If you are starting a new kitty instance you use sessions. If you are trying to control an existing kitty instance you use remote control. If you want to control kitty from outside of kitty, then you use remote control with a socket, and send the kitty instance messages over that socket.