Tmux¶
Represents tmux integration objects.
- async async_get_tmux_connections(connection: Connection) List[TmuxConnection]¶
Fetches a list of tmux connections.
This may not be called from within a
Transaction.- Parameters:
connection (
Connection) – The connection to iTerm2.- Returns:
The current tmux connections.
See also
Example “Tmux Integration”
- async async_get_tmux_connection_by_connection_id(connection: Connection, connection_id: str) TmuxConnection | None¶
Find a tmux connection by its ID.
- Parameters:
connection (
Connection) – The connection to iTerm2.connection_id (
str) – A connection ID for aTmuxConnection.
- Returns:
Either a
TmuxConnectionor None.
- class TmuxException¶
A problem was encountered in a Tmux request.
- class TmuxConnection(connection_id, owning_session_id, delegate)¶
A tmux integration connection.
Do not create this yourself. Use
async_get_tmux_connections(), instead.- async async_create_window() Window¶
Creates a new tmux window.
This may not be called from within a
Transaction.- Returns:
A new
Window.
See also
Example “Tmux Integration”
- async async_send_command(command: str) str¶
Sends a command to the tmux server.
This may not be called from within a
Transaction.- Return type:
str- Parameters:
command (
str) – The command to send to tmux (e.g., “list-sessions”)- Returns:
The command’s output as a string.
- Throws TmuxException:
If the command fails for any reason or the RPC fails such as from an invalid ID.
See also
Example “Tile tmux Window Panes”
- async async_set_tmux_window_visible(tmux_window_id: str, visible: bool) None¶
Hides or shows a tmux window.
Tmux windows are represented as tabs in iTerm2. You can get a tmux_window_id from
tmux_window_id(). If this tab is attached to a tmux session, then it may be hidden.This may not be called from within a
Transaction.- Parameters:
tmux_window_id (
str) – The window to show or hide.visible (
bool) – True to show a window, False to hide a window.
