You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I would like to be able to programmatically react to a kitty window being focused.
Describe the solution you'd like
I'm open to anything but the best fit seems to be the --watchers API which already contains resize and close events.
Describe alternatives you've considered
A WINCH signal could be sent to the contained process, but that's already used for resize and no resize will have happened. It'd be strictly more convenient for my purposes but feels like a hack and one that's prone to compatibility issues.
Possibly some window managers are capable of telling you when different windows get focused. But there are a lot of windows and having to watch all focus changes if I'm only interested in some windows seems strictly worse, and only kitty knows which kitty window has focus (though my main goal is to know which os window has focus).
The text was updated successfully, but these errors were encountered:
As I recall, --watchers was added to allow non-co-operating programs to
monitor one another. If that's your use case, sure, it can be added, I
was under the impression you wanted a way for the program running in the
terminal to be notified of focus changes, for which there is already an
The specific use case is ssh remotehost dtach -a running in kitty windows on multiple computers, as in a pair programming session. When one person changes focus, optionally if others are following them their corresponding kitty window should get focus too.
Possibly dtach could be modified, or bash, but neither is an easy place to add the functionality. A watcher I think would do it but I may not have thought it through. The watcher would work similarly to my resize handler, having to set the titlebar to a unique value, and then issue a launch remote control command to the terminal which would then trigger each client to find the window by title and raise it. Substitution of the window id in remote control could remove some ugliness in both these cases, too (the remote shell doesn't have an easy way to get the window id, as it is different for every client).