Summary
Add a wrightty bridge for iTerm2 using its Python API over WebSocket (protobuf). macOS only.
Why iTerm2
iTerm2 has the richest terminal automation API of any emulator — full screen content access, input sending, session management, and continuous screen monitoring. It's the dominant terminal on macOS.
IPC capabilities
iTerm2 exposes a protobuf-based WebSocket API. The official iterm2 Python package wraps this.
| Wrightty method |
iTerm2 equivalent |
Screen.getText / Screen.getContents |
session.async_get_screen_contents() — full screen with line-level access |
Input.sendText |
session.async_send_text("text") |
Session.list |
app.windows > window.tabs > tab.sessions hierarchy |
Session.create |
window.async_create_tab(), tab.async_split_pane() |
Session.destroy |
session.async_close() |
Terminal.getSize |
session.grid_size (rows, cols) |
Terminal.resize |
session.async_set_grid_size() |
Additional: get_screen_streamer() for continuous monitoring, profile management, color presets, keystroke monitoring, focus notifications, selection control.
Implementation approach
Two options:
- Python bridge — Use the
iterm2 Python package. The bridge would be a Python process (similar to how the MCP server works). Simplest path.
- Rust bridge with protobuf — Reimplement the WebSocket + protobuf protocol in Rust. Better performance, consistent with other bridges.
Option 1 is recommended for initial implementation given iTerm2's well-maintained Python SDK.
Screen monitoring
iTerm2's ScreenStreamer provides push-based screen updates, enabling efficient Screen.updated events without polling.
Platform
macOS only. iTerm2 does not run on Linux/Windows.
References
Summary
Add a wrightty bridge for iTerm2 using its Python API over WebSocket (protobuf). macOS only.
Why iTerm2
iTerm2 has the richest terminal automation API of any emulator — full screen content access, input sending, session management, and continuous screen monitoring. It's the dominant terminal on macOS.
IPC capabilities
iTerm2 exposes a protobuf-based WebSocket API. The official
iterm2Python package wraps this.Screen.getText/Screen.getContentssession.async_get_screen_contents()— full screen with line-level accessInput.sendTextsession.async_send_text("text")Session.listapp.windows>window.tabs>tab.sessionshierarchySession.createwindow.async_create_tab(),tab.async_split_pane()Session.destroysession.async_close()Terminal.getSizesession.grid_size(rows, cols)Terminal.resizesession.async_set_grid_size()Additional:
get_screen_streamer()for continuous monitoring, profile management, color presets, keystroke monitoring, focus notifications, selection control.Implementation approach
Two options:
iterm2Python package. The bridge would be a Python process (similar to how the MCP server works). Simplest path.Option 1 is recommended for initial implementation given iTerm2's well-maintained Python SDK.
Screen monitoring
iTerm2's
ScreenStreamerprovides push-based screen updates, enabling efficientScreen.updatedevents without polling.Platform
macOS only. iTerm2 does not run on Linux/Windows.
References
crates/wrightty-bridge-wezterm/