iterm2_ruby 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +23 -0
- data/Gemfile +10 -0
- data/LICENSE +21 -0
- data/README.md +265 -0
- data/Rakefile +7 -0
- data/bin/iterm2ctl +620 -0
- data/docs/api.md +523 -0
- data/docs/architecture.md +91 -0
- data/docs/cli.md +257 -0
- data/iterm2_ruby.gemspec +29 -0
- data/lib/iterm2/client.rb +690 -0
- data/lib/iterm2/connection.rb +267 -0
- data/lib/iterm2/proto/api_pb.rb +233 -0
- data/lib/iterm2/session.rb +44 -0
- data/lib/iterm2/tab.rb +39 -0
- data/lib/iterm2/version.rb +5 -0
- data/lib/iterm2/window.rb +33 -0
- data/lib/iterm2.rb +106 -0
- data/llms.txt +114 -0
- data/proto/api.proto +1642 -0
- metadata +82 -0
data/proto/api.proto
ADDED
|
@@ -0,0 +1,1642 @@
|
|
|
1
|
+
syntax = "proto2";
|
|
2
|
+
option objc_class_prefix = "ITM";
|
|
3
|
+
package iterm2;
|
|
4
|
+
|
|
5
|
+
// A note on session IDs:
|
|
6
|
+
// In requests, session IDs may take one of three values;
|
|
7
|
+
// 1. A unique ID as returned in ListSessionsResponse
|
|
8
|
+
// 2. The special value "all", which applies to all sessions. This is sometimes not accepted. See
|
|
9
|
+
// comments in the request message for details.
|
|
10
|
+
// 3. The special value "active", which applies to the session with keyboard focus.
|
|
11
|
+
|
|
12
|
+
// All requests are wrapped in this message. This encoded message is the entirety of the payload
|
|
13
|
+
// of messages sent over WebSocket from client to iTerm2.
|
|
14
|
+
message ClientOriginatedMessage {
|
|
15
|
+
optional int64 id = 1;
|
|
16
|
+
|
|
17
|
+
oneof submessage {
|
|
18
|
+
GetBufferRequest get_buffer_request = 100;
|
|
19
|
+
GetPromptRequest get_prompt_request = 101;
|
|
20
|
+
TransactionRequest transaction_request = 102;
|
|
21
|
+
NotificationRequest notification_request = 103;
|
|
22
|
+
RegisterToolRequest register_tool_request = 104;
|
|
23
|
+
SetProfilePropertyRequest set_profile_property_request = 105;
|
|
24
|
+
ListSessionsRequest list_sessions_request = 106;
|
|
25
|
+
SendTextRequest send_text_request = 107;
|
|
26
|
+
CreateTabRequest create_tab_request = 108;
|
|
27
|
+
SplitPaneRequest split_pane_request = 109;
|
|
28
|
+
GetProfilePropertyRequest get_profile_property_request = 110;
|
|
29
|
+
SetPropertyRequest set_property_request = 111;
|
|
30
|
+
GetPropertyRequest get_property_request = 112;
|
|
31
|
+
InjectRequest inject_request = 113;
|
|
32
|
+
ActivateRequest activate_request = 114;
|
|
33
|
+
VariableRequest variable_request = 115;
|
|
34
|
+
SavedArrangementRequest saved_arrangement_request = 116;
|
|
35
|
+
FocusRequest focus_request = 117;
|
|
36
|
+
ListProfilesRequest list_profiles_request = 118;
|
|
37
|
+
ServerOriginatedRPCResultRequest server_originated_rpc_result_request = 119;
|
|
38
|
+
RestartSessionRequest restart_session_request = 120;
|
|
39
|
+
MenuItemRequest menu_item_request = 121;
|
|
40
|
+
SetTabLayoutRequest set_tab_layout_request = 122;
|
|
41
|
+
GetBroadcastDomainsRequest get_broadcast_domains_request = 123;
|
|
42
|
+
TmuxRequest tmux_request = 124;
|
|
43
|
+
ReorderTabsRequest reorder_tabs_request = 125;
|
|
44
|
+
PreferencesRequest preferences_request = 126;
|
|
45
|
+
ColorPresetRequest color_preset_request = 127;
|
|
46
|
+
SelectionRequest selection_request = 128;
|
|
47
|
+
StatusBarComponentRequest status_bar_component_request = 129;
|
|
48
|
+
SetBroadcastDomainsRequest set_broadcast_domains_request = 130;
|
|
49
|
+
CloseRequest close_request = 131;
|
|
50
|
+
InvokeFunctionRequest invoke_function_request = 132;
|
|
51
|
+
ListPromptsRequest list_prompts_request = 133;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// All responses are wrapped in this message. This encoded message is the entirety of the payload
|
|
56
|
+
// of messages sent over WebSocket from iTerm2 to client.
|
|
57
|
+
message ServerOriginatedMessage {
|
|
58
|
+
optional int64 id = 1;
|
|
59
|
+
|
|
60
|
+
// Responses to ClientOriginatedMessages of the corresponding type
|
|
61
|
+
oneof submessage {
|
|
62
|
+
string error = 2; // Set if request was malformed
|
|
63
|
+
|
|
64
|
+
GetBufferResponse get_buffer_response = 100;
|
|
65
|
+
GetPromptResponse get_prompt_response = 101;
|
|
66
|
+
TransactionResponse transaction_response = 102;
|
|
67
|
+
NotificationResponse notification_response = 103;
|
|
68
|
+
RegisterToolResponse register_tool_response = 104;
|
|
69
|
+
SetProfilePropertyResponse set_profile_property_response = 105;
|
|
70
|
+
ListSessionsResponse list_sessions_response = 106;
|
|
71
|
+
SendTextResponse send_text_response = 107;
|
|
72
|
+
CreateTabResponse create_tab_response = 108;
|
|
73
|
+
SplitPaneResponse split_pane_response = 109;
|
|
74
|
+
GetProfilePropertyResponse get_profile_property_response = 110;
|
|
75
|
+
SetPropertyResponse set_property_response = 111;
|
|
76
|
+
GetPropertyResponse get_property_response = 112;
|
|
77
|
+
InjectResponse inject_response = 113;
|
|
78
|
+
ActivateResponse activate_response = 114;
|
|
79
|
+
VariableResponse variable_response = 115;
|
|
80
|
+
SavedArrangementResponse saved_arrangement_response = 116;
|
|
81
|
+
FocusResponse focus_response = 117;
|
|
82
|
+
ListProfilesResponse list_profiles_response = 118;
|
|
83
|
+
ServerOriginatedRPCResultResponse server_originated_rpc_result_response = 119;
|
|
84
|
+
RestartSessionResponse restart_session_response = 120;
|
|
85
|
+
MenuItemResponse menu_item_response = 121;
|
|
86
|
+
SetTabLayoutResponse set_tab_layout_response = 122;
|
|
87
|
+
GetBroadcastDomainsResponse get_broadcast_domains_response = 123;
|
|
88
|
+
TmuxResponse tmux_response = 124;
|
|
89
|
+
ReorderTabsResponse reorder_tabs_response = 125;
|
|
90
|
+
PreferencesResponse preferences_response = 126;
|
|
91
|
+
ColorPresetResponse color_preset_response = 127;
|
|
92
|
+
SelectionResponse selection_response = 128;
|
|
93
|
+
StatusBarComponentResponse status_bar_component_response = 129;
|
|
94
|
+
SetBroadcastDomainsResponse set_broadcast_domains_response = 130;
|
|
95
|
+
CloseResponse close_response = 131;
|
|
96
|
+
InvokeFunctionResponse invoke_function_response = 132;
|
|
97
|
+
ListPromptsResponse list_prompts_response = 133;
|
|
98
|
+
|
|
99
|
+
// This is the only response that is sent spontaneously. The 'id' field will not be set.
|
|
100
|
+
Notification notification = 1000;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
message InvokeFunctionRequest {
|
|
105
|
+
message Tab {
|
|
106
|
+
optional string tab_id = 1;
|
|
107
|
+
}
|
|
108
|
+
message Session {
|
|
109
|
+
optional string session_id = 1;
|
|
110
|
+
}
|
|
111
|
+
message Window {
|
|
112
|
+
optional string window_id = 1;
|
|
113
|
+
}
|
|
114
|
+
message App {
|
|
115
|
+
}
|
|
116
|
+
message Method {
|
|
117
|
+
// The following methods are defined:
|
|
118
|
+
// window.set_title(title: String)
|
|
119
|
+
// session.set_name(name: String)
|
|
120
|
+
// session.run_tmux_command(command: String) throws // Throws an exception if this is not a tmux session
|
|
121
|
+
// session.set_status_bar_component_unread_count(identifier: String, count: Int)
|
|
122
|
+
// session.stop_coprocess() -> Bool // returns whether there was a coprocess to stop
|
|
123
|
+
// session.get_coprocess() -> String? // returns the name of the command, or nil
|
|
124
|
+
// 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.
|
|
125
|
+
// tab.set_title(title: String)
|
|
126
|
+
// 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.
|
|
127
|
+
optional string receiver = 1;
|
|
128
|
+
}
|
|
129
|
+
oneof context {
|
|
130
|
+
Tab tab = 1;
|
|
131
|
+
Session session = 2;
|
|
132
|
+
Window window = 3;
|
|
133
|
+
App app = 4;
|
|
134
|
+
Method method = 7;
|
|
135
|
+
}
|
|
136
|
+
optional string invocation = 5;
|
|
137
|
+
optional double timeout = 6 [default=-1]; // If not given a reasonable default value will be used. Negative value means to use the default.
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
message InvokeFunctionResponse {
|
|
141
|
+
enum Status {
|
|
142
|
+
TIMEOUT = 1;
|
|
143
|
+
FAILED = 2;
|
|
144
|
+
REQUEST_MALFORMED = 3;
|
|
145
|
+
INVALID_ID = 4;
|
|
146
|
+
}
|
|
147
|
+
message Error {
|
|
148
|
+
optional Status status = 1;
|
|
149
|
+
optional string error_reason = 2;
|
|
150
|
+
}
|
|
151
|
+
message Success {
|
|
152
|
+
optional string json_result = 1;
|
|
153
|
+
}
|
|
154
|
+
oneof disposition {
|
|
155
|
+
Error error = 1;
|
|
156
|
+
Success success = 2;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
message CloseRequest {
|
|
161
|
+
message CloseTabs {
|
|
162
|
+
repeated string tab_ids = 1;
|
|
163
|
+
}
|
|
164
|
+
message CloseSessions {
|
|
165
|
+
repeated string session_ids = 1;
|
|
166
|
+
}
|
|
167
|
+
message CloseWindows {
|
|
168
|
+
repeated string window_ids = 1;
|
|
169
|
+
}
|
|
170
|
+
oneof target {
|
|
171
|
+
CloseTabs tabs = 1;
|
|
172
|
+
CloseSessions sessions = 2;
|
|
173
|
+
CloseWindows windows = 3;
|
|
174
|
+
}
|
|
175
|
+
optional bool force = 4;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
message CloseResponse {
|
|
179
|
+
enum Status {
|
|
180
|
+
OK = 0;
|
|
181
|
+
NOT_FOUND = 1;
|
|
182
|
+
USER_DECLINED = 2;
|
|
183
|
+
}
|
|
184
|
+
repeated Status statuses = 1;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
message SetBroadcastDomainsRequest {
|
|
188
|
+
repeated BroadcastDomain broadcast_domains = 1;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
message SetBroadcastDomainsResponse {
|
|
192
|
+
enum Status {
|
|
193
|
+
OK = 0;
|
|
194
|
+
SESSION_NOT_FOUND = 1;
|
|
195
|
+
BROADCAST_DOMAINS_NOT_DISJOINT = 2;
|
|
196
|
+
SESSIONS_NOT_IN_SAME_WINDOW = 3;
|
|
197
|
+
}
|
|
198
|
+
optional Status status = 1;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
message StatusBarComponentRequest {
|
|
202
|
+
message OpenPopover {
|
|
203
|
+
optional string session_id = 1;
|
|
204
|
+
optional string html = 2; // HTML to show in a popover that opens from the component.
|
|
205
|
+
optional Size size = 3; // Size in points of the content area of the popover.
|
|
206
|
+
}
|
|
207
|
+
oneof request {
|
|
208
|
+
OpenPopover open_popover = 1;
|
|
209
|
+
}
|
|
210
|
+
optional string identifier = 2; // ID of statusbar component
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
message StatusBarComponentResponse {
|
|
214
|
+
enum Status {
|
|
215
|
+
OK = 0;
|
|
216
|
+
SESSION_NOT_FOUND = 1;
|
|
217
|
+
REQUEST_MALFORMED = 2;
|
|
218
|
+
INVALID_IDENTIFIER = 3;
|
|
219
|
+
}
|
|
220
|
+
optional Status status = 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
message WindowedCoordRange {
|
|
224
|
+
optional CoordRange coord_range = 1;
|
|
225
|
+
optional Range columns = 2;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
enum SelectionMode {
|
|
229
|
+
CHARACTER = 0;
|
|
230
|
+
WORD = 1;
|
|
231
|
+
LINE = 2;
|
|
232
|
+
SMART = 3;
|
|
233
|
+
BOX = 4;
|
|
234
|
+
WHOLE_LINE = 5;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
message SubSelection {
|
|
238
|
+
optional WindowedCoordRange windowed_coord_range = 1;
|
|
239
|
+
optional SelectionMode selection_mode = 2;
|
|
240
|
+
optional bool connected = 3;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
message Selection {
|
|
244
|
+
repeated SubSelection sub_selections = 1;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
message SelectionRequest {
|
|
248
|
+
message GetSelectionRequest {
|
|
249
|
+
optional string session_id = 1;
|
|
250
|
+
}
|
|
251
|
+
message SetSelectionRequest {
|
|
252
|
+
optional string session_id = 1;
|
|
253
|
+
optional Selection selection = 2;
|
|
254
|
+
}
|
|
255
|
+
oneof request {
|
|
256
|
+
GetSelectionRequest get_selection_request = 1;
|
|
257
|
+
SetSelectionRequest set_selection_request = 2;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
message SelectionResponse {
|
|
262
|
+
enum Status {
|
|
263
|
+
OK = 0;
|
|
264
|
+
INVALID_SESSION = 1;
|
|
265
|
+
INVALID_RANGE = 2;
|
|
266
|
+
REQUEST_MALFORMED = 3;
|
|
267
|
+
}
|
|
268
|
+
optional Status status = 1;
|
|
269
|
+
message GetSelectionResponse {
|
|
270
|
+
optional Selection selection = 2;
|
|
271
|
+
}
|
|
272
|
+
message SetSelectionResponse {
|
|
273
|
+
}
|
|
274
|
+
oneof response {
|
|
275
|
+
GetSelectionResponse get_selection_response = 2;
|
|
276
|
+
SetSelectionResponse set_selection_response = 3;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
message ColorPresetRequest {
|
|
281
|
+
message ListPresets {
|
|
282
|
+
}
|
|
283
|
+
message GetPreset {
|
|
284
|
+
optional string name = 1;
|
|
285
|
+
}
|
|
286
|
+
oneof request {
|
|
287
|
+
ListPresets list_presets = 1;
|
|
288
|
+
GetPreset get_preset = 2;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
message ColorPresetResponse {
|
|
293
|
+
message ListPresets {
|
|
294
|
+
repeated string name = 1;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
message GetPreset {
|
|
298
|
+
message ColorSetting {
|
|
299
|
+
optional float red = 1;
|
|
300
|
+
optional float green = 2;
|
|
301
|
+
optional float blue = 3;
|
|
302
|
+
optional float alpha = 4;
|
|
303
|
+
optional string color_space = 5;
|
|
304
|
+
optional string key = 6;
|
|
305
|
+
}
|
|
306
|
+
repeated ColorSetting color_settings = 1;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
oneof response {
|
|
310
|
+
ListPresets list_presets = 1;
|
|
311
|
+
GetPreset get_preset = 2;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
enum Status {
|
|
315
|
+
OK = 0;
|
|
316
|
+
PRESET_NOT_FOUND = 1;
|
|
317
|
+
REQUEST_MALFORMED = 2;
|
|
318
|
+
}
|
|
319
|
+
optional Status status = 3;
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
message PreferencesRequest {
|
|
323
|
+
message Request {
|
|
324
|
+
message SetPreference {
|
|
325
|
+
optional string key = 1;
|
|
326
|
+
optional string json_value = 2;
|
|
327
|
+
}
|
|
328
|
+
message GetPreference {
|
|
329
|
+
optional string key = 1;
|
|
330
|
+
}
|
|
331
|
+
message SetDefaultProfile {
|
|
332
|
+
optional string guid = 1;
|
|
333
|
+
}
|
|
334
|
+
message GetDefaultProfile {
|
|
335
|
+
}
|
|
336
|
+
oneof request {
|
|
337
|
+
SetPreference set_preference_request = 1;
|
|
338
|
+
GetPreference get_preference_request = 2;
|
|
339
|
+
SetDefaultProfile set_default_profile_request = 3;
|
|
340
|
+
GetDefaultProfile get_default_profile_request = 4;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
repeated Request requests = 1;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
message PreferencesResponse {
|
|
347
|
+
message Result {
|
|
348
|
+
message SetPreferenceResult {
|
|
349
|
+
enum Status {
|
|
350
|
+
OK = 0;
|
|
351
|
+
BAD_JSON = 1;
|
|
352
|
+
INVALID_VALUE = 2; // Not legal for a plist
|
|
353
|
+
}
|
|
354
|
+
optional Status status = 1;
|
|
355
|
+
}
|
|
356
|
+
message GetPreferenceResult {
|
|
357
|
+
optional string json_value = 1; // Will be unset if no value assigned. Will always be set if there is a default value.
|
|
358
|
+
}
|
|
359
|
+
message SetDefaultProfileResult {
|
|
360
|
+
enum Status {
|
|
361
|
+
OK = 0;
|
|
362
|
+
BAD_GUID = 1;
|
|
363
|
+
}
|
|
364
|
+
optional Status status = 1;
|
|
365
|
+
}
|
|
366
|
+
message UnrecognizedResult {
|
|
367
|
+
}
|
|
368
|
+
message GetDefaultProfileResult {
|
|
369
|
+
optional string guid = 1;
|
|
370
|
+
}
|
|
371
|
+
oneof result {
|
|
372
|
+
UnrecognizedResult unrecognized_request = 1;
|
|
373
|
+
SetPreferenceResult set_preference_result = 2;
|
|
374
|
+
GetPreferenceResult get_preference_result = 3;
|
|
375
|
+
SetDefaultProfileResult set_default_profile_result = 4;
|
|
376
|
+
GetDefaultProfileResult get_default_profile_result = 5;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
repeated Result results = 1;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
message ReorderTabsRequest {
|
|
383
|
+
message Assignment {
|
|
384
|
+
optional string window_id = 1;
|
|
385
|
+
repeated string tab_ids = 2;
|
|
386
|
+
}
|
|
387
|
+
repeated Assignment assignments = 3;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
message ReorderTabsResponse {
|
|
391
|
+
enum Status {
|
|
392
|
+
OK = 0;
|
|
393
|
+
INVALID_ASSIGNMENT = 1; // e.g., duplicate tab id
|
|
394
|
+
INVALID_WINDOW_ID = 2;
|
|
395
|
+
INVALID_TAB_ID = 3;
|
|
396
|
+
}
|
|
397
|
+
optional Status status = 4;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
message TmuxRequest {
|
|
401
|
+
message ListConnections {
|
|
402
|
+
}
|
|
403
|
+
message SendCommand {
|
|
404
|
+
optional string connection_id = 1;
|
|
405
|
+
optional string command = 2;
|
|
406
|
+
}
|
|
407
|
+
message SetWindowVisible {
|
|
408
|
+
optional string connection_id = 1;
|
|
409
|
+
optional string window_id = 2;
|
|
410
|
+
optional bool visible = 3;
|
|
411
|
+
}
|
|
412
|
+
message CreateWindow {
|
|
413
|
+
optional string connection_id = 1;
|
|
414
|
+
optional string affinity = 2;
|
|
415
|
+
}
|
|
416
|
+
oneof payload {
|
|
417
|
+
ListConnections list_connections = 1;
|
|
418
|
+
SendCommand send_command = 2;
|
|
419
|
+
SetWindowVisible set_window_visible = 3;
|
|
420
|
+
CreateWindow create_window = 4;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
message TmuxResponse {
|
|
425
|
+
message ListConnections {
|
|
426
|
+
message Connection {
|
|
427
|
+
optional string connection_id = 1;
|
|
428
|
+
optional string owning_session_id = 2;
|
|
429
|
+
}
|
|
430
|
+
repeated Connection connections = 1;
|
|
431
|
+
}
|
|
432
|
+
message SendCommand {
|
|
433
|
+
// If not set, an error occurred.
|
|
434
|
+
optional string output = 1;
|
|
435
|
+
}
|
|
436
|
+
message SetWindowVisible {
|
|
437
|
+
}
|
|
438
|
+
message CreateWindow {
|
|
439
|
+
// This is an iTerm2 tab ID.
|
|
440
|
+
optional string tab_id = 1;
|
|
441
|
+
}
|
|
442
|
+
oneof payload {
|
|
443
|
+
ListConnections list_connections = 1;
|
|
444
|
+
SendCommand send_command = 2;
|
|
445
|
+
SetWindowVisible set_window_visible = 3;
|
|
446
|
+
CreateWindow create_window = 5;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
enum Status{
|
|
450
|
+
OK = 0;
|
|
451
|
+
INVALID_REQUEST = 1;
|
|
452
|
+
INVALID_CONNECTION_ID = 2;
|
|
453
|
+
INVALID_WINDOW_ID = 3;
|
|
454
|
+
}
|
|
455
|
+
optional Status status = 4;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
message GetBroadcastDomainsRequest {
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
message BroadcastDomain {
|
|
462
|
+
repeated string session_ids = 1;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
message GetBroadcastDomainsResponse {
|
|
466
|
+
repeated BroadcastDomain broadcast_domains = 1;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
message SetTabLayoutRequest {
|
|
470
|
+
// The tree structure must exactly match the actual tree structure, including the `vertical`
|
|
471
|
+
// setting. Only the grid_sizes may change. They must still add up to the same value in every
|
|
472
|
+
// dimension.
|
|
473
|
+
optional SplitTreeNode root = 1;
|
|
474
|
+
optional string tab_id = 2;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
message SetTabLayoutResponse {
|
|
478
|
+
enum Status {
|
|
479
|
+
OK = 0;
|
|
480
|
+
BAD_TAB_ID = 1;
|
|
481
|
+
WRONG_TREE = 2;
|
|
482
|
+
INVALID_SIZE = 3;
|
|
483
|
+
}
|
|
484
|
+
optional Status status = 1;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// Invoke or ask for info about a menu item
|
|
488
|
+
message MenuItemRequest {
|
|
489
|
+
// Unique identifier of the menu item.
|
|
490
|
+
optional string identifier = 1;
|
|
491
|
+
|
|
492
|
+
// If set do not actually invoke it. Just return its state.
|
|
493
|
+
optional bool query_only = 2;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
message MenuItemResponse {
|
|
497
|
+
enum Status {
|
|
498
|
+
OK = 0;
|
|
499
|
+
BAD_IDENTIFIER = 1;
|
|
500
|
+
DISABLED = 2;
|
|
501
|
+
}
|
|
502
|
+
optional Status status = 1;
|
|
503
|
+
optional bool checked = 2;
|
|
504
|
+
optional bool enabled = 3;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
message RestartSessionRequest {
|
|
508
|
+
optional string session_id = 1; // "all" not allowed.
|
|
509
|
+
|
|
510
|
+
// If set, then still-running sessions will fail to restart with SESSION_NOT_RESTARTABLE.
|
|
511
|
+
// If not set, then a still-running session gets killed and restarted.
|
|
512
|
+
optional bool only_if_exited = 2;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
message RestartSessionResponse {
|
|
516
|
+
enum Status {
|
|
517
|
+
OK = 0;
|
|
518
|
+
SESSION_NOT_FOUND = 1;
|
|
519
|
+
|
|
520
|
+
// Some sessions, such as tmux integration sessions, are not restartable.
|
|
521
|
+
// Also, when `only_if_exited` is set in the request and the session is still running then this
|
|
522
|
+
// status will be returned.
|
|
523
|
+
SESSION_NOT_RESTARTABLE = 2;
|
|
524
|
+
}
|
|
525
|
+
optional Status status = 1;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// This is the result of an iTerm2-to-script RPC call.
|
|
529
|
+
message ServerOriginatedRPCResultRequest {
|
|
530
|
+
optional string request_id = 1;
|
|
531
|
+
oneof result {
|
|
532
|
+
// Exceptions should be dictionaries with a key of "reason" having a string value describing
|
|
533
|
+
// what went wrong.
|
|
534
|
+
string json_exception = 2;
|
|
535
|
+
string json_value = 3;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// This simply acknowledges receipt of ServerOriginatedRPCResultRequest.
|
|
540
|
+
message ServerOriginatedRPCResultResponse {
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// Requests a list of all profiles.
|
|
544
|
+
message ListProfilesRequest {
|
|
545
|
+
// The profile properties to respond with. See SetProfilePropertyRequest for a list of values.
|
|
546
|
+
// If empty, all properties will be returned.
|
|
547
|
+
repeated string properties = 1;
|
|
548
|
+
|
|
549
|
+
// If empty, all profiles will be returned. Otherwise, only profiles with one of the listed
|
|
550
|
+
// GUIDs will be returned.
|
|
551
|
+
repeated string guids = 2;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
message ListProfilesResponse {
|
|
555
|
+
message Profile {
|
|
556
|
+
repeated ProfileProperty properties = 1;
|
|
557
|
+
}
|
|
558
|
+
repeated Profile profiles = 1;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
message FocusRequest {
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
message FocusResponse {
|
|
565
|
+
// A collection of notifications that completely describe the state of every tab and window and
|
|
566
|
+
// the application itself.
|
|
567
|
+
repeated FocusChangedNotification notifications = 1;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
message SavedArrangementRequest {
|
|
571
|
+
// Not used for LIST
|
|
572
|
+
optional string name = 1;
|
|
573
|
+
|
|
574
|
+
enum Action {
|
|
575
|
+
// Restore an existing arrangement with the given name
|
|
576
|
+
RESTORE = 0;
|
|
577
|
+
|
|
578
|
+
// Save windows to a new arrangement with the given name
|
|
579
|
+
SAVE = 1;
|
|
580
|
+
|
|
581
|
+
// List arrangements
|
|
582
|
+
LIST = 2;
|
|
583
|
+
}
|
|
584
|
+
optional Action action = 2;
|
|
585
|
+
|
|
586
|
+
// If given and the action is SAVE then only the tabs in the identified window are saved.
|
|
587
|
+
// If given and the action is RESTORE then the arrangement will be restored as tabs in the identified window.
|
|
588
|
+
// Not used for LIST
|
|
589
|
+
optional string window_id = 3;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
message SavedArrangementResponse {
|
|
593
|
+
enum Status {
|
|
594
|
+
OK = 0;
|
|
595
|
+
ARRANGEMENT_NOT_FOUND = 1; // Tried to restore, but name doesn't exist
|
|
596
|
+
WINDOW_NOT_FOUND = 2; // Bad window ID provided
|
|
597
|
+
REQUEST_MALFORMED = 3;
|
|
598
|
+
}
|
|
599
|
+
optional Status status = 1;
|
|
600
|
+
repeated string names = 2;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
message VariableRequest {
|
|
604
|
+
oneof scope {
|
|
605
|
+
string session_id = 1; // "all" is allowed only if no gets (only sets allowed)
|
|
606
|
+
string tab_id = 4; // "all" is allowed only if no gets (only sets allowed)
|
|
607
|
+
bool app = 5;
|
|
608
|
+
string window_id = 6; // "all" is allowed only if no gets (only sets allowed)
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
message Set {
|
|
612
|
+
optional string name = 1;
|
|
613
|
+
optional string value = 2; // JSON encoded
|
|
614
|
+
}
|
|
615
|
+
repeated Set set = 2;
|
|
616
|
+
repeated string get = 3; // Set to special value "*" to get all in a JSON dictionary
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
message VariableResponse {
|
|
620
|
+
enum Status {
|
|
621
|
+
OK = 0;
|
|
622
|
+
SESSION_NOT_FOUND = 1;
|
|
623
|
+
INVALID_NAME = 2; // Names you set must begin with "user."
|
|
624
|
+
MISSING_SCOPE = 3; // None of the scope oneof fields was set
|
|
625
|
+
TAB_NOT_FOUND = 4;
|
|
626
|
+
MULTI_GET_DISALLOWED = 5;
|
|
627
|
+
WINDOW_NOT_FOUND = 6;
|
|
628
|
+
}
|
|
629
|
+
optional Status status = 1;
|
|
630
|
+
repeated string values = 2; // 1:1 with get field in request. JSON encoded, with null for unset variables.
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
message ActivateRequest {
|
|
634
|
+
// To activate the app without changing anything else omit the identifier.
|
|
635
|
+
oneof identifier {
|
|
636
|
+
string window_id = 1;
|
|
637
|
+
string tab_id = 2;
|
|
638
|
+
string session_id = 3;
|
|
639
|
+
}
|
|
640
|
+
optional bool order_window_front = 4;
|
|
641
|
+
|
|
642
|
+
// This may be enabled if tab_id or session_id is set.
|
|
643
|
+
optional bool select_tab = 5;
|
|
644
|
+
|
|
645
|
+
// This may be enabled if session_id is set.
|
|
646
|
+
optional bool select_session = 6;
|
|
647
|
+
|
|
648
|
+
// Activate the app?
|
|
649
|
+
message App {
|
|
650
|
+
optional bool raise_all_windows = 1;
|
|
651
|
+
optional bool ignoring_other_apps = 2;
|
|
652
|
+
}
|
|
653
|
+
optional App activate_app = 7;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
message ActivateResponse {
|
|
657
|
+
enum Status {
|
|
658
|
+
OK = 0;
|
|
659
|
+
BAD_IDENTIFIER = 1;
|
|
660
|
+
INVALID_OPTION = 2;
|
|
661
|
+
}
|
|
662
|
+
optional Status status = 1;
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
// Injects bytes as input to the terminal, as though the running program had produced them.
|
|
666
|
+
message InjectRequest {
|
|
667
|
+
repeated string session_id = 1;
|
|
668
|
+
optional bytes data = 2;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
message InjectResponse {
|
|
672
|
+
enum Status {
|
|
673
|
+
OK = 0;
|
|
674
|
+
SESSION_NOT_FOUND = 1;
|
|
675
|
+
}
|
|
676
|
+
// One status per session_id in the request
|
|
677
|
+
repeated Status status = 1;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
message GetPropertyRequest {
|
|
681
|
+
// The kind of ID that's set determines the kind of object you're querying.
|
|
682
|
+
oneof identifier {
|
|
683
|
+
string window_id = 1;
|
|
684
|
+
string session_id = 3; // Does not accept "all". Accepts "active".
|
|
685
|
+
}
|
|
686
|
+
// For sessions:
|
|
687
|
+
// "grid_size" -> { "width": number, "height": number }
|
|
688
|
+
// "buried" -> boolean
|
|
689
|
+
// "number_of_lines" -> { "overflow": number, "grid": number, "history": number }
|
|
690
|
+
//
|
|
691
|
+
// For windows:
|
|
692
|
+
// "frame" -> { "origin": { "x": number, "y": number }, "size": { "width": number, "height": number } }
|
|
693
|
+
// "fullscreen" -> boolean
|
|
694
|
+
optional string name = 2;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
message GetPropertyResponse {
|
|
698
|
+
enum Status {
|
|
699
|
+
OK = 0;
|
|
700
|
+
UNRECOGNIZED_NAME = 1;
|
|
701
|
+
INVALID_TARGET = 2;
|
|
702
|
+
}
|
|
703
|
+
// Name Example value
|
|
704
|
+
// ------------- ---------------
|
|
705
|
+
// frame { "origin": { "x": 0, "y": 0 }, "size": { "width": 1024, "height": 768 }}
|
|
706
|
+
// fullscreen true, false
|
|
707
|
+
//
|
|
708
|
+
// For sessions:
|
|
709
|
+
// grid_size { "width": 80, "height": 25 }
|
|
710
|
+
// buried true
|
|
711
|
+
optional Status status = 1;
|
|
712
|
+
optional string json_value = 2;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
message SetPropertyRequest {
|
|
716
|
+
// Eventually you'll be able to set properties on other things besides The kind of ID that's set
|
|
717
|
+
// determines the kind of object you're updating.
|
|
718
|
+
oneof identifier {
|
|
719
|
+
string window_id = 1;
|
|
720
|
+
string session_id = 5; // Accepts "all" and "active"
|
|
721
|
+
}
|
|
722
|
+
// For windows:
|
|
723
|
+
// Name Example JSON
|
|
724
|
+
// ------------- ---------------
|
|
725
|
+
// frame { "origin": { "x": 0, "y": 0 }, "size": { "width": 1024, "height": 768 }}
|
|
726
|
+
// fullscreen true, false
|
|
727
|
+
//
|
|
728
|
+
// For sessions:
|
|
729
|
+
// grid_size { "width": 80, "height": 25 }
|
|
730
|
+
// buried true
|
|
731
|
+
optional string name = 3;
|
|
732
|
+
optional string json_value = 4;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
message SetPropertyResponse {
|
|
736
|
+
enum Status {
|
|
737
|
+
OK = 0;
|
|
738
|
+
UNRECOGNIZED_NAME = 1;
|
|
739
|
+
INVALID_VALUE = 2; // e.g., bad JSON value
|
|
740
|
+
INVALID_TARGET = 3; // e.g., bogus window_id
|
|
741
|
+
DEFERRED = 4; // Operation can't be performed immediately. Will be tried later. For example, resizing a session during instant replay.
|
|
742
|
+
IMPOSSIBLE = 5; // Can't be done. For example, resizing a session in a full-screen window.
|
|
743
|
+
FAILED = 6; // Did our best and failed. For example, sometimes toggling full-screen fails if another window is also toggling. Maybe try again?
|
|
744
|
+
}
|
|
745
|
+
optional Status status = 1;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// Registers a toolbelt tool that displays a webview with a URL of your choice.
|
|
749
|
+
message RegisterToolRequest {
|
|
750
|
+
// This name is displayed to the user.
|
|
751
|
+
optional string name = 1;
|
|
752
|
+
|
|
753
|
+
// The tool's identifier should be unique. Prefix it with your app bundle. For example:
|
|
754
|
+
// com.example.mytool
|
|
755
|
+
optional string identifier = 2;
|
|
756
|
+
|
|
757
|
+
enum ToolType {
|
|
758
|
+
WEB_VIEW_TOOL = 1;
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// The first time a tool is registered iTerm2 automatically adds it to the
|
|
762
|
+
// set of visible tools. To show it on subsequent re-registrations, set this
|
|
763
|
+
// to true. If the toolbelt itself is hidden, it will not be opened.
|
|
764
|
+
optional bool reveal_if_already_registered = 5 [default = false];
|
|
765
|
+
|
|
766
|
+
optional ToolType tool_type = 3 [default = WEB_VIEW_TOOL];
|
|
767
|
+
|
|
768
|
+
// For web view tools: The URL loaded at startup
|
|
769
|
+
optional string URL = 4;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// Describes an RPC from iTerm2 to script. I don't want to invent my own type
|
|
773
|
+
// system so this is dynamically typed, which matches Python well enough.
|
|
774
|
+
message RPCRegistrationRequest {
|
|
775
|
+
message RPCArgumentSignature {
|
|
776
|
+
optional string name = 1;
|
|
777
|
+
}
|
|
778
|
+
optional string name = 1;
|
|
779
|
+
repeated RPCArgumentSignature arguments = 2;
|
|
780
|
+
|
|
781
|
+
message RPCArgument {
|
|
782
|
+
optional string name = 1;
|
|
783
|
+
optional string path = 2;
|
|
784
|
+
}
|
|
785
|
+
repeated RPCArgument defaults = 4;
|
|
786
|
+
|
|
787
|
+
// If not specified, iTerm2 decides based on its built-in default.
|
|
788
|
+
optional float timeout = 3;
|
|
789
|
+
|
|
790
|
+
enum Role {
|
|
791
|
+
GENERIC = 1;
|
|
792
|
+
SESSION_TITLE = 2;
|
|
793
|
+
STATUS_BAR_COMPONENT = 3;
|
|
794
|
+
CONTEXT_MENU = 4;
|
|
795
|
+
}
|
|
796
|
+
optional Role role = 5 [default=GENERIC];
|
|
797
|
+
|
|
798
|
+
message SessionTitleAttributes {
|
|
799
|
+
// Used by SESSION_TITLE to control name in Preferences menu
|
|
800
|
+
optional string display_name = 1;
|
|
801
|
+
// Identifies this title provider uniquely. Must not conflict with other title providers.
|
|
802
|
+
// Use a backwards domain name identifying yourself and the feature, like "com.example.featurename"
|
|
803
|
+
optional string unique_identifier = 6;
|
|
804
|
+
}
|
|
805
|
+
message StatusBarComponentAttributes {
|
|
806
|
+
// Used by STATUS_BAR_COMPONENT
|
|
807
|
+
optional string short_description = 1;
|
|
808
|
+
optional string detailed_description = 2;
|
|
809
|
+
|
|
810
|
+
message Knob {
|
|
811
|
+
optional string name = 1;
|
|
812
|
+
enum Type {
|
|
813
|
+
Checkbox = 1;
|
|
814
|
+
String = 2;
|
|
815
|
+
PositiveFloatingPoint = 3;
|
|
816
|
+
Color = 4;
|
|
817
|
+
}
|
|
818
|
+
optional Type type = 2;
|
|
819
|
+
optional string placeholder = 3;
|
|
820
|
+
optional string json_default_value = 4;
|
|
821
|
+
optional string key = 5;
|
|
822
|
+
}
|
|
823
|
+
repeated Knob knobs = 3;
|
|
824
|
+
|
|
825
|
+
optional string exemplar = 4;
|
|
826
|
+
optional float update_cadence = 5;
|
|
827
|
+
|
|
828
|
+
// Identifies this component uniquely. Must not conflict with other components.
|
|
829
|
+
// Use a backwards domain name identifying yourself and the feature, like "com.example.featurename"
|
|
830
|
+
optional string unique_identifier = 6;
|
|
831
|
+
|
|
832
|
+
message Icon {
|
|
833
|
+
optional bytes data = 1;
|
|
834
|
+
optional float scale = 2;
|
|
835
|
+
}
|
|
836
|
+
repeated Icon icons = 7;
|
|
837
|
+
|
|
838
|
+
enum Format {
|
|
839
|
+
PLAIN_TEXT = 0;
|
|
840
|
+
HTML = 1;
|
|
841
|
+
}
|
|
842
|
+
optional Format format = 8 [default = PLAIN_TEXT];
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
message ContextMenuAttributes {
|
|
846
|
+
optional string display_name = 1;
|
|
847
|
+
optional string unique_identifier = 2;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
oneof RoleSpecificAttributes {
|
|
851
|
+
SessionTitleAttributes session_title_attributes = 7;
|
|
852
|
+
StatusBarComponentAttributes status_bar_component_attributes = 8;
|
|
853
|
+
ContextMenuAttributes context_menu_attributes = 9;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
optional string display_name = 6 [deprecated=true];
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
message RegisterToolResponse {
|
|
860
|
+
enum Status {
|
|
861
|
+
OK = 0;
|
|
862
|
+
REQUEST_MALFORMED = 1;
|
|
863
|
+
PERMISSION_DENIED = 2;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
optional Status status = 1;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
enum NotificationType {
|
|
870
|
+
// Notifications that use the `session` parameter.
|
|
871
|
+
NOTIFY_ON_KEYSTROKE = 1;
|
|
872
|
+
NOTIFY_ON_SCREEN_UPDATE = 2;
|
|
873
|
+
NOTIFY_ON_PROMPT = 3;
|
|
874
|
+
NOTIFY_ON_LOCATION_CHANGE = 4 [deprecated=true];
|
|
875
|
+
NOTIFY_ON_CUSTOM_ESCAPE_SEQUENCE = 5;
|
|
876
|
+
NOTIFY_ON_VARIABLE_CHANGE = 12;
|
|
877
|
+
KEYSTROKE_FILTER = 14; // Does not send a notification
|
|
878
|
+
|
|
879
|
+
// Notifications that ignore the `session` parameter.
|
|
880
|
+
NOTIFY_ON_NEW_SESSION = 6;
|
|
881
|
+
NOTIFY_ON_TERMINATE_SESSION = 7;
|
|
882
|
+
NOTIFY_ON_LAYOUT_CHANGE = 8;
|
|
883
|
+
NOTIFY_ON_FOCUS_CHANGE = 9;
|
|
884
|
+
NOTIFY_ON_SERVER_ORIGINATED_RPC = 10;
|
|
885
|
+
NOTIFY_ON_BROADCAST_CHANGE = 11;
|
|
886
|
+
NOTIFY_ON_PROFILE_CHANGE = 13;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
enum Modifiers {
|
|
890
|
+
CONTROL = 1;
|
|
891
|
+
OPTION = 2;
|
|
892
|
+
COMMAND = 3;
|
|
893
|
+
SHIFT = 4;
|
|
894
|
+
FUNCTION = 5;
|
|
895
|
+
NUMPAD = 6;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
message KeystrokePattern {
|
|
899
|
+
// The keystroke matches the pattern if it has all the required and none of the forbidden modifiers.
|
|
900
|
+
repeated Modifiers required_modifiers = 1;
|
|
901
|
+
repeated Modifiers forbidden_modifiers = 2;
|
|
902
|
+
|
|
903
|
+
// The pattern matches if the keystroke has any of these keycodes:
|
|
904
|
+
repeated int32 keycodes = 3;
|
|
905
|
+
|
|
906
|
+
// The pattern matches if the keystroke equals of any of these characters:
|
|
907
|
+
repeated string characters = 4;
|
|
908
|
+
|
|
909
|
+
// The pattern matches if the keystroke equals any of these characters ignoring modifiers.
|
|
910
|
+
// This is Apple parlance for "ignoring the shift key plus various other undocumented things"
|
|
911
|
+
repeated string characters_ignoring_modifiers = 5;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
message KeystrokeMonitorRequest {
|
|
915
|
+
// KeystrokeFilterRequest was split from this to make a more sensible API.
|
|
916
|
+
repeated KeystrokePattern patterns_to_ignore = 1 [deprecated=true];
|
|
917
|
+
|
|
918
|
+
// If false, then only key-down events are sent. If true, key-down, key-up, and flags-changed events are sent.
|
|
919
|
+
optional bool advanced = 2;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
message KeystrokeFilterRequest {
|
|
923
|
+
// If a keystroke matches any of these patterns then they will not be handled by the application.
|
|
924
|
+
// A notification will be posted and the script can handle it as it pleases.
|
|
925
|
+
repeated KeystrokePattern patterns_to_ignore = 1;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
enum VariableScope {
|
|
929
|
+
SESSION = 1;
|
|
930
|
+
TAB = 2;
|
|
931
|
+
WINDOW = 3;
|
|
932
|
+
APP = 4;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
message VariableMonitorRequest {
|
|
936
|
+
optional string name = 1;
|
|
937
|
+
optional VariableScope scope = 2;
|
|
938
|
+
optional string identifier = 3; // Session, Window, or Tab identifier.
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
message ProfileChangeRequest {
|
|
942
|
+
optional string guid = 1;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
enum PromptMonitorMode {
|
|
946
|
+
PROMPT = 1;
|
|
947
|
+
COMMAND_START = 2;
|
|
948
|
+
COMMAND_END = 3;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
message PromptMonitorRequest {
|
|
952
|
+
repeated PromptMonitorMode modes = 1;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
message NotificationRequest {
|
|
956
|
+
// See documentation on session IDs. NOTIFY_ON_NEW_SESSION, NOTIFY_ON_TERMINATE_SESSION, and
|
|
957
|
+
// NOTIFY_ON_LAYOUT_CHANGE do not use the session ID and are posted on all such events.
|
|
958
|
+
//
|
|
959
|
+
// NOTE: This is not used for NOTIFY_ON_VARIABLE_CHANGE.
|
|
960
|
+
optional string session = 1;
|
|
961
|
+
|
|
962
|
+
// Set to true to subscribe, false to unsubscribe.
|
|
963
|
+
optional bool subscribe = 2;
|
|
964
|
+
|
|
965
|
+
// When to be notified (or notification to unsubscribe from)
|
|
966
|
+
optional NotificationType notification_type = 3;
|
|
967
|
+
|
|
968
|
+
oneof arguments {
|
|
969
|
+
RPCRegistrationRequest rpc_registration_request = 4; // For NOTIFY_ON_SERVER_ORIGINATED_RPC
|
|
970
|
+
KeystrokeMonitorRequest keystroke_monitor_request = 5;
|
|
971
|
+
VariableMonitorRequest variable_monitor_request = 6;
|
|
972
|
+
ProfileChangeRequest profile_change_request = 7;
|
|
973
|
+
KeystrokeFilterRequest keystroke_filter_request = 8;
|
|
974
|
+
PromptMonitorRequest prompt_monitor_request = 9;
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
message NotificationResponse {
|
|
979
|
+
enum Status {
|
|
980
|
+
OK = 0;
|
|
981
|
+
SESSION_NOT_FOUND = 1;
|
|
982
|
+
REQUEST_MALFORMED = 2;
|
|
983
|
+
NOT_SUBSCRIBED = 3;
|
|
984
|
+
ALREADY_SUBSCRIBED = 4;
|
|
985
|
+
DUPLICATE_SERVER_ORIGINATED_RPC = 5;
|
|
986
|
+
INVALID_IDENTIFIER = 6;
|
|
987
|
+
}
|
|
988
|
+
optional Status status = 1;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
message Notification {
|
|
992
|
+
optional KeystrokeNotification keystroke_notification = 1;
|
|
993
|
+
optional ScreenUpdateNotification screen_update_notification = 2;
|
|
994
|
+
optional PromptNotification prompt_notification = 3;
|
|
995
|
+
optional LocationChangeNotification location_change_notification = 4 [deprecated=true];
|
|
996
|
+
optional CustomEscapeSequenceNotification custom_escape_sequence_notification = 5;
|
|
997
|
+
optional NewSessionNotification new_session_notification = 6;
|
|
998
|
+
optional TerminateSessionNotification terminate_session_notification = 7;
|
|
999
|
+
optional LayoutChangedNotification layout_changed_notification = 8;
|
|
1000
|
+
optional FocusChangedNotification focus_changed_notification = 9;
|
|
1001
|
+
optional ServerOriginatedRPCNotification server_originated_rpc_notification = 10;
|
|
1002
|
+
optional BroadcastDomainsChangedNotification broadcast_domains_changed = 11;
|
|
1003
|
+
optional VariableChangedNotification variable_changed_notification = 12;
|
|
1004
|
+
optional ProfileChangedNotification profile_changed_notification = 13;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
message ProfileChangedNotification {
|
|
1008
|
+
optional string guid = 1;
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
message VariableChangedNotification {
|
|
1012
|
+
optional VariableScope scope = 1;
|
|
1013
|
+
optional string identifier = 2; // unset if app scope, otherwise is session, window, or tab ID
|
|
1014
|
+
optional string name = 3;
|
|
1015
|
+
optional string json_new_value = 4; // Will be "null" if unset.
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
message BroadcastDomainsChangedNotification {
|
|
1019
|
+
repeated BroadcastDomain broadcast_domains = 1;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
message ServerOriginatedRPC {
|
|
1023
|
+
message RPCArgument {
|
|
1024
|
+
optional string name = 1;
|
|
1025
|
+
optional string json_value = 2;
|
|
1026
|
+
}
|
|
1027
|
+
optional string name = 2;
|
|
1028
|
+
repeated RPCArgument arguments = 3;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// This is an iTerm2-to-script RPC call. The script must have registered for
|
|
1032
|
+
// an RPC matching the signature of `rpc`.
|
|
1033
|
+
message ServerOriginatedRPCNotification {
|
|
1034
|
+
optional string request_id = 1;
|
|
1035
|
+
optional ServerOriginatedRPC rpc = 2;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
message KeystrokeNotification {
|
|
1039
|
+
optional string characters = 1;
|
|
1040
|
+
optional string charactersIgnoringModifiers = 2;
|
|
1041
|
+
repeated Modifiers modifiers = 3;
|
|
1042
|
+
optional int32 keyCode = 4;
|
|
1043
|
+
optional string session = 5;
|
|
1044
|
+
enum Action {
|
|
1045
|
+
// These are used for non-modifier keys.
|
|
1046
|
+
KEY_DOWN = 0;
|
|
1047
|
+
KEY_UP = 1; // requires advanced=true in request
|
|
1048
|
+
// This is used when only a modifier changes.
|
|
1049
|
+
FLAGS_CHANGED = 2; // requires advanced=true in request
|
|
1050
|
+
}
|
|
1051
|
+
optional Action action = 6;
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
message ScreenUpdateNotification {
|
|
1055
|
+
optional string session = 1;
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
message PromptNotificationPrompt {
|
|
1059
|
+
optional string placeholder = 1;
|
|
1060
|
+
optional GetPromptResponse prompt = 2;
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
message PromptNotificationCommandStart {
|
|
1064
|
+
optional string command = 1;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
message PromptNotificationCommandEnd {
|
|
1068
|
+
optional int32 status = 1;
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
message PromptNotification {
|
|
1072
|
+
optional string session = 1;
|
|
1073
|
+
oneof event {
|
|
1074
|
+
PromptNotificationPrompt prompt = 2;
|
|
1075
|
+
PromptNotificationCommandStart command_start = 3;
|
|
1076
|
+
PromptNotificationCommandEnd command_end = 4;
|
|
1077
|
+
}
|
|
1078
|
+
optional string unique_prompt_id = 5;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
message LocationChangeNotification {
|
|
1082
|
+
optional string host_name = 1;
|
|
1083
|
+
optional string user_name = 2;
|
|
1084
|
+
optional string directory = 3;
|
|
1085
|
+
optional string session = 4;
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
// OSC 1337 ; Custom=id=<identity>:<payload> ST
|
|
1089
|
+
message CustomEscapeSequenceNotification {
|
|
1090
|
+
optional string session = 1;
|
|
1091
|
+
optional string sender_identity = 2;
|
|
1092
|
+
optional string payload = 3;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
// Sent when a new session is created or a closure is undone.
|
|
1096
|
+
message NewSessionNotification {
|
|
1097
|
+
optional string session_id = 1;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// Note this is sent when the app becomes/resigns active, the key window changes, the selected tab
|
|
1101
|
+
// of a window changes, or the active pane of a tab changes. Note that you may receive duplicate
|
|
1102
|
+
// notifications at times. Ignore those that do not signify a change.
|
|
1103
|
+
message FocusChangedNotification {
|
|
1104
|
+
message Window {
|
|
1105
|
+
enum WindowStatus {
|
|
1106
|
+
// `window_id` became key
|
|
1107
|
+
TERMINAL_WINDOW_BECAME_KEY = 0;
|
|
1108
|
+
|
|
1109
|
+
// `window_id` is not key, but is the current terminal window. Some other non-terminal window is key.
|
|
1110
|
+
TERMINAL_WINDOW_IS_CURRENT = 1;
|
|
1111
|
+
|
|
1112
|
+
// `window_id` is no longer key.
|
|
1113
|
+
TERMINAL_WINDOW_RESIGNED_KEY = 2;
|
|
1114
|
+
}
|
|
1115
|
+
// Describes how to interpret window_id.
|
|
1116
|
+
optional WindowStatus window_status = 1;
|
|
1117
|
+
|
|
1118
|
+
// The affected window_id
|
|
1119
|
+
optional string window_id = 2;
|
|
1120
|
+
}
|
|
1121
|
+
oneof event {
|
|
1122
|
+
// true: application became active. false: application resigned active.
|
|
1123
|
+
bool application_active = 1;
|
|
1124
|
+
|
|
1125
|
+
// If set, gives info about a change to window focus.
|
|
1126
|
+
Window window = 2;
|
|
1127
|
+
|
|
1128
|
+
// If set, selected tab changed to the one identified herein.
|
|
1129
|
+
string selected_tab = 3;
|
|
1130
|
+
|
|
1131
|
+
// If set, the given session became active in its tab.
|
|
1132
|
+
string session = 4;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
message TerminateSessionNotification {
|
|
1137
|
+
optional string session_id = 1;
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
message LayoutChangedNotification {
|
|
1141
|
+
optional ListSessionsResponse list_sessions_response = 1;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
// Requests the contents of a range of lines.
|
|
1145
|
+
message GetBufferRequest {
|
|
1146
|
+
// See documentation on session IDs. "all" not accepted.
|
|
1147
|
+
optional string session = 1;
|
|
1148
|
+
|
|
1149
|
+
// Which lines to return?
|
|
1150
|
+
optional LineRange line_range = 2;
|
|
1151
|
+
|
|
1152
|
+
// Populate `style` field of `LineContents`?
|
|
1153
|
+
optional bool include_styles = 3;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
// Contains the contents of a range of lines.
|
|
1157
|
+
message GetBufferResponse {
|
|
1158
|
+
enum Status {
|
|
1159
|
+
OK = 0;
|
|
1160
|
+
SESSION_NOT_FOUND = 1;
|
|
1161
|
+
INVALID_LINE_RANGE = 2;
|
|
1162
|
+
REQUEST_MALFORMED = 3;
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
optional Status status = 1 [default = OK];
|
|
1166
|
+
|
|
1167
|
+
// Which lines were returned
|
|
1168
|
+
optional Range range = 2 [deprecated=true];
|
|
1169
|
+
|
|
1170
|
+
// Those lines' contents.
|
|
1171
|
+
repeated LineContents contents = 3;
|
|
1172
|
+
|
|
1173
|
+
optional Coord cursor = 4;
|
|
1174
|
+
|
|
1175
|
+
// The number of lines (including lines lost from the head of scrollback history) that precede
|
|
1176
|
+
// the screen. Subtract this from cursor.y to get the cursor's position on the screen when it
|
|
1177
|
+
// is scrolled to the bottom.
|
|
1178
|
+
optional int64 num_lines_above_screen = 5 [deprecated=true];
|
|
1179
|
+
|
|
1180
|
+
// The returned range
|
|
1181
|
+
optional WindowedCoordRange windowed_coord_range = 6;
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
// Requests metadata about the current shell prompt.
|
|
1185
|
+
message GetPromptRequest {
|
|
1186
|
+
// See documentation on session IDs. "all" not accepted.
|
|
1187
|
+
optional string session = 1;
|
|
1188
|
+
|
|
1189
|
+
// If given return this ID instead of the last one.
|
|
1190
|
+
optional string unique_prompt_id = 2;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
// Responds with metadata about the current shell prompt, if possible.
|
|
1194
|
+
message GetPromptResponse {
|
|
1195
|
+
enum Status {
|
|
1196
|
+
OK = 0;
|
|
1197
|
+
SESSION_NOT_FOUND = 1;
|
|
1198
|
+
REQUEST_MALFORMED = 2;
|
|
1199
|
+
PROMPT_UNAVAILABLE = 3;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
optional Status status = 1 [default = OK];
|
|
1203
|
+
|
|
1204
|
+
optional CoordRange prompt_range = 2;
|
|
1205
|
+
optional CoordRange command_range = 3;
|
|
1206
|
+
optional CoordRange output_range = 4;
|
|
1207
|
+
|
|
1208
|
+
optional string working_directory = 5;
|
|
1209
|
+
optional string command = 6;
|
|
1210
|
+
|
|
1211
|
+
enum State {
|
|
1212
|
+
EDITING = 0; // Command hasn't been started yet
|
|
1213
|
+
RUNNING = 1; // Command is currently running
|
|
1214
|
+
FINISHED = 2; // Command has finished.
|
|
1215
|
+
}
|
|
1216
|
+
optional State prompt_state = 7;
|
|
1217
|
+
|
|
1218
|
+
// Exit status. Equivalent to shell's $? variable. Only set if state is FINISHED.
|
|
1219
|
+
optional uint32 exit_status = 9;
|
|
1220
|
+
|
|
1221
|
+
optional string unique_prompt_id = 10;
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
message ListPromptsRequest {
|
|
1225
|
+
// Must name a specific session. "all" not allowed.
|
|
1226
|
+
optional string session = 1;
|
|
1227
|
+
|
|
1228
|
+
// If unspecified, start at oldest.
|
|
1229
|
+
optional string first_unique_id = 2;
|
|
1230
|
+
// If unspecified, end at newest.
|
|
1231
|
+
optional string last_unique_id = 3;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
message ListPromptsResponse {
|
|
1235
|
+
enum Status {
|
|
1236
|
+
OK = 0;
|
|
1237
|
+
SESSION_NOT_FOUND = 1;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
optional Status status = 1 [default = OK];
|
|
1241
|
+
|
|
1242
|
+
// Chronological list of prompt IDs, suitable for GetPromptRequest.unique_prompt_id.
|
|
1243
|
+
repeated string unique_prompt_id = 2;
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
message GetProfilePropertyRequest {
|
|
1247
|
+
// See documentation on session IDs
|
|
1248
|
+
optional string session = 1;
|
|
1249
|
+
|
|
1250
|
+
// If not set, all properties will be returned
|
|
1251
|
+
repeated string keys = 2;
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
message ProfileProperty {
|
|
1255
|
+
optional string key = 1;
|
|
1256
|
+
optional string json_value = 2;
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
message GetProfilePropertyResponse {
|
|
1260
|
+
enum Status {
|
|
1261
|
+
OK = 0;
|
|
1262
|
+
SESSION_NOT_FOUND = 1;
|
|
1263
|
+
REQUEST_MALFORMED = 2;
|
|
1264
|
+
ERROR = 3;
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
optional Status status = 1 [default = OK];
|
|
1268
|
+
|
|
1269
|
+
repeated ProfileProperty properties = 3;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
// Sets a value in a session's copy of the profile without modifying the underlying profile.
|
|
1273
|
+
message SetProfilePropertyRequest {
|
|
1274
|
+
message GuidList {
|
|
1275
|
+
repeated string guids = 1;
|
|
1276
|
+
}
|
|
1277
|
+
oneof target {
|
|
1278
|
+
// See documentation on session IDs
|
|
1279
|
+
string session = 1;
|
|
1280
|
+
GuidList guid_list = 2;
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
optional string key = 3; // deprecated
|
|
1284
|
+
optional string json_value = 4; // deprecated
|
|
1285
|
+
|
|
1286
|
+
message Assignment {
|
|
1287
|
+
optional string key = 1;
|
|
1288
|
+
optional string json_value = 2;
|
|
1289
|
+
}
|
|
1290
|
+
repeated Assignment assignments = 5;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
message SetProfilePropertyResponse {
|
|
1294
|
+
enum Status {
|
|
1295
|
+
OK = 0;
|
|
1296
|
+
SESSION_NOT_FOUND = 1;
|
|
1297
|
+
REQUEST_MALFORMED = 2;
|
|
1298
|
+
BAD_GUID = 3;
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
optional Status status = 1 [default = OK];
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
message TransactionRequest {
|
|
1305
|
+
// Set to true to begin a new transaction or false to end the current
|
|
1306
|
+
// transaction. The app's main loop will not advance while in a
|
|
1307
|
+
// transaction. This effectively freezes time. Keep transactions short.
|
|
1308
|
+
optional bool begin = 1;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
message TransactionResponse {
|
|
1312
|
+
enum Status {
|
|
1313
|
+
OK = 0;
|
|
1314
|
+
NO_TRANSACTION = 1;
|
|
1315
|
+
ALREADY_IN_TRANSACTION = 2;
|
|
1316
|
+
}
|
|
1317
|
+
optional Status status = 1 [default = OK];
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
// Describes a range of lines.
|
|
1321
|
+
message LineRange {
|
|
1322
|
+
// Only one of these fields should be set:
|
|
1323
|
+
// ---------------------------------------
|
|
1324
|
+
// Return just the current contents of the screen.
|
|
1325
|
+
optional bool screen_contents_only = 1;
|
|
1326
|
+
|
|
1327
|
+
// Return the last `trailing lines` of the buffer, which could go back into
|
|
1328
|
+
// scrollback history.
|
|
1329
|
+
optional int32 trailing_lines = 2;
|
|
1330
|
+
|
|
1331
|
+
optional WindowedCoordRange windowed_coord_range = 3;
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
// Describes a range of values.
|
|
1335
|
+
message Range {
|
|
1336
|
+
optional int64 location = 1;
|
|
1337
|
+
optional int64 length = 2;
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
// Describes a range of cells.
|
|
1341
|
+
// |..xxxxx|
|
|
1342
|
+
// |xxxx...|
|
|
1343
|
+
// In the example above, the range of x's is: {start: {x:2, y:0}, end: {x:4, y:1}}
|
|
1344
|
+
// The end coordinate is the first cell *after* the end of the range described (so an empty range
|
|
1345
|
+
// has start == end)
|
|
1346
|
+
message CoordRange {
|
|
1347
|
+
optional Coord start = 1;
|
|
1348
|
+
optional Coord end = 2;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
// Describes a cell's location.
|
|
1352
|
+
message Coord {
|
|
1353
|
+
optional int32 x = 1;
|
|
1354
|
+
// y=0 describes the first line. When the scrollback buffer is full and history is lost, the first
|
|
1355
|
+
// lines become unavailable, but the numbering is stable (so the Nth line is always the Nth line,
|
|
1356
|
+
// even if it's not the Nth *visible* line).
|
|
1357
|
+
optional int64 y = 2;
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
enum AlternateColor {
|
|
1361
|
+
DEFAULT = 0;
|
|
1362
|
+
REVERSED_DEFAULT = 3;
|
|
1363
|
+
SYSTEM_MESSAGE = 4;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
message RGBColor {
|
|
1367
|
+
optional uint32 red = 1;
|
|
1368
|
+
optional uint32 green = 2;
|
|
1369
|
+
optional uint32 blue = 3;
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
enum ImagePlaceholderType {
|
|
1373
|
+
NONE = 0;
|
|
1374
|
+
ITERM2 = 1;
|
|
1375
|
+
KITTY = 2;
|
|
1376
|
+
}
|
|
1377
|
+
|
|
1378
|
+
message URL {
|
|
1379
|
+
optional string url = 1;
|
|
1380
|
+
optional string identifier = 2;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
message CellStyle {
|
|
1384
|
+
oneof fgColor {
|
|
1385
|
+
uint32 fgStandard = 1;
|
|
1386
|
+
AlternateColor fgAlternate = 2;
|
|
1387
|
+
RGBColor fgRgb = 3;
|
|
1388
|
+
uint32 fgAlternatePlacementX = 4;
|
|
1389
|
+
}
|
|
1390
|
+
oneof bgColor {
|
|
1391
|
+
uint32 bgStandard = 5;
|
|
1392
|
+
AlternateColor bgAlternate = 6;
|
|
1393
|
+
RGBColor bgRgb = 7;
|
|
1394
|
+
uint32 bgAlternatePlacementY = 8;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
optional bool bold = 9;
|
|
1398
|
+
optional bool faint = 10;
|
|
1399
|
+
optional bool italic = 11;
|
|
1400
|
+
optional bool blink = 12;
|
|
1401
|
+
optional bool underline = 13;
|
|
1402
|
+
optional bool strikethrough = 14;
|
|
1403
|
+
optional bool invisible = 15;
|
|
1404
|
+
optional bool inverse = 16;
|
|
1405
|
+
optional bool guarded = 17;
|
|
1406
|
+
|
|
1407
|
+
optional ImagePlaceholderType image = 18;
|
|
1408
|
+
|
|
1409
|
+
// External attributes
|
|
1410
|
+
optional RGBColor underlineColor = 19;
|
|
1411
|
+
optional string blockID = 20;
|
|
1412
|
+
optional URL url = 21;
|
|
1413
|
+
|
|
1414
|
+
// Number of times this exact style repeats.
|
|
1415
|
+
optional uint32 repeats = 22;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
// Describes the content of a line.
|
|
1419
|
+
message LineContents {
|
|
1420
|
+
optional string text = 1;
|
|
1421
|
+
|
|
1422
|
+
// Some cells do not contain one code point. Use this to map code points in
|
|
1423
|
+
// `text` to a screen position. If the line has no uninitialized cells at its end, then the
|
|
1424
|
+
// sum of `repeats` equals the width of the display.
|
|
1425
|
+
//
|
|
1426
|
+
// For example, consider a line of text that appears on your display like:
|
|
1427
|
+
// xyz compañía
|
|
1428
|
+
//
|
|
1429
|
+
// The corresponding value of `text` would be:
|
|
1430
|
+
// xyzcompan~i'a
|
|
1431
|
+
// Note: ~ and ' are combining marks, but are shown uncombined for illustrative purposes.
|
|
1432
|
+
//
|
|
1433
|
+
// Each code point in "xyz" as well as each of the non-accented letters in compañía takes one
|
|
1434
|
+
// cell.
|
|
1435
|
+
//
|
|
1436
|
+
// The blank following 'z' is an uninitialized cell that has no code points,
|
|
1437
|
+
// so the z and the c in `text` are adjacent. It's unusual for these to occur in the middle
|
|
1438
|
+
// of a line, but it is possible.
|
|
1439
|
+
//
|
|
1440
|
+
// The ñ is composed of the letter n and a combining tilde (U+0303) (indicated in our example
|
|
1441
|
+
// as ~), while í is composed of the letter i and a combining acute accent (U+0301) (indicated in
|
|
1442
|
+
// our example as ').
|
|
1443
|
+
//
|
|
1444
|
+
// To map code points in `text` to screen positions, `code_points_per_cell`
|
|
1445
|
+
// provides the number of code points in each cell. In our example you would
|
|
1446
|
+
// get:
|
|
1447
|
+
//
|
|
1448
|
+
// num_code_points=1, repeats=3 // x, y, z
|
|
1449
|
+
// num_code_points=0, repeats=1 // uninitialized cell
|
|
1450
|
+
// num_code_points=1, repeats=5 // c, o, m, p, a
|
|
1451
|
+
// num_code_points=2, repeats=2 // n + combining tilde, i + combining acute accent
|
|
1452
|
+
// num_code_points=1, repeats=1 // a
|
|
1453
|
+
//
|
|
1454
|
+
// Lines usually end with a series of uninitialized cells. These are not included.
|
|
1455
|
+
//
|
|
1456
|
+
// Here is psuedocode to interpret code_points_per_cell:
|
|
1457
|
+
//
|
|
1458
|
+
// text_index_to_screen_coord = {}
|
|
1459
|
+
// screen_coord_to_text_index = {}
|
|
1460
|
+
// text_index = 0
|
|
1461
|
+
// screen_coord = 0
|
|
1462
|
+
// for cpps in code_points_per_cell:
|
|
1463
|
+
// repeat cpps.repeats times:
|
|
1464
|
+
// text_index_to_screen_coord[text_index] = screen_coord
|
|
1465
|
+
// screen_coord_to_text_index[screen_coord] = text_index
|
|
1466
|
+
// text_index += cpps.num_code_points
|
|
1467
|
+
// screen_coord += 1
|
|
1468
|
+
//
|
|
1469
|
+
// Cells with images are omitted.
|
|
1470
|
+
repeated CodePointsPerCell code_points_per_cell = 2;
|
|
1471
|
+
|
|
1472
|
+
// How does this line end?
|
|
1473
|
+
enum Continuation {
|
|
1474
|
+
// This line is not wrapped.
|
|
1475
|
+
CONTINUATION_HARD_EOL = 1;
|
|
1476
|
+
|
|
1477
|
+
// The next line is a continuation of this line.
|
|
1478
|
+
CONTINUATION_SOFT_EOL = 2;
|
|
1479
|
+
}
|
|
1480
|
+
optional Continuation continuation = 3 [default = CONTINUATION_HARD_EOL];
|
|
1481
|
+
|
|
1482
|
+
// This will be 1:1 with cells, but it is run-length encoded by its `repeats` field.
|
|
1483
|
+
repeated CellStyle style = 4;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
message CodePointsPerCell {
|
|
1487
|
+
// Number of code points per cell
|
|
1488
|
+
optional int32 num_code_points = 1 [default = 1];
|
|
1489
|
+
|
|
1490
|
+
// Number of adjacent cells with this number of code points (always one or more).
|
|
1491
|
+
optional int32 repeats = 2;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
message ListSessionsRequest {
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
message SendTextRequest {
|
|
1498
|
+
// See documentation on session IDs
|
|
1499
|
+
optional string session = 1;
|
|
1500
|
+
|
|
1501
|
+
// The text to send. As usual for proto buffers, this should be UTF-8
|
|
1502
|
+
// encoded. It will be converted to the session's encoding before being sent.
|
|
1503
|
+
optional string text = 2;
|
|
1504
|
+
|
|
1505
|
+
// If set, input will not be broadcast when broadcasting is on.
|
|
1506
|
+
optional bool suppress_broadcast = 3;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
message SendTextResponse {
|
|
1510
|
+
enum Status {
|
|
1511
|
+
OK = 0;
|
|
1512
|
+
SESSION_NOT_FOUND = 1;
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
optional Status status = 1;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
message Size {
|
|
1519
|
+
optional int32 width = 1;
|
|
1520
|
+
optional int32 height = 2;
|
|
1521
|
+
}
|
|
1522
|
+
|
|
1523
|
+
message Point {
|
|
1524
|
+
optional int32 x = 1;
|
|
1525
|
+
optional int32 y = 2;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
message Frame {
|
|
1529
|
+
optional Point origin = 1;
|
|
1530
|
+
optional Size size = 2;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
message SessionSummary {
|
|
1534
|
+
optional string unique_identifier = 1;
|
|
1535
|
+
optional Frame frame = 2; // will not be set for buried sessions
|
|
1536
|
+
optional Size grid_size = 3; // will not be set for buried sessions
|
|
1537
|
+
optional string title = 4;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
message SplitTreeNode {
|
|
1541
|
+
optional bool vertical = 1; // Direction of split pane divider
|
|
1542
|
+
repeated SplitTreeLink links = 2; // Links to children
|
|
1543
|
+
|
|
1544
|
+
message SplitTreeLink {
|
|
1545
|
+
oneof child {
|
|
1546
|
+
SessionSummary session = 1;
|
|
1547
|
+
SplitTreeNode node = 2;
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
|
|
1552
|
+
message ListSessionsResponse {
|
|
1553
|
+
message Window {
|
|
1554
|
+
repeated Tab tabs = 1;
|
|
1555
|
+
optional string window_id = 2;
|
|
1556
|
+
optional Frame frame = 3;
|
|
1557
|
+
optional int32 number = 4;
|
|
1558
|
+
}
|
|
1559
|
+
message Tab {
|
|
1560
|
+
optional SplitTreeNode root = 3;
|
|
1561
|
+
optional string tab_id = 2;
|
|
1562
|
+
optional string tmux_window_id = 4;
|
|
1563
|
+
optional string tmux_connection_id = 5;
|
|
1564
|
+
repeated SessionSummary minimized_sessions = 6;
|
|
1565
|
+
}
|
|
1566
|
+
repeated Window windows = 1;
|
|
1567
|
+
repeated SessionSummary buried_sessions = 2;
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
message CreateTabRequest {
|
|
1571
|
+
// Leave unset to use the default profile.
|
|
1572
|
+
optional string profile_name = 1;
|
|
1573
|
+
|
|
1574
|
+
// Leave unset to create the tab in a new window.
|
|
1575
|
+
optional string window_id = 2;
|
|
1576
|
+
|
|
1577
|
+
// Valid to set only if window_id is set. Gives the desired index of the new tab.
|
|
1578
|
+
optional uint32 tab_index = 3;
|
|
1579
|
+
|
|
1580
|
+
// If not set, the profile's command will be used. Use custom_profile_properties instead.
|
|
1581
|
+
optional string command = 4 [deprecated=true];
|
|
1582
|
+
|
|
1583
|
+
// Modifies the profile to customize its behavior just for this session.
|
|
1584
|
+
repeated ProfileProperty custom_profile_properties = 5;
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
message CreateTabResponse {
|
|
1588
|
+
enum Status {
|
|
1589
|
+
OK = 0;
|
|
1590
|
+
INVALID_PROFILE_NAME = 1;
|
|
1591
|
+
INVALID_WINDOW_ID = 2;
|
|
1592
|
+
// The tab is still created, just not with the desired index.
|
|
1593
|
+
INVALID_TAB_INDEX = 3;
|
|
1594
|
+
// A $$VAR$$ substitution was not provided by the user.
|
|
1595
|
+
MISSING_SUBSTITUTION = 4;
|
|
1596
|
+
}
|
|
1597
|
+
optional Status status = 1;
|
|
1598
|
+
optional string window_id = 2;
|
|
1599
|
+
optional int32 tab_id = 3;
|
|
1600
|
+
optional string session_id = 4;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
message SplitPaneRequest {
|
|
1604
|
+
// See documentation on session IDs
|
|
1605
|
+
optional string session = 1;
|
|
1606
|
+
|
|
1607
|
+
enum SplitDirection {
|
|
1608
|
+
VERTICAL = 0;
|
|
1609
|
+
HORIZONTAL = 1;
|
|
1610
|
+
}
|
|
1611
|
+
optional SplitDirection split_direction = 2;
|
|
1612
|
+
|
|
1613
|
+
// If true, new session is above/left of the session being split. Otherwise, it goes below/right.
|
|
1614
|
+
optional bool before = 3 [default=false];
|
|
1615
|
+
|
|
1616
|
+
// Leave unset to use the default profile.
|
|
1617
|
+
optional string profile_name = 4;
|
|
1618
|
+
|
|
1619
|
+
// Modifies the profile to customize its behavior just for this session.
|
|
1620
|
+
repeated ProfileProperty custom_profile_properties = 5;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
message SplitPaneResponse {
|
|
1624
|
+
enum Status {
|
|
1625
|
+
OK = 0;
|
|
1626
|
+
SESSION_NOT_FOUND = 1;
|
|
1627
|
+
INVALID_PROFILE_NAME = 2;
|
|
1628
|
+
// This can happen if the session to be split is too small. If splitting multiple sessions and
|
|
1629
|
+
// one or more cannot be split, the status will be set to CANNOT_SPLIT, even if some did succeed
|
|
1630
|
+
// (in which case there will be one or more session_id's).
|
|
1631
|
+
CANNOT_SPLIT = 3;
|
|
1632
|
+
// Couldn't decode JSON
|
|
1633
|
+
MALFORMED_CUSTOM_PROFILE_PROPERTY = 4;
|
|
1634
|
+
}
|
|
1635
|
+
optional Status status = 1;
|
|
1636
|
+
|
|
1637
|
+
// TODO(gln): this will not be set for tmux integration because the split happens only if/when the
|
|
1638
|
+
// tmux server acts on the request.
|
|
1639
|
+
// See documentation on session IDs.
|
|
1640
|
+
// If more than one session was split, there will be multiple session_id's.
|
|
1641
|
+
repeated string session_id = 2;
|
|
1642
|
+
}
|