New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
question: send keypress to all windows/OS windows #1569
Comments
Yes, the remote control feature can be used to do that |
@kovidgoyal can you provide an example on how to toggle window sync across all windows in a given tab using remote control ? |
It would require writing some small terminal program that reads keypresses and then sends those keypresses to all kitty windows using kitty @ send-text. Simply run that program in one window, then anything you type there will be sent to all windows by the program. I'm afraid I dont have time to write the program for you, but it should be pretty simple to do. In python pseudo code:
And if you want to get more sophisticated you can write it as a kitten and avoid needing to use remote control at all. |
Thanks, I'll try to come up with a PR for docs, if that makes sense for you. |
sure |
I'm using this simple kitten: from sys import exit
def main(args):
# this is the main entry point of the kitten, it will be executed in
# the overlay window when the kitten is launched
print("Send to all windows in this Tab.\n")
try:
answer = input("> ")
except KeyboardInterrupt:
print("Cancelled.")
exit(0)
# whatever this function returns will be available in the
# handle_result() function
return answer
def handle_result(args, answer, target_window_id, boss):
tab = boss.active_tab
windows_dict = tab.list_windows(target_window_id)
for w_dict in windows_dict:
w = boss.window_id_map.get(w_dict.get("id"))
if w is not None:
#w.paste_bytes(answer + "\x0d")
w.paste(answer + "\r")
Still, it feels like a bad hack and you can only send one command at a time, it doesn't stream the chars as you type them like in tmux implementation. I tried to do it by using yield but failed... |
I had a little time, so I implemented the kitten. |
Is there a way to have synchronous typing in all kitty windows/OS windows
like tmux's
:setw synchronize-panes
?The text was updated successfully, but these errors were encountered: