Proto commits in gnachman/iTerm2

These commits are when the Protocol Buffers files have changed: (only the last 100 relevant commits are shown)

Commit:c77dbd2
Author:George Nachman
Committer:George Nachman

Add floating panes A floating pane floats over a tab's split panes. It can be moved, resized, raised, hidden, maximized, docked into the split panes, and dragged to other tabs and windows. Floats are saved with window arrangements and session restoration, can be created and controlled from the Python API, it2, AppleScript, key bindings and pointer actions, and work in tmux integration, which shows tmux's own floating panes. This squashes the floating-panes branch. See that branch for the individual commits.

Commit:3f1cda6
Author:George Nachman

Report floating panes through the API, Python client and it2 Server (protocol 1.21): - ListSessions gives each tab its floating panes, back to front, with frame and grid, and whether they are hidden. - Adding, moving, resizing, restacking, hiding or showing a float sends a layout change. - Minimized sessions are the tiled panes that maximizing hid, also when a float is active. - Activating a float leaves a maximized pane alone. - Splitting “all” skips floats, whose splits go to a tiled pane. - move_session refuses a float as its destination. - apply_layout rejects a float as a leaf. Python client 2.26: - Tab.floating_sessions and Tab.floating_panes_hidden. - Session.floating. - all_sessions and lookups include floats. - current_session finds an active float. it2: - With no session given, a command uses the tab's active session, which may be a float. - Session lists and broadcast validation include floats.

Commit:5ed491d
Author:Chris Thompson
Committer:George Nachman

Add Python API support for Session Notes (#764) Add a strict, atomic session_note generic property for reading and patching Session Notes, plus typed Python SDK get/set methods and a read-only SessionNote value. A patch may be partial: omitted keys retain their current values, and an empty text removes the note. Preserve terminal focus for API-driven show, update, collapse and background-session operations. Restore Session Notes through a saved-state relaunch by hydrating the model in +sessionFromArrangement: instead of the async finish block, which ran after -didFinishRestoration and so left the model nil when restoration looked at it. The protobuf schema is unchanged. Only its documentation comments gained the new property.

Commit:a23c8c3
Author:George Nachman
Committer:George Nachman

Add Python API for tab groups Expose tab groups to the Python API: discover them via Tab.tab_group and Window.tab_groups, create them with Window.async_create_tab_group, change membership with Tab.async_add_to_tab_group / async_remove_from_tab_group, and rename, recolor, or collapse them via the TabGroup class. The consecutive-tabs invariant is enforced in iTerm2, which reorders tabs as membership changes. The rename/recolor/collapse mutators are registered as app-scope built-in functions (iTermTabGroupBuiltInFunctions) that resolve the group's current host window at call time, so a TabGroup handle keeps working after its tabs are dragged to another window. Membership and creation stay window-scoped because they act on tabs whose window is known when called. New protocol version 1.19 carries the per-tab group id, name, color, and collapsed state in ListSessionsResponse. Bumps the iterm2 module to 2.24 and adds an interactive example plus its test wrapper.

Commit:54032f3
Author:George Nachman
Committer:George Nachman

Fix Python API current_tab/current_session None after async_create A script that created a window and then immediately read Window.current_tab or Tab.current_session got None, so scripts that split panes or changed fonts on a freshly created window stopped working in 3.7.0. The iterm2 Python library learns a new window's selected tab and active session only from FocusChanged notifications, and 2.21 added an async_refresh re-entrancy guard that swallows the recovery refresh when those notifications arrive before the client knows the window exists. iTerm2 selects the new tab synchronously during creation, i.e. before the CreateTab response, so the client is always in exactly that state. Durable fix: carry the selected tab and per-tab active session in ListSessionsResponse (protocol 1.18) and read them in the library, so current_tab/current_session are correct straight out of the refresh that async_create already performs, with no dependence on notification timing. Library bumped to 2.23. Transitional server-only workaround for already-shipped clients in the affected range [2.21, 2.23): hold a connection's selected_tab and active-session FocusChanged notifications while it has a CreateTab in flight, then replay that create's own ids to that one connection after the response is sent. Encapsulated in iTermAPICreateTabFocusDeferral, gated on the x-iterm2-library-version header, scoped per connection so other connections keep receiving focus notifications live. Deletable once every supported client is 2.23+. Adds unit tests for the version gate and the deferral's hold/replay behavior, and a manual-test runner for the patched library.

Commit:ed1dfde
Author:George Nachman
Committer:George Nachman

Fix Python API current_tab/current_session None after async_create A script that created a window and then immediately read Window.current_tab or Tab.current_session got None, so scripts that split panes or changed fonts on a freshly created window stopped working in 3.7.0. The iterm2 Python library learns a new window's selected tab and active session only from FocusChanged notifications, and 2.21 added an async_refresh re-entrancy guard that swallows the recovery refresh when those notifications arrive before the client knows the window exists. iTerm2 selects the new tab synchronously during creation, i.e. before the CreateTab response, so the client is always in exactly that state. Durable fix: carry the selected tab and per-tab active session in ListSessionsResponse (protocol 1.18) and read them in the library, so current_tab/current_session are correct straight out of the refresh that async_create already performs, with no dependence on notification timing. Library bumped to 2.23. Transitional server-only workaround for already-shipped clients in the affected range [2.21, 2.23): hold a connection's selected_tab and active-session FocusChanged notifications while it has a CreateTab in flight, then replay that create's own ids to that one connection after the response is sent. Encapsulated in iTermAPICreateTabFocusDeferral, gated on the x-iterm2-library-version header, scoped per connection so other connections keep receiving focus notifications live. Deletable once every supported client is 2.23+. Adds unit tests for the version gate and the deferral's hold/replay behavior, and a manual-test runner for the patched library.

Commit:f4ca000
Author:Erwann Mest
Committer:George Nachman

Add screenshot save destination and Python API capture Adds a configurable save location to the Make Screenshot window: the "Save" button honors the new screenshotSaveLocation advanced setting (empty falls back to the Desktop), and a new "Save As…" button opens a save panel and supports multi-part output. Save logic is unified behind a small SaveDestination. Also exposes screenshot capture to the Python API via Session.async_screenshot() -> bytes, backed by new ScreenshotRequest / ScreenshotResponse proto messages (field 134), regenerated ObjC and Python gencode, server dispatch, and an apiServerScreenshot: delegate that reuses PTYSession's existing render path. The API is version-gated (protocol 1.17, check_supports_screenshot). George Nachman reviewed and revised this work: removed the dead applyBackground(to:color:) helper left over from the reverted background-color feature, fixed tilde expansion for the screenshotSaveLocation setting so a ~ path no longer silently falls back to the Desktop, and kept Copy from closing the panel (which would be destructive). Co-authored-by: George Nachman <gnachman@gmail.com>

Commit:ab4c5bd
Author:George Nachman
Committer:George Nachman

feat(api): add select_tab to CreateTabRequest for background tabs (#675) The Python API's create_tab always selected the new tab and ordered its window to the front, stealing keyboard focus on every create. This is asymmetric with SplitPaneRequest, which never raises or steals focus, and there was no per-creation equivalent of ActivateRequest's select_tab / order_window_front controls (GitLab #8223). Add an opt-in optional bool select_tab = 6 on CreateTabRequest. Unset or true reproduces the historical behavior exactly; false creates the tab in the background without selecting it or raising its window. A brand-new window (its first tab) is still ordered front regardless. The window/focus motion came from three spots: insertTab:atIndex:'s makeKeyAndOrderFront: and its setCurrentTerminal:, plus the launcher's makeKeyAndActivateIfNeeded: (canActivate = NO only suppressed cross-app activation, not the in-app raise). All three are now gated: a new automaticallyOrderFrontNewTabs property (default YES) mirrors automaticallySelectNewTabs and guards the two insertTab: spots, and apiServerCreateTab: sets launcher.makeKey plus both term flags from select_tab, restoring them after the create. Python: Window.async_create_tab / iterm2.rpc.async_create_tab gain select: bool = True. Generated stubs regenerated with tools/build_proto.sh; wire format unchanged. Co-authored-by: G Six <localparty@gmail.com>

Commit:131b9c6
Author:George Nachman
Committer:George Nachman

OSC 133 k= and aid= support Implement OSC 133 k= (Semantic Prompt prompt kind: i/s/c/r) and aid= (nested shell-integration session id) attribute support end-to-end. Parser (VT100Terminal) handles key=value arguments on A/B/C/D/P. Marks gain kind, excludedSubranges, firstLineOfCommand/fullCommand, and aid/parentAid/ancestorAids. Non-initial prompts (k=s/c/r) add excluded subranges to the active mark without breaking the prompt state machine or paste-each-line gate. aid= populates a registry so D;aid=X targets the matching mark and an outer-D cascade-closes inner marks (e.g. ssh tunnel drops where the inner D never arrives). Mark coord storage (promptRange / commandRange / outputStart and the excludedSubranges endpoints) moves to ResilientCoordinate so it survives folds, resizes, and scrollback overflow. Saved-tree (alt- screen) marks observe a separate RC pool whose resize broadcast is built against altScreenLineBuffer rather than the primary linebuffer. Consumers (Select Current Command, share URL, AI explain, the Python GetPromptResponse.excluded_subranges field, etc.) subtract excluded subranges from the typed-command range. Shell integration scripts (bash, zsh, fish, tcsh, xonsh) emit k=s around PS2 and aid= on A/B/C/D. New /v2/ scripts ship alongside legacy /v1/. Fixes issue 5749 (Advanced Paste hangs on PS2).

Commit:751cf88
Author:George Nachman
Committer:George Nachman

Expose style info to Python API. Issue 11848

The documentation is generated from this commit.

Commit:e089ffb
Author:George Nachman
Committer:George Nachman

Add support for HTML formatted status bar components.

Commit:2278eee
Author:George Nachman
Committer:George Nachman

Expose minimized sessions (i.e., siblings of a maximized session) to Python API. Add Tab.all_sessions which includes them. Fix EachSessionOnceMonitor to also affect minimized sessions (this may break things). Issue 9813

Commit:5a0883e
Author:George Nachman

Provide a GetPromptResponse object along with a PROMPT notification. Issue 8245

Commit:7615b67
Author:George Nachman

[python, api] Add advanced keystroke notifications that include key-up and flags-changed. Issue 9585

Commit:6cc860e
Author:George Nachman

Context menu improvements. - Fix parsing user-provided URLs with // in query parameter. - Fix some failing tests - Don't show pause/unpause tmux in context menu in versions of tmux that don't support it. - Move context menu code into its own file. - Add support for context menu providers in Python API.

Commit:ea292a1
Author:George Nachman
Committer:George Nachman

Document built-in API methods

Commit:5991f51
Author:George Nachman
Committer:George Nachman

[python,api] Add Arrangements.async_list. Issue 9004

Commit:995034a
Author:George Nachman

[Python,API] Add support for listing prompts by ID. Add capabilities check for prompt ID and bump protocol version number

Commit:9a1cda7
Author:George Nachman

[API,python] Add ability to get prompt by ID

Commit:89d6566
Author:George Nachman

[python,API] Expose prompt unique ID

Commit:bbd3023
Author:George Nachman

[python, API] Expose prompt state in GetPromptResponse

Commit:02dbe9a
Author:George Nachman
Committer:George Nachman

Add support for getting the default profile

Commit:31c39de
Author:George Nachman

start implementing custom line graphs

Commit:ebeb9de
Author:George Nachman

Add support for custom status bar components to have icons

Commit:23f55cc
Author:George Nachman

Improve PromptMonitor to inform you when a command starts and ends.

Commit:27b1edf
Author:George Nachman

Add Session.async_set_profile(). Issue 7782 - Add Profile.local_write_only_copy - Add Session.async_set_profile - Make iTerm2 report its version to the websocket client - Add a capabilities check so the python library can be backward-compatible with older versions of iTerm2 by using deprecated APIs for them. - Add the ability to set multiple profile properties at once from Python. Deprecate the one-at-a-time API. - If you try to set session-specific profile values that are effectively equal to a shared profile, just switch to the shared profile. If they include a GUID matching a shared profile, switch to it and then divorce and modify. - Bump the min library version to 0.69 - Improve validation of API requests to set profile properties. - Expose the set of non-deprecated keys from iTermProfilePreferences. - Remove default profile values for deprecated keys

Commit:35b1fb3
Author:George Nachman

Add support for modal alerts attached to windows. For method calls, pass receiver in protobuf rather than taking the "id" argument. Built-in functions can now declare optional-valued arguments. Add tabtitle example. This commit breaks backward compatibility with older python library alert.py's.

Commit:eef13a5
Author:George Nachman

Add support for method invocations from scripts. The purpose is to make it easier to add new scripting functionality without adding new protobuf interfaces. A method call is just like a function call except: 1) It is marked as a method call in the RPC request 2) It must contain an "id" argument 3) The value of the "id" argument is a globally unique identifier for the receiver This commit adds support for a class creating a variables frame to mark one of its variables as a "primary key". Primary keys are added to the global index, and can be targeted by method calls. Varible references have been generalized not to depend on scopes, so that a variable may hold a reference to its own primary key. A class may support methods by: 1) Conforming to iTermObject, which is necessary to be the "owner" of an iTermVariables object. 2) Returning built-in functions from -objectMethodRegistry. Those built-in functions should be named as fooWithCompletion: followed by zero or more other arguments. Reflection is used to type check inputs, although it's unfortunately ineffective as it only recognizes NSObject. Better type checking is still needed.

Commit:116f107
Author:George Nachman

Add a user scope per window and add an API to set values in it to Python

Commit:7490a9f
Author:George Nachman

Add the ability for scripts to invoke registered functions. Register a move-tab-to-window builtin function. Add APIs to call it and to invoke functions in the various contexts. Still needs more testing.

Commit:75a8e54
Author:George Nachman

Add a completion block to toggle full screen. Delay responding the API RPC to toggle full screen until it's actually done/failed. Issue 7438

Commit:924b4b0
Author:George Nachman
Committer:George Nachman

[python, api] Give session title providers a unique ID. Now you can change their function signatures without having to go through setup again. Also fix up the status bar onclick registration to be less weird. fixup

Commit:c5882ec
Author:George Nachman

[python, api] Improvements to NewSessionMonitor 1. Move it to the lifecycle module 2. Rename uniqueIdentifier to session_id in the proto

Commit:8c72ba7
Author:George Nachman

[python, api] Improvements to session termination notifications 1. Move the python code into the lifecycle module. Add docs for it. 2. Change the proto to use the more standard session_id field name. 3. Change the semantics to communicate when a session's command exits rather than when its window closes. Now a session can only terminate once, which is much nicer. 4. Use a context manager instead of a callback.

Commit:c618e29
Author:George Nachman
Committer:George Nachman

[python] Remove location change notifications because they're equally well handled by variable notifications. Move prompt notifications to a context manager.

Commit:bad3fb1
Author:George Nachman
Committer:George Nachman

[api. python] Add async_close to tab, window, and session. Issue 7414.

Commit:5a645b9
Author:George Nachman
Committer:George Nachman

[python, api] Update keyboard interfaces. Filtering is now a distinct subscription from keyboard monitoring. It does not send notifications. This allows you to filter separately from monitoring. All the keyboard code is now in the same python file. The examples are updated.

Commit:f5cb3d6
Author:Josh Soref
Committer:George Nachman

Fix a lot of spelling mistakes. PR 367 by jsoref. Minor tweaks by gln.

Commit:7b6549d
Author:George Nachman

Make it possible to subscribe to profile changes. Expose the evaluated badge text in a variable. Add the badgetitle example.

Commit:083f77a
Author:George Nachman

[python, api] Add APIs for setting broadcast domains

Commit:ae48a7f
Author:George Nachman

[api, python] Add support for getting the selection. Change how screen contents are fetched to be very general. Deprecate some of the old ways of getting screen contents. Add support for opening popovers from status bar components. Add support for an on-click handler for status bar components. Add lots of handy methods to the util functions.

Commit:c166b6c
Author:George Nachman

[python, api] Add interface to get number of lines on screen, history, and overflow

Commit:c7fa132
Author:George Nachman

[python, api] Add support for getting and setting the selection.

Commit:05451c1
Author:George Nachman
Committer:George Nachman

[python, api] Add color presets to API. Refactor Color into its own submodule. Add gather to connection. Change how waiting on the websocket works to support the case where two receivers exist and the first one finishes before the second one. Before, the second one would never await the websocket leading to deadlock.

Commit:3f16712
Author:George Nachman

Attempt to add color presets. My gather function deadlocks for some reason.

Commit:3aa5683
Author:George Nachman
Committer:George Nachman

Incomplete implementation of variable references

Commit:70466c0
Author:George Nachman
Committer:George Nachman

Incomplete implementation of variable references

Commit:acbe5a1
Author:George Nachman

[python, api] Enable monitoring variables in python. Expose mouse mode as a variable.

Commit:455a4f8
Author:George Nachman

[api, python] Enable creating tmux integration windows and tabs

Commit:dc1bb82
Author:George Nachman

[api, python] Add support for setting the default profile. Fix repl detector for aioconsole 0.1.10

Commit:47f1df9
Author:George Nachman
Committer:George Nachman

[status bar] Add support for custom status bar components.

Commit:7aabec6
Author:George Nachman

[status bar] Add support for custom status bar components.

Commit:d722f73
Author:George Nachman

[api] Add API to reorder tabs. Issue 5671

Commit:8865263
Author:George Nachman

[api, python] Add support for app and tab variables in API. Update it2api, python lib, and docs.

Commit:29cb8a5
Author:George Nachman

[api, python] Add support for tmux to the API

Commit:6ad51b3
Author:George Nachman

[python, api] Allow sending text without broadcast. Fix a typo. Make custom tools reload when their script is registered. Link the targeted_input example.

Commit:b2e242d
Author:George Nachman

[api, python] Add support for broadcast domains

Commit:6383bef
Author:George Nachman
Committer:George Nachman

[api, python] When registering for keystroke notifications API clients can specify keystroke patterns for the app to ignore. Issue 6780 Note these are only ignored as input to a session, not (e.g.) main menu shortcuts.

Commit:7ca9241
Author:George Nachman
Committer:George Nachman

Add support for custom session title functions

Commit:5c49819
Author:George Nachman
Committer:George Nachman

Add support for custom session title functions

Commit:c6b0cc1
Author:George Nachman

[python, api] add the ability to customize the profile of new tabs and windows

Commit:eb40cf3
Author:George Nachman

[api, python] Add the ability to override profile properties when creating a split pane

Commit:a9521d3
Author:George Nachman

[api, python] Add API to bury/disinter sessions

Commit:f888333
Author:George Nachman
Committer:George Nachman

[api, python] Add support for changing split pane layout.

Commit:f4c0b13
Author:George Nachman
Committer:George Nachman

[api, python] Add support for get/set session property of grid_size

Commit:889b32f
Author:George Nachman

Initial attempt at set tab layout. Untested

Commit:a62476d
Author:George Nachman

[api, python] Add support for get/set session property of grid_size

Commit:6b23f6b
Author:George Nachman
Committer:George Nachman

[api, python] Add support for buried sessions

Commit:57f004e
Author:George Nachman
Committer:George Nachman

[api, python] Add support for invoking and querying state of menu items

Commit:b43c5bb
Author:George Nachman

[api] Add support for restarting the session. Fix up some naming issues in session.py

Commit:69c02e9
Author:George Nachman

[api, python] Use JSON to get/set variables

Commit:a267b9e
Author:George Nachman

[api] Make RPC timeouts settable at registrationtime

Commit:19ccf97
Author:George Nachman

[api] Giant friggin commit to add support for iTerm2-originated RPCs. - Add support for registering for iTerm2-invoked RPCs in scripts. - Add key binding to invoke a script function. - Add CoreParse third party library - Make session variables not always strings - Add session.id to variables. Gives the GUID. - Recognize Python as the name of a python binary. It can be distributed as an app bundle. - Refactor request handling in APIServer - Expose textview in disclosable view so it can be made selectable. - Add support for disclosable view accessories to iTermWarning. Still left to do: - Autocomplete for function arguments in the keybinding text field would be nice - Update docs, adding app.async_register_rpc_handler, notifications.async_subscribe_to_server_originated_rpc_notification - Add a tutorial on how to write one an RPC handler - Allow SetVariable RPC to send non-string values. Use json to encode its value. - Allow GetVariable RPC to return non-string values over JSON.

Commit:60aa10a
Author:George Nachman
Committer:George Nachman

Add support for missing keys to api and python.

Commit:20bf0e3
Author:George Nachman
Committer:George Nachman

Add apis for listing profiles

Commit:7f3a20f
Author:George Nachman

[python] Improve focus notifications

Commit:793f30a
Author:George Nachman
Committer:George Nachman

Add focus change notifications and API to query focused objects

Commit:99fe6db
Author:George Nachman

Add interfaces for saving/restoring window arrangements

Commit:6bc0658
Author:George Nachman

Add support for activating the app

Commit:75f5623
Author:George Nachman

If the library is newer than iTerm2 then respond with an error instead of just not ACKing

Commit:7385fba
Author:George Nachman

Move top level message fields into oneof

Commit:9e5b639
Author:George Nachman

Add ability to get and set variables

Commit:b3a561c
Author:George Nachman

Update iterm2env. For some reason it was a broken python install. Add Activate API.

Commit:a109d84
Author:George Nachman

API: Add inject RPC

Commit:8bf54c5
Author:George Nachman

API: Add property getters and setters. For now, just frame and fullscreen exist.

Commit:fced048
Author:George Nachman

Add special 'active' and 'all' session IDs to API proto

Commit:f1907c7
Author:George Nachman
Committer:George Nachman

Rename request and response to be more general

Commit:318884e
Author:George Nachman
Committer:George Nachman

Update API to use python 3.6 asyncio. Improve the proto to include splitter hierarchy.

Commit:ebedfb6
Author:George Nachman
Committer:George Nachman

Add API endpoint for getting profile properties

Commit:7feedbd
Author:George Nachman

Add a few new notifications to the API server for session terminated (i.e., removed from UI) and layout changed. Update the python library to keep its window hierarchy in synch with the truth.

Commit:66f3e7b
Author:George Nachman

Add API to split panes to API server.

Commit:21bc7a7
Author:George Nachman

Add create tab/window API to api server.

Commit:bb08823
Author:George Nachman

Add a session-created websocket API notification.

Commit:617ad18
Author:George Nachman

Add a notification to the websocket server that receives custom escape sequences. Add a python example to receive them and a shell script to send them.

Commit:ff87e16
Author:George Nachman

Add a send text request to the API server

Commit:62160fb
Author:George Nachman

Indicate which session caused a notification

Commit:4e409b7
Author:George Nachman

Add a list-sessions API

Commit:f61616f
Author:George Nachman

Add websocket API to subscribe to location (host, user, directory) changes.

Commit:6af0933
Author:George Nachman

Add websocket API for changing profile properties

Commit:005a6a4
Author:George Nachman
Committer:George Nachman

Add a prototype API server using websockets.