Get desktop application:
View/edit binary Protocol Buffers messages
Used in:
To activate the app without changing anything else omit the identifier.
This may be enabled if tab_id or session_id is set.
This may be enabled if session_id is set.
Activate the app?
Used in:
Used in:
Used in:
Used in:
Used in:
, ,Used in:
Used in:
External attributes
Number of times this exact style repeats.
All requests are wrapped in this message. This encoded message is the entirety of the payload of messages sent over WebSocket from client to iTerm2.
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Number of code points per cell
Number of adjacent cells with this number of code points (always one or more).
Used in:
Used in:
Used in:
(message has no fields)
Used in:
Used in:
Used in:
Used in:
Used in:
Describes a cell's location.
Used in:
,y=0 describes the first line. When the scrollback buffer is full and history is lost, the first lines become unavailable, but the numbering is stable (so the Nth line is always the Nth line, even if it's not the Nth *visible* line).
Describes a range of cells. |..xxxxx| |xxxx...| In the example above, the range of x's is: {start: {x:2, y:0}, end: {x:4, y:1}} The end coordinate is the first cell *after* the end of the range described (so an empty range has start == end)
Used in:
,Used in:
Leave unset to use the default profile.
Leave unset to create the tab in a new window.
Valid to set only if window_id is set. Gives the desired index of the new tab.
If not set, the profile's command will be used. Use custom_profile_properties instead.
Modifies the profile to customize its behavior just for this session.
Used in:
Used in:
The tab is still created, just not with the desired index.
A $$VAR$$ substitution was not provided by the user.
OSC 1337 ; Custom=id=<identity>:<payload> ST
Used in:
Note this is sent when the app becomes/resigns active, the key window changes, the selected tab of a window changes, or the active pane of a tab changes. Note that you may receive duplicate notifications at times. Ignore those that do not signify a change.
Used in:
,true: application became active. false: application resigned active.
If set, gives info about a change to window focus.
If set, selected tab changed to the one identified herein.
If set, the given session became active in its tab.
Used in:
Describes how to interpret window_id.
The affected window_id
Used in:
`window_id` became key
`window_id` is not key, but is the current terminal window. Some other non-terminal window is key.
`window_id` is no longer key.
Used in:
(message has no fields)
Used in:
A collection of notifications that completely describe the state of every tab and window and the application itself.
Used in:
,Used in:
(message has no fields)
Used in:
Requests the contents of a range of lines.
Used in:
See documentation on session IDs. "all" not accepted.
Which lines to return?
Populate `style` field of `LineContents`?
Contains the contents of a range of lines.
Used in:
Which lines were returned
Those lines' contents.
The number of lines (including lines lost from the head of scrollback history) that precede the screen. Subtract this from cursor.y to get the cursor's position on the screen when it is scrolled to the bottom.
The returned range
Used in:
Used in:
See documentation on session IDs
If not set, all properties will be returned
Used in:
Used in:
Requests metadata about the current shell prompt.
Used in:
See documentation on session IDs. "all" not accepted.
If given return this ID instead of the last one.
Responds with metadata about the current shell prompt, if possible.
Used in:
,Exit status. Equivalent to shell's $? variable. Only set if state is FINISHED.
Used in:
Command hasn't been started yet
Command is currently running
Command has finished.
Used in:
Used in:
The kind of ID that's set determines the kind of object you're querying.
Does not accept "all". Accepts "active".
For sessions: "grid_size" -> { "width": number, "height": number } "buried" -> boolean "number_of_lines" -> { "overflow": number, "grid": number, "history": number } For windows: "frame" -> { "origin": { "x": number, "y": number }, "size": { "width": number, "height": number } } "fullscreen" -> boolean
Used in:
Name Example value ------------- --------------- frame { "origin": { "x": 0, "y": 0 }, "size": { "width": 1024, "height": 768 }} fullscreen true, false For sessions: grid_size { "width": 80, "height": 25 } buried true
Used in:
Used in:
Injects bytes as input to the terminal, as though the running program had produced them.
Used in:
Used in:
One status per session_id in the request
Used in:
Used in:
If not given a reasonable default value will be used. Negative value means to use the default.
Used in:
(message has no fields)
Used in:
The following methods are defined: window.set_title(title: String) session.set_name(name: String) session.run_tmux_command(command: String) throws // Throws an exception if this is not a tmux session session.set_status_bar_component_unread_count(identifier: String, count: Int) session.stop_coprocess() -> Bool // returns whether there was a coprocess to stop session.get_coprocess() -> String? // returns the name of the command, or nil session.run_coprocess(commandLine: String, mute: Bool) -> Bool // returns whether it attempted to start the coprocess. It'll fail only if there is already a coprocess. tab.set_title(title: String) tab.select_pane_in_direction(direction: String) throws -> String // direction is 'left', 'right', 'above', or 'below'. If successful, it will return the ID of the newly active session. If you can't go that way, it returns null. Throws an exception if the direction is invalid.
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
If a keystroke matches any of these patterns then they will not be handled by the application. A notification will be posted and the script can handle it as it pleases.
Used in:
KeystrokeFilterRequest was split from this to make a more sensible API.
If false, then only key-down events are sent. If true, key-down, key-up, and flags-changed events are sent.
Used in:
Used in:
These are used for non-modifier keys.
requires advanced=true in request
This is used when only a modifier changes.
requires advanced=true in request
Used in:
,The keystroke matches the pattern if it has all the required and none of the forbidden modifiers.
The pattern matches if the keystroke has any of these keycodes:
The pattern matches if the keystroke equals of any of these characters:
The pattern matches if the keystroke equals any of these characters ignoring modifiers. This is Apple parlance for "ignoring the shift key plus various other undocumented things"
Used in:
Describes the content of a line.
Used in:
Some cells do not contain one code point. Use this to map code points in `text` to a screen position. If the line has no uninitialized cells at its end, then the sum of `repeats` equals the width of the display. For example, consider a line of text that appears on your display like: xyz compañÃa The corresponding value of `text` would be: xyzcompan~i'a Note: ~ and ' are combining marks, but are shown uncombined for illustrative purposes. Each code point in "xyz" as well as each of the non-accented letters in compañÃa takes one cell. The blank following 'z' is an uninitialized cell that has no code points, so the z and the c in `text` are adjacent. It's unusual for these to occur in the middle of a line, but it is possible. The ñ is composed of the letter n and a combining tilde (U+0303) (indicated in our example as ~), while à is composed of the letter i and a combining acute accent (U+0301) (indicated in our example as '). To map code points in `text` to screen positions, `code_points_per_cell` provides the number of code points in each cell. In our example you would get: num_code_points=1, repeats=3 // x, y, z num_code_points=0, repeats=1 // uninitialized cell num_code_points=1, repeats=5 // c, o, m, p, a num_code_points=2, repeats=2 // n + combining tilde, i + combining acute accent num_code_points=1, repeats=1 // a Lines usually end with a series of uninitialized cells. These are not included. Here is psuedocode to interpret code_points_per_cell: text_index_to_screen_coord = {} screen_coord_to_text_index = {} text_index = 0 screen_coord = 0 for cpps in code_points_per_cell: repeat cpps.repeats times: text_index_to_screen_coord[text_index] = screen_coord screen_coord_to_text_index[screen_coord] = text_index text_index += cpps.num_code_points screen_coord += 1 Cells with images are omitted.
This will be 1:1 with cells, but it is run-length encoded by its `repeats` field.
How does this line end?
Used in:
This line is not wrapped.
The next line is a continuation of this line.
Describes a range of lines.
Used in:
Only one of these fields should be set: --------------------------------------- Return just the current contents of the screen.
Return the last `trailing lines` of the buffer, which could go back into scrollback history.
Requests a list of all profiles.
Used in:
The profile properties to respond with. See SetProfilePropertyRequest for a list of values. If empty, all properties will be returned.
If empty, all profiles will be returned. Otherwise, only profiles with one of the listed GUIDs will be returned.
Used in:
Used in:
Used in:
Must name a specific session. "all" not allowed.
If unspecified, start at oldest.
If unspecified, end at newest.
Used in:
Chronological list of prompt IDs, suitable for GetPromptRequest.unique_prompt_id.
Used in:
Used in:
(message has no fields)
Used in:
,Used in:
Used in:
Used in:
Invoke or ask for info about a menu item
Used in:
Unique identifier of the menu item.
If set do not actually invoke it. Just return its state.
Used in:
Used in:
Used in:
,Sent when a new session is created or a closure is undone.
Used in:
Used in:
Used in:
See documentation on session IDs. NOTIFY_ON_NEW_SESSION, NOTIFY_ON_TERMINATE_SESSION, and NOTIFY_ON_LAYOUT_CHANGE do not use the session ID and are posted on all such events. NOTE: This is not used for NOTIFY_ON_VARIABLE_CHANGE.
Set to true to subscribe, false to unsubscribe.
When to be notified (or notification to unsubscribe from)
For NOTIFY_ON_SERVER_ORIGINATED_RPC
Used in:
Used in:
Used in:
Notifications that use the `session` parameter.
Does not send a notification
Notifications that ignore the `session` parameter.
Used in:
Used in:
Used in:
Used in:
(message has no fields)
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Will be unset if no value assigned. Will always be set if there is a default value.
Used in:
Used in:
Used in:
Used in:
Not legal for a plist
Used in:
(message has no fields)
Used in:
Used in:
Used in:
, , ,Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Describes an RPC from iTerm2 to script. I don't want to invent my own type system so this is dynamically typed, which matches Python well enough.
Used in:
If not specified, iTerm2 decides based on its built-in default.
Used in:
Used in:
Used in:
Used in:
Used in:
Used by SESSION_TITLE to control name in Preferences menu
Identifies this title provider uniquely. Must not conflict with other title providers. Use a backwards domain name identifying yourself and the feature, like "com.example.featurename"
Used in:
Used by STATUS_BAR_COMPONENT
Identifies this component uniquely. Must not conflict with other components. Use a backwards domain name identifying yourself and the feature, like "com.example.featurename"
Used in:
Used in:
Used in:
Used in:
Describes a range of values.
Used in:
,Registers a toolbelt tool that displays a webview with a URL of your choice.
Used in:
This name is displayed to the user.
The tool's identifier should be unique. Prefix it with your app bundle. For example: com.example.mytool
The first time a tool is registered iTerm2 automatically adds it to the set of visible tools. To show it on subsequent re-registrations, set this to true. If the toolbelt itself is hidden, it will not be opened.
For web view tools: The URL loaded at startup
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
e.g., duplicate tab id
Used in:
"all" not allowed.
If set, then still-running sessions will fail to restart with SESSION_NOT_RESTARTABLE. If not set, then a still-running session gets killed and restarted.
Used in:
Used in:
Some sessions, such as tmux integration sessions, are not restartable. Also, when `only_if_exited` is set in the request and the session is still running then this status will be returned.
Used in:
Not used for LIST
If given and the action is SAVE then only the tabs in the identified window are saved. If given and the action is RESTORE then the arrangement will be restored as tabs in the identified window. Not used for LIST
Used in:
Restore an existing arrangement with the given name
Save windows to a new arrangement with the given name
List arrangements
Used in:
Used in:
Tried to restore, but name doesn't exist
Bad window ID provided
Used in:
Used in:
,Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
(message has no fields)
Used in:
Used in:
See documentation on session IDs
The text to send. As usual for proto buffers, this should be UTF-8 encoded. It will be converted to the session's encoding before being sent.
If set, input will not be broadcast when broadcasting is on.
Used in:
Used in:
All responses are wrapped in this message. This encoded message is the entirety of the payload of messages sent over WebSocket from iTerm2 to client.
Responses to ClientOriginatedMessages of the corresponding type
Set if request was malformed
This is the only response that is sent spontaneously. The 'id' field will not be set.
Used in:
Used in:
This is an iTerm2-to-script RPC call. The script must have registered for an RPC matching the signature of `rpc`.
Used in:
This is the result of an iTerm2-to-script RPC call.
Used in:
Exceptions should be dictionaries with a key of "reason" having a string value describing what went wrong.
This simply acknowledges receipt of ServerOriginatedRPCResultRequest.
Used in:
(message has no fields)
Used in:
, ,will not be set for buried sessions
will not be set for buried sessions
Used in:
Used in:
Used in:
Sets a value in a session's copy of the profile without modifying the underlying profile.
Used in:
See documentation on session IDs
deprecated
deprecated
Used in:
Used in:
Used in:
Used in:
Used in:
Eventually you'll be able to set properties on other things besides The kind of ID that's set determines the kind of object you're updating.
Accepts "all" and "active"
For windows: Name Example JSON ------------- --------------- frame { "origin": { "x": 0, "y": 0 }, "size": { "width": 1024, "height": 768 }} fullscreen true, false For sessions: grid_size { "width": 80, "height": 25 } buried true
Used in:
Used in:
e.g., bad JSON value
e.g., bogus window_id
Operation can't be performed immediately. Will be tried later. For example, resizing a session during instant replay.
Can't be done. For example, resizing a session in a full-screen window.
Did our best and failed. For example, sometimes toggling full-screen fails if another window is also toggling. Maybe try again?
Used in:
The tree structure must exactly match the actual tree structure, including the `vertical` setting. Only the grid_sizes may change. They must still add up to the same value in every dimension.
Used in:
Used in:
Used in:
, ,Used in:
See documentation on session IDs
If true, new session is above/left of the session being split. Otherwise, it goes below/right.
Leave unset to use the default profile.
Modifies the profile to customize its behavior just for this session.
Used in:
Used in:
TODO(gln): this will not be set for tmux integration because the split happens only if/when the tmux server acts on the request. See documentation on session IDs. If more than one session was split, there will be multiple session_id's.
Used in:
This can happen if the session to be split is too small. If splitting multiple sessions and one or more cannot be split, the status will be set to CANNOT_SPLIT, even if some did succeed (in which case there will be one or more session_id's).
Couldn't decode JSON
Used in:
, ,Direction of split pane divider
Links to children
Used in:
Used in:
ID of statusbar component
Used in:
HTML to show in a popover that opens from the component.
Size in points of the content area of the popover.
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
Used in:
(message has no fields)
Used in:
Used in:
Used in:
Used in:
This is an iTerm2 tab ID.
Used in:
Used in:
Used in:
If not set, an error occurred.
Used in:
(message has no fields)
Used in:
Used in:
Set to true to begin a new transaction or false to end the current transaction. The app's main loop will not advance while in a transaction. This effectively freezes time. Keep transactions short.
Used in:
Used in:
Used in:
Used in:
unset if app scope, otherwise is session, window, or tab ID
Will be "null" if unset.
Used in:
Session, Window, or Tab identifier.
Used in:
"all" is allowed only if no gets (only sets allowed)
"all" is allowed only if no gets (only sets allowed)
"all" is allowed only if no gets (only sets allowed)
Set to special value "*" to get all in a JSON dictionary
Used in:
JSON encoded
Used in:
1:1 with get field in request. JSON encoded, with null for unset variables.
Used in:
Names you set must begin with "user."
None of the scope oneof fields was set
Used in:
,Used in:
, ,