Thanks, I did find `async_set_tmux_window_visible(tmux_window_id: str, visible: bool)` which seems to be close to what I am looking for?
One thing I am missing in the iTerm python docs is how to map from tmux `session_name` and `window_name` to the iTerm2 `tmux_window_id`. That would allow managing iTerm2 windows in the context of their tmux names.
See a possible example below. First the user lists the tmux windows along with their iTerm2 status (open/hidden). And they can also hide/close them using the tmux session/window names. The example shows it using the command, but I do understand I would need to do it through the python API (which I still need to play with).
$ tmux display-message -p "#S"
my_session_name
$ my-iterm-script list-tmux-windows
0: first* (1 panes) [133x67] [layout 6698,133x67,0,0,19] @19 (active) (iTerm2 open)
1: second (1 panes) [139x43] [layout 5e12,139x43,0,0,32] @32 (iTerm2 hidden)
2: third (1 panes) [119x28] [layout 65d4,119x28,0,0,34] @34 (iTerm2 open)
$ my-iterm-script open-tmux-window "my_session_name:second"
<iTerm2 window associated with tmux_window second is unhidden>
$ my-iterm-script close-tmux-window "my_session_name:third"
<iTerm2 window associated with tmux_window third is hidden>
Is something like that possible or do I need to file a feature request for the name mapping?
Thanks!
dave