zellij-utils 0.44.2

A utility library for Zellij client and server
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
syntax = "proto3";

import "action.proto";
import "event.proto";
import "file.proto";
import "command.proto";
import "message.proto";
import "resize.proto";
import "plugin_permission.proto";
import "input_mode.proto";
import "key.proto";

package api.plugin_command;

enum CommandName {
  Subscribe = 0;
  Unsubscribe = 1;
  SetSelectable = 2;
  GetPluginIds = 3;
  GetZellijVersion = 4;
  OpenFile = 5;
  OpenFileFloating = 6;
  OpenTerminal = 7;
  OpenTerminalFloating = 8;
  OpenCommandPane = 9;
  OpenCommandPaneFloating = 10;
  SwitchTabTo = 11;
  SetTimeout = 12;
  ExecCmd = 13;
  PostMessageTo = 14;
  PostMessageToPlugin = 15;
  HideSelf = 16;
  ShowSelf = 17;
  SwitchToMode = 18;
  NewTabsWithLayout = 19;
  NewTab = 20;
  GoToNextTab = 21;
  GoToPreviousTab = 22;
  Resize = 23;
  ResizeWithDirection = 24;
  FocusNextPane = 25;
  FocusPreviousPane = 26;
  MoveFocus = 27;
  MoveFocusOrTab = 28;
  Detach = 29;
  EditScrollback = 30;
  Write = 31;
  WriteChars = 32;
  ToggleTab = 33;
  MovePane = 34;
  MovePaneWithDirection = 35;
  ClearScreen = 36;
  ScrollUp = 37;
  ScrollDown = 38;
  ScrollToTop = 39;
  ScrollToBottom = 40;
  PageScrollUp = 41;
  PageScrollDown = 42;
  ToggleFocusFullscreen = 43;
  TogglePaneFrames = 44;
  TogglePaneEmbedOrEject = 45;
  UndoRenamePane = 46;
  CloseFocus = 47;
  ToggleActiveTabSync = 48;
  CloseFocusedTab = 49;
  UndoRenameTab = 50;
  QuitZellij = 51;
  PreviousSwapLayout = 52;
  NextSwapLayout = 53;
  GoToTabName = 54;
  FocusOrCreateTab = 55;
  GoToTab = 56;
  StartOrReloadPlugin = 57;
  CloseTerminalPane = 58;
  ClosePluginPane = 59;
  FocusTerminalPane = 60;
  FocusPluginPane = 61;
  RenameTerminalPane = 62;
  RenamePluginPane = 63;
  RenameTab = 64;
  ReportCrash = 65;
  RequestPluginPermissions = 66;
  SwitchSession = 67;
  OpenTerminalInPlace = 68;
  OpenCommandInPlace = 69;
  OpenFileInPlace = 70;
  RunCommand = 71;
  WebRequest = 72;
  DeleteDeadSession = 73;
  DeleteAllDeadSessions = 74;
  RenameSession = 75;
  UnblockCliPipeInput = 76;
  BlockCliPipeInput = 77;
  CliPipeOutput = 78;
  MessageToPlugin = 79;
  DisconnectOtherClients = 80;
  KillSessions = 81;
  ScanHostFolder = 82;
  WatchFilesystem = 83;
  DumpSessionLayout = 84;
  CloseSelf = 85;
  NewTabsWithLayoutInfo = 86;
  Reconfigure = 87;
  HidePaneWithId = 88;
  ShowPaneWithId = 89;
  OpenCommandPaneBackground = 90;
  RerunCommandPane = 91;
  ResizePaneIdWithDirection = 92;
  EditScrollbackForPaneWithId = 93;
  WriteToPaneId = 94;
  WriteCharsToPaneId = 95;
  MovePaneWithPaneId = 96;
  MovePaneWithPaneIdInDirection = 97;
  ClearScreenForPaneId = 98;
  ScrollUpInPaneId = 99;
  ScrollDownInPaneId = 100;
  ScrollToTopInPaneId = 101;
  ScrollToBottomInPaneId = 102;
  PageScrollUpInPaneId = 103;
  PageScrollDownInPaneId = 104;
  TogglePaneIdFullscreen = 105;
  TogglePaneEmbedOrEjectForPaneId = 106;
  CloseTabWithIndex = 107;
  BreakPanesToNewTab = 108;
  BreakPanesToTabWithIndex = 109;
  ReloadPlugin = 110;
  LoadNewPlugin = 111;
  RebindKeys = 112;
  ListClients = 113;
  ChangeHostFolder = 114;
  SetFloatingPanePinned = 115;
  StackPanes = 116;
  ChangeFloatingPanesCoordinates = 117;
  OpenCommandPaneNearPlugin = 118;
  OpenTerminalNearPlugin = 119;
  OpenTerminalFloatingNearPlugin = 120;
  OpenTerminalInPlaceOfPlugin = 121;
  OpenCommandPaneFloatingNearPlugin = 122;
  OpenCommandPaneInPlaceOfPlugin = 123;
  OpenFileNearPlugin = 124;
  OpenFileFloatingNearPlugin = 125;
  OpenFileInPlaceOfPlugin = 126;
  StartWebServer = 127;
  GroupAndUngroupPanes = 128;
  HighlightAndUnhighlightPanes = 129;
  CloseMultiplePanes = 130;
  FloatMultiplePanes = 131;
  EmbedMultiplePanes = 132;
  ShareCurrentSession = 133;
  StopSharingCurrentSession = 134;
  StopWebServer = 135;
  QueryWebServerStatus = 136;
  SetSelfMouseSelectionSupport = 137;
  GenerateWebLoginToken = 138;
  RevokeWebLoginToken = 139;
  ListWebLoginTokens = 140;
  RevokeAllWebLoginTokens = 141;
  RenameWebLoginToken = 142;
  InterceptKeyPresses = 143;
  ClearKeyPressesIntercepts = 144;
  ReplacePaneWithExistingPane = 155;
  GetPaneScrollback = 163;
  RunAction = 164;
  ShowCursor = 169;
  CopyToClipboard = 170;
  SendSigintToPaneId = 171;
  SendSigkillToPaneId = 172;
  GetPanePid = 173;
  OverrideLayout = 174;
  SaveLayout = 175;
  DeleteLayout = 176;
  EditLayout = 177;
  GenerateRandomName = 178;
  DumpLayout = 179;
  ParseLayout = 180;
  RenameLayout = 181;
  GetLayoutDir = 182;
  GetFocusedPaneInfo = 183;
  TogglePaneBorderless = 184;
  SetPaneBorderless = 185;
  SaveSession = 186;
  CurrentSessionLastSavedTime = 187;
  GetPaneInfo = 188;
  GetTabInfo = 189;
  GetPaneRunningCommand = 190;
  GetPaneCwd = 191;
  SwitchTabToId = 192;
  GoToTabWithId = 193;
  CloseTabWithId = 194;
  RenameTabWithId = 195;
  BreakPanesToTabWithId = 196;
  GetSessionEnvironmentVariables = 197;
  OpenCommandPaneInNewTab = 198;
  OpenPluginPaneInNewTab = 199;
  OpenEditorPaneInNewTab = 200;
  OpenCommandPaneInPlaceOfPaneId = 201;
  OpenTerminalPaneInPlaceOfPaneId = 202;
  OpenEditPaneInPlaceOfPaneId = 203;
  HideFloatingPanes = 204;
  ShowFloatingPanes = 205;
  SetPaneColor = 206;
  SetPaneRegexHighlights = 207;
  ClearPaneHighlights = 208;
  OpenPluginPaneFloating = 209;
  ListWindowsVolumes = 210;
  GetSessionList = 211;
}

message PluginCommand {
  CommandName name = 1;
  oneof payload {
    SubscribePayload subscribe_payload = 2;
    UnsubscribePayload unsubscribe_payload = 3;
    bool set_selectable_payload = 4;
    OpenFilePayload open_file_payload = 5;
    OpenFilePayload open_file_floating_payload = 6;
    OpenFilePayload open_terminal_payload = 7;
    OpenFilePayload open_terminal_floating_payload = 8;
    OpenCommandPanePayload open_command_pane_payload = 9;
    OpenCommandPanePayload open_command_pane_floating_payload = 10;
    SwitchTabToPayload switch_tab_to_payload = 11;
    SetTimeoutPayload set_timeout_payload = 12;
    ExecCmdPayload exec_cmd_payload = 13;
    PluginMessagePayload post_message_to_payload = 14;
    PluginMessagePayload post_message_to_plugin_payload = 15;
    bool show_self_payload = 16;
    action.SwitchToModePayload switch_to_mode_payload = 17;
    string new_tabs_with_layout_payload = 18;
    ResizePayload resize_payload = 19;
    ResizePayload resize_with_direction_payload = 20;
    MovePayload move_focus_payload = 21;
    MovePayload move_focus_or_tab_payload = 22;
    bytes write_payload = 23;
    string write_chars_payload = 24;
    MovePayload move_pane_with_direction_payload = 25;
    string go_to_tab_name_payload = 26;
    string focus_or_create_tab_payload = 27;
    uint32 go_to_tab_payload = 28;
    string start_or_reload_plugin_payload = 29;
    uint32 close_terminal_pane_payload = 30;
    uint32 close_plugin_pane_payload = 31;
    action.PaneIdAndShouldFloat focus_terminal_pane_payload = 32;
    action.PaneIdAndShouldFloat focus_plugin_pane_payload = 33;
    IdAndNewName rename_terminal_pane_payload = 34;
    IdAndNewName rename_plugin_pane_payload = 35;
    IdAndNewName rename_tab_payload = 36;
    string report_crash_payload = 37;
    RequestPluginPermissionPayload request_plugin_permission_payload = 38;
    SwitchSessionPayload switch_session_payload = 39;
    OpenFilePayload open_file_in_place_payload = 40;
    OpenFilePayload open_terminal_in_place_payload = 41;
    OpenCommandPanePayload open_command_pane_in_place_payload = 42;
    RunCommandPayload run_command_payload = 43;
    WebRequestPayload web_request_payload = 44;
    string delete_dead_session_payload = 45;
    string rename_session_payload = 46;
    string unblock_cli_pipe_input_payload = 47;
    string block_cli_pipe_input_payload = 48;
    CliPipeOutputPayload cli_pipe_output_payload = 49;
    MessageToPluginPayload message_to_plugin_payload = 50;
    KillSessionsPayload kill_sessions_payload = 60;
    string scan_host_folder_payload = 61;
    NewTabsWithLayoutInfoPayload new_tabs_with_layout_info_payload = 62;
    ReconfigurePayload reconfigure_payload = 63;
    HidePaneWithIdPayload hide_pane_with_id_payload = 64;
    ShowPaneWithIdPayload show_pane_with_id_payload = 65;
    OpenCommandPanePayload open_command_pane_background_payload = 66;
    RerunCommandPanePayload rerun_command_pane_payload = 67;
    ResizePaneIdWithDirectionPayload resize_pane_id_with_direction_payload = 68;
    EditScrollbackForPaneWithIdPayload edit_scrollback_for_pane_with_id_payload = 69;
    WriteToPaneIdPayload write_to_pane_id_payload = 70;
    WriteCharsToPaneIdPayload write_chars_to_pane_id_payload = 71;
    MovePaneWithPaneIdPayload move_pane_with_pane_id_payload = 72;
    MovePaneWithPaneIdInDirectionPayload move_pane_with_pane_id_in_direction_payload = 73;
    ClearScreenForPaneIdPayload clear_screen_for_pane_id_payload = 74;
    ScrollUpInPaneIdPayload scroll_up_in_pane_id_payload = 75;
    ScrollDownInPaneIdPayload scroll_down_in_pane_id_payload = 76;
    ScrollToTopInPaneIdPayload scroll_to_top_in_pane_id_payload = 77;
    ScrollToBottomInPaneIdPayload scroll_to_bottom_in_pane_id_payload = 78;
    PageScrollUpInPaneIdPayload page_scroll_up_in_pane_id_payload = 79;
    PageScrollDownInPaneIdPayload page_scroll_down_in_pane_id_payload = 80;
    TogglePaneIdFullscreenPayload toggle_pane_id_fullscreen_payload = 81;
    TogglePaneEmbedOrEjectForPaneIdPayload toggle_pane_embed_or_eject_for_pane_id_payload = 82;
    CloseTabWithIndexPayload close_tab_with_index_payload = 83;
    BreakPanesToNewTabPayload break_panes_to_new_tab_payload = 84;
    BreakPanesToTabWithIndexPayload break_panes_to_tab_with_index_payload = 85;
    ReloadPluginPayload reload_plugin_payload = 86;
    LoadNewPluginPayload load_new_plugin_payload = 87;
    RebindKeysPayload rebind_keys_payload = 88;
    ChangeHostFolderPayload change_host_folder_payload = 89;
    SetFloatingPanePinnedPayload set_floating_pane_pinned_payload = 90;
    StackPanesPayload stack_panes_payload = 91;
    ChangeFloatingPanesCoordinatesPayload change_floating_panes_coordinates_payload = 92;
    OpenCommandPaneNearPluginPayload open_command_pane_near_plugin_payload = 93;
    OpenTerminalNearPluginPayload open_terminal_near_plugin_payload = 94;
    OpenTerminalFloatingNearPluginPayload open_terminal_floating_near_plugin_payload = 95;
    OpenTerminalInPlaceOfPluginPayload open_terminal_in_place_of_plugin_payload = 96;
    OpenCommandPaneFloatingNearPluginPayload open_command_pane_floating_near_plugin_payload = 97;
    OpenCommandPaneInPlaceOfPluginPayload open_command_pane_in_place_of_plugin_payload = 98;
    OpenFileNearPluginPayload open_file_near_plugin_payload = 99;
    OpenFileFloatingNearPluginPayload open_file_floating_near_plugin_payload = 100;
    OpenFileInPlaceOfPluginPayload open_file_in_place_of_plugin_payload = 101;
    GroupAndUngroupPanesPayload group_and_ungroup_panes_payload = 102;
    HighlightAndUnhighlightPanesPayload highlight_and_unhighlight_panes_payload = 103;
    CloseMultiplePanesPayload close_multiple_panes_payload = 104;
    FloatMultiplePanesPayload float_multiple_panes_payload = 105;
    EmbedMultiplePanesPayload embed_multiple_panes_payload = 106;
    SetSelfMouseSelectionSupportPayload set_self_mouse_selection_support_payload = 107;
    GenerateWebLoginTokenPayload generate_web_login_token_payload = 108;
    RevokeWebLoginTokenPayload revoke_web_login_token_payload = 109;
    RenameWebLoginTokenPayload rename_web_login_token_payload = 110;
    ReplacePaneWithExistingPanePayload replace_pane_with_existing_pane_payload = 111;
    NewTabPayload new_tab_payload = 112;
    GetPaneScrollbackPayload get_pane_scrollback_payload = 113;
    RunActionPayload run_action_payload = 114;
    ShowCursorPayload show_cursor_payload = 119;
    CopyToClipboardPayload copy_to_clipboard_payload = 120;
    PaneId send_sigint_to_pane_id_payload = 121;
    PaneId send_sigkill_to_pane_id_payload = 122;
    GetPanePidPayload get_pane_pid_payload = 123;
    OverrideLayoutPayload override_layout_payload = 124;
    SaveLayoutPayload save_layout_payload = 125;
    DeleteLayoutPayload delete_layout_payload = 126;
    EditLayoutPayload edit_layout_payload = 127;
    GenerateRandomNamePayload generate_random_name_payload = 128;
    DumpLayoutPayload dump_layout_payload = 129;
    ParseLayoutPayload parse_layout_payload = 130;
    RenameLayoutPayload rename_layout_payload = 131;
    GetLayoutDirPayload get_layout_dir_payload = 132;
    DumpSessionLayoutPayload dump_session_layout_payload = 133;
    GetFocusedPaneInfoPayload get_focused_pane_info_payload = 134;
    TogglePaneBorderlessPayload toggle_pane_borderless_payload = 135;
    SetPaneBorderlessPayload set_pane_borderless_payload = 136;
    SaveSessionPayload save_session_payload = 137;
    CurrentSessionLastSavedTimePayload current_session_last_saved_time_payload = 138;
    GetPaneInfoPayload get_pane_info_payload = 139;
    GetTabInfoPayload get_tab_info_payload = 140;
    GetPaneRunningCommandPayload get_pane_running_command_payload = 141;
    GetPaneCwdPayload get_pane_cwd_payload = 142;
    SwitchTabToIdPayload switch_tab_to_id_payload = 143;
    GoToTabWithIdPayload go_to_tab_with_id_payload = 144;
    CloseTabWithIdPayload close_tab_with_id_payload = 145;
    RenameTabWithIdPayload rename_tab_with_id_payload = 146;
    BreakPanesToTabWithIdPayload break_panes_to_tab_with_id_payload = 147;
    GetSessionEnvironmentVariablesPayload get_session_environment_variables_payload = 148;
    OpenCommandPanePayload open_command_pane_in_new_tab_payload = 149;
    OpenPluginPaneInNewTabPayload open_plugin_pane_in_new_tab_payload = 150;
    OpenFilePayload open_editor_pane_in_new_tab_payload = 151;
    OpenCommandPaneInPlaceOfPaneIdPayload open_command_pane_in_place_of_pane_id_payload = 152;
    OpenTerminalPaneInPlaceOfPaneIdPayload open_terminal_pane_in_place_of_pane_id_payload = 153;
    OpenEditPaneInPlaceOfPaneIdPayload open_edit_pane_in_place_of_pane_id_payload = 154;
    HideFloatingPanesPayload hide_floating_panes_payload = 155;
    ShowFloatingPanesPayload show_floating_panes_payload = 156;
    SetPaneColorPayload set_pane_color_payload = 157;
    SetPaneRegexHighlightsPayload set_pane_regex_highlights_payload = 158;
    ClearPaneHighlightsPayload clear_pane_highlights_payload = 159;
    OpenPluginPaneFloatingPayload open_plugin_pane_floating_payload = 160;
    GetSessionListPayload get_session_list_payload = 161;
  }
}

message NewTabPayload {
  optional string name = 1;
  optional string cwd = 2;
}

message DumpSessionLayoutPayload {
  optional uint32 tab_index = 1;
}

message RunActionPayload {
  action.Action action = 1;
  repeated ContextItem context = 2;
}

message ReplacePaneWithExistingPanePayload {
  PaneId pane_id_to_replace = 1;
  PaneId existing_pane_id = 2;
  bool suppress_replaced_pane = 3;
}

message RenameWebLoginTokenPayload {
  string old_name = 1;
  string new_name = 2;
}

message RevokeWebLoginTokenPayload {
  string token_label = 1;
}

message GenerateWebLoginTokenPayload {
  optional string token_label = 1;
  optional bool read_only = 2;
}

message SetSelfMouseSelectionSupportPayload {
  bool support_mouse_selection = 1;
}

message EmbedMultiplePanesPayload {
  repeated PaneId pane_ids = 1;
}

message FloatMultiplePanesPayload {
  repeated PaneId pane_ids = 1;
}

message CloseMultiplePanesPayload {
  repeated PaneId pane_ids = 1;
}

message HighlightAndUnhighlightPanesPayload {
  repeated PaneId pane_ids_to_highlight = 1;
  repeated PaneId pane_ids_to_unhighlight = 2;
}

message GroupAndUngroupPanesPayload {
  repeated PaneId pane_ids_to_group = 1;
  repeated PaneId pane_ids_to_ungroup = 2;
  bool for_all_clients = 3;
}

message OpenFileInPlaceOfPluginPayload {
  file.File file_to_open = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
  bool close_plugin_after_replace = 4;
}

message OpenFileFloatingNearPluginPayload {
  file.File file_to_open = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message OpenFileNearPluginPayload {
  file.File file_to_open = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message OpenCommandPaneInPlaceOfPluginPayload {
  command.Command command_to_run = 1;
  repeated ContextItem context = 3;
  bool close_plugin_after_replace = 4;
}

message OpenCommandPaneFloatingNearPluginPayload {
  command.Command command_to_run = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message OpenTerminalInPlaceOfPluginPayload {
  file.File file_to_open = 1;
  repeated ContextItem context = 3;
  bool close_plugin_after_replace = 4;
}

message OpenTerminalFloatingNearPluginPayload {
  file.File file_to_open = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message OpenTerminalNearPluginPayload {
  file.File file_to_open = 1;
  repeated ContextItem context = 3;
}

message OpenCommandPaneNearPluginPayload {
  command.Command command_to_run = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message ChangeFloatingPanesCoordinatesPayload {
  repeated PaneIdAndFloatingPaneCoordinates pane_ids_and_floating_panes_coordinates = 1;
}

message StackPanesPayload {
  repeated PaneId pane_ids = 1;
}

message SetFloatingPanePinnedPayload {
  PaneId pane_id = 1;
  bool should_be_pinned = 2;
}

message TogglePaneBorderlessPayload {
  PaneId pane_id = 1;
}

message SetPaneBorderlessPayload {
  PaneId pane_id = 1;
  bool borderless = 2;
}

message ChangeHostFolderPayload {
  string new_host_folder = 1;
}

message RebindKeysPayload {
  repeated KeyToRebind keys_to_rebind = 1;
  repeated KeyToUnbind keys_to_unbind = 2;
  bool write_config_to_disk = 3;
}

message KeyToRebind {
  input_mode.InputMode input_mode = 1;
  key.Key key = 2;
  repeated action.Action actions = 3;
}

message KeyToUnbind {
  input_mode.InputMode input_mode = 1;
  key.Key key = 2;
}

message LoadNewPluginPayload {
  string plugin_url = 1;
  repeated ContextItem plugin_config = 2;
  bool should_load_plugin_in_background = 3;
  bool should_skip_plugin_cache = 4;
}

message ReloadPluginPayload {
  uint32 plugin_id = 1;
}

message BreakPanesToTabWithIndexPayload {
  repeated PaneId pane_ids = 1;
  uint32 tab_index = 2;
  bool should_change_focus_to_target_tab = 3;
}

message BreakPanesToNewTabPayload {
  repeated PaneId pane_ids = 1;
  bool should_change_focus_to_new_tab = 2;
  optional string new_tab_name = 3;
}

message MovePaneWithPaneIdPayload {
  PaneId pane_id = 1;
}

message MovePaneWithPaneIdInDirectionPayload {
  PaneId pane_id = 1;
  resize.MoveDirection direction = 2;
}

message ClearScreenForPaneIdPayload {
  PaneId pane_id = 1;
}

message ScrollUpInPaneIdPayload {
  PaneId pane_id = 1;
}

message ScrollDownInPaneIdPayload {
  PaneId pane_id = 1;
}

message ScrollToTopInPaneIdPayload {
  PaneId pane_id = 1;
}

message ScrollToBottomInPaneIdPayload {
  PaneId pane_id = 1;
}

message PageScrollUpInPaneIdPayload {
  PaneId pane_id = 1;
}

message PageScrollDownInPaneIdPayload {
  PaneId pane_id = 1;
}

message TogglePaneIdFullscreenPayload {
  PaneId pane_id = 1;
}

message TogglePaneEmbedOrEjectForPaneIdPayload {
  PaneId pane_id = 1;
}

message CloseTabWithIndexPayload {
  uint32 tab_index = 1;
}

message WriteCharsToPaneIdPayload {
  string chars_to_write = 1;
  PaneId pane_id = 2;
}

message WriteToPaneIdPayload {
  bytes bytes_to_write = 1;
  PaneId pane_id = 2;
}

message EditScrollbackForPaneWithIdPayload {
  PaneId pane_id = 1;
}

message ResizePaneIdWithDirectionPayload {
  resize.Resize resize = 1;
  PaneId pane_id = 2;
}

message ReconfigurePayload {
  string config = 1;
  bool write_to_disk = 2;
}

message RerunCommandPanePayload {
  uint32 terminal_pane_id = 1;
}

message HidePaneWithIdPayload {
  PaneId pane_id = 1;
}

message ShowPaneWithIdPayload {
  PaneId pane_id = 1;
  bool should_float_if_hidden = 2;
  bool should_focus_pane = 3;
}

message NewTabsWithLayoutInfoPayload {
  event.LayoutInfo layout_info = 1;
}

message KillSessionsPayload {
  repeated string session_names = 1;
}

message CliPipeOutputPayload {
  string pipe_name = 1;
  string output = 2;
}

message MessageToPluginPayload {
  optional string plugin_url = 1;
  repeated ContextItem plugin_config = 2;
  string message_name = 3;
  optional string message_payload = 4;
  repeated ContextItem message_args = 5;
  optional NewPluginArgs new_plugin_args = 6;
  optional uint32 destination_plugin_id = 7;
  optional FloatingPaneCoordinates floating_pane_coordinates = 8;
}

message NewPluginArgs {
    optional bool should_float = 1;
    optional PaneId pane_id_to_replace = 2;
    optional string pane_title = 3;
    optional string cwd = 4;
    bool skip_cache = 5;
    optional bool should_focus = 6;
}

message PaneId {
  PaneType pane_type = 1;
  uint32 id = 2;
}

enum PaneType {
  Terminal = 0;
  Plugin = 1;
}

message SwitchSessionPayload {
  optional string name = 1;
  optional uint32 tab_position = 2;
  optional uint32 pane_id = 3;
  optional bool pane_id_is_plugin = 4;
  optional event.LayoutInfo layout = 5;
  optional string cwd = 6;
}

message RequestPluginPermissionPayload {
  repeated plugin_permission.PermissionType permissions = 1;
}

message SubscribePayload {
  event.EventNameList subscriptions = 1;
}

message UnsubscribePayload {
  event.EventNameList subscriptions = 1;
}

message OpenFilePayload {
  file.File file_to_open = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message OpenCommandPanePayload {
  command.Command command_to_run = 1;
  optional FloatingPaneCoordinates floating_pane_coordinates = 2;
  repeated ContextItem context = 3;
}

message SwitchTabToPayload {
  uint32 tab_index = 1;
}

message SetTimeoutPayload {
  double seconds = 1;
}

message ExecCmdPayload {
  repeated string command_line = 1;
}

message RunCommandPayload {
  repeated string command_line = 1;
  repeated EnvVariable env_variables = 2;
  string cwd = 3;
  repeated ContextItem context = 4;
}

message WebRequestPayload {
  string url = 1;
  HttpVerb verb = 2;
  repeated event.Header headers = 3;
  bytes body = 4;
  repeated ContextItem context = 5;
}

enum HttpVerb {
  Get = 0;
  Post = 1;
  Put = 2;
  Delete = 3;
}

message EnvVariable {
  string name = 1;
  string value = 2;
}

message ContextItem {
  string name = 1;
  string value = 2;
}

message PluginMessagePayload {
  api.message.Message message = 1;
}

message ResizePayload {
  resize.Resize resize = 1;
}

message MovePayload {
  resize.MoveDirection direction = 1;
}

message PaneIdAndFloatingPaneCoordinates {
  PaneId pane_id = 1;
  FloatingPaneCoordinates floating_pane_coordinates = 2;
}

message IdAndNewName {
  uint32 id = 1; // pane id or tab index
  string new_name = 2;
}

message FloatingPaneCoordinates {
  optional FixedOrPercentValue x = 1;
  optional FixedOrPercentValue y = 2;
  optional FixedOrPercentValue width = 3;
  optional FixedOrPercentValue height = 4;
  optional bool pinned = 5;
  optional bool borderless = 6;
}

message FixedOrPercentValue {
  FixedOrPercent type = 1;
  uint32 value = 2;
}

enum FixedOrPercent {
  Fixed = 0;
  Percent = 1;
}

message SwitchTabToIdPayload {
  uint64 tab_id = 1;
}

message GoToTabWithIdPayload {
  uint64 tab_id = 1;
}

message CloseTabWithIdPayload {
  uint64 tab_id = 1;
}

message RenameTabWithIdPayload {
  uint64 tab_id = 1;
  string new_name = 2;
}

message BreakPanesToTabWithIdPayload {
  repeated PaneId pane_ids = 1;
  uint64 tab_id = 2;
  bool should_change_focus_to_target_tab = 3;
}

message BreakPanesToTabWithIdResponse {
  oneof result {
    uint64 tab_id = 1;
    bool none = 2;
  }
}

message CreateTokenResponse {
  optional string token = 1;
  optional string token_label = 2;
  optional string error = 3;
}

message RevokeTokenResponse {
  bool successfully_revoked = 1;
  optional string error = 2;
}

message ListTokensResponse {
  // tokens/creation_times/read_only_flags should be synchronized
  repeated string tokens = 1;
  repeated string creation_times = 2;
  repeated bool read_only_flags = 3;
  optional string error = 4;
}

message RevokeAllWebTokensResponse {
  bool successfully_revoked = 1;
  optional string error = 2;
}

message RenameWebTokenResponse {
  bool successfully_renamed = 1;
  optional string error = 2;
}

message GetPaneScrollbackPayload {
  PaneId pane_id = 1;
  bool get_full_scrollback = 2;
}

message ShowCursorPayload {
  optional CursorPosition position = 1;
}

message CursorPosition {
  uint32 x = 1;
  uint32 y = 2;
}

message CopyToClipboardPayload {
  string text = 1;
}

message GetPanePidPayload {
  PaneId pane_id = 1;
}

message GetPanePidResponse {
  oneof result {
    int32 pid = 1;
    string error = 2;
  }
}

message GetPaneRunningCommandPayload {
  PaneId pane_id = 1;
}

message GetPaneRunningCommandResponse {
  oneof result {
    RunningCommand command = 1;
    string error = 2;
  }
}

message RunningCommand {
  repeated string args = 1;
}

message GetPaneCwdPayload {
  PaneId pane_id = 1;
}

message GetPaneCwdResponse {
  oneof result {
    string cwd = 1;
    string error = 2;
  }
}

message SaveLayoutResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message DeleteLayoutResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message EditLayoutResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message GenerateRandomNameResponse {
  string name = 1;
}

message OverrideLayoutPayload {
  event.LayoutInfo layout_info = 1;
  repeated ContextItem context = 2;
  bool retain_existing_terminal_panes = 3;
  bool retain_existing_plugin_panes = 4;
  bool apply_only_to_active_tab = 5;
}

message SaveLayoutPayload {
  string layout_name = 1;
  string layout_kdl = 2;
  bool overwrite = 3;
}

message DeleteLayoutPayload {
  string layout_name = 1;
}

message EditLayoutPayload {
  string layout_name = 1;
  repeated ContextItem context = 2;
}

message GenerateRandomNamePayload {}

message DumpLayoutPayload {
  string layout_name = 1;
}

message DumpLayoutResponse {
  oneof result {
    string layout_content = 1;
    string error = 2;
  }
}

message DumpSessionLayoutResponse {
  oneof result {
    string layout_content = 1;
    string error = 2;
  }
  optional api.event.LayoutMetadata metadata = 3;
}

message ParseLayoutPayload {
  string layout_string = 1;
}

message ParseLayoutResponse {
  oneof result {
    api.event.LayoutMetadata metadata = 1;
    api.event.LayoutParsingError error = 2;
  }
}

message RenameLayoutPayload {
  string old_layout_name = 1;
  string new_layout_name = 2;
}

message RenameLayoutResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message GetLayoutDirPayload {}

message GetLayoutDirResponse {
  string layout_dir = 1;
}

message GetFocusedPaneInfoPayload {}

message GetFocusedPaneInfoResponse {
  oneof result {
    FocusedPaneInfo focused_pane_info = 1;
    string error = 2;
  }
}

message FocusedPaneInfo {
  uint32 focused_tab_index = 1;
  PaneId focused_pane_id = 2;
}

message SaveSessionPayload {}

message SaveSessionResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message CurrentSessionLastSavedTimePayload {}

message CurrentSessionLastSavedTimeResponse {
  optional uint64 timestamp_millis = 1; // None if never saved, otherwise milliseconds elapsed since last save
}

message GetPaneInfoPayload {
  PaneId pane_id = 1;
}

message GetPaneInfoResponse {
  optional event.PaneInfo pane_info = 1; // None if pane not found
}

message GetTabInfoPayload {
  uint64 tab_id = 1;
}

message GetTabInfoResponse {
  optional event.TabInfo tab_info = 1; // None if tab not found
}

message NewTabResponse {
  oneof result {
    uint64 tab_id = 1;
    bool none = 2;  // Indicates None
  }
}

message NewTabsResponse {
  repeated uint64 tab_ids = 1;  // Only includes successfully created tabs
}

message FocusOrCreateTabResponse {
  oneof result {
    uint64 tab_id = 1;
    bool none = 2;  // Indicates None
  }
}

message BreakPanesToNewTabResponse {
  oneof result {
    uint64 tab_id = 1;
    bool none = 2;  // Indicates None
  }
}

message BreakPanesToTabWithIndexResponse {
  oneof result {
    uint64 tab_id = 1;
    bool none = 2;  // Indicates None
  }
}

message OpenFileResponse {
  optional PaneId pane_id = 1;
}

message OpenFileFloatingResponse {
  optional PaneId pane_id = 1;
}

message OpenFileInPlaceResponse {
  optional PaneId pane_id = 1;
}

message OpenFileNearPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenFileFloatingNearPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenFileInPlaceOfPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalFloatingResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalInPlaceResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalNearPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalFloatingNearPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalInPlaceOfPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneFloatingResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneInPlaceResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneNearPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneFloatingNearPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneInPlaceOfPluginResponse {
  optional PaneId pane_id = 1;
}

message OpenCommandPaneBackgroundResponse {
  optional PaneId pane_id = 1;
}

message GetSessionEnvironmentVariablesPayload {}

message GetSessionEnvironmentVariablesResponse {
  repeated EnvVariable env_vars = 1;
}

message OpenPluginPaneInNewTabPayload {
  string plugin_url = 1;
  map<string, string> configuration = 2;
  repeated ContextItem context = 3;
}

message OpenPaneInNewTabResponse {
  optional uint64 tab_id = 1;
  optional PaneId pane_id = 2;
}

message OpenCommandPaneInPlaceOfPaneIdPayload {
  PaneId pane_id_to_replace = 1;
  command.Command command_to_run = 2;
  bool close_replaced_pane = 3;
  repeated ContextItem context = 4;
}

message OpenTerminalPaneInPlaceOfPaneIdPayload {
  PaneId pane_id_to_replace = 1;
  optional file.File cwd = 2;
  bool close_replaced_pane = 3;
}

message OpenEditPaneInPlaceOfPaneIdPayload {
  PaneId pane_id_to_replace = 1;
  file.File file_to_open = 2;
  bool close_replaced_pane = 3;
  repeated ContextItem context = 4;
}

message OpenCommandPaneInPlaceOfPaneIdResponse {
  optional PaneId pane_id = 1;
}

message OpenTerminalPaneInPlaceOfPaneIdResponse {
  optional PaneId pane_id = 1;
}

message OpenEditPaneInPlaceOfPaneIdResponse {
  optional PaneId pane_id = 1;
}

message HideFloatingPanesPayload {
  optional uint32 tab_id = 1;
}

message ShowFloatingPanesPayload {
  optional uint32 tab_id = 1;
}

message ShowFloatingPanesResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message HideFloatingPanesResponse {
  oneof result {
    bool success = 1;
    string error = 2;
  }
}

message SetPaneColorPayload {
  PaneId pane_id = 1;
  optional string fg = 2;
  optional string bg = 3;
}

message HighlightStyle {
  oneof style {
    bool emphasis_0 = 1;
    bool emphasis_1 = 2;
    bool emphasis_2 = 3;
    bool emphasis_3 = 4;
    CustomRgbHighlight custom_rgb = 5;
    CustomIndexHighlight custom_index = 6;
    bool background_emphasis_0 = 7;
    bool background_emphasis_1 = 8;
    bool background_emphasis_2 = 9;
    bool background_emphasis_3 = 10;
    bool none = 11;
  }
}

message CustomRgbHighlight {
  optional uint32 fg_r = 1;
  optional uint32 fg_g = 2;
  optional uint32 fg_b = 3;
  optional uint32 bg_r = 4;
  optional uint32 bg_g = 5;
  optional uint32 bg_b = 6;
}

message CustomIndexHighlight {
  optional uint32 fg = 1;
  optional uint32 bg = 2;
}

enum HighlightLayer {
  Hint = 0;
  Tool = 1;
  ActionFeedback = 2;
}

message RegexHighlight {
  string pattern = 1;
  HighlightStyle style = 2;
  repeated ContextItem context = 3;
  bool on_hover = 4;
  bool bold = 5;
  bool italic = 6;
  bool underline = 7;
  optional string tooltip_text = 8;
  HighlightLayer layer = 9;
}

message SetPaneRegexHighlightsPayload {
  PaneId pane_id = 1;
  repeated RegexHighlight highlights = 2;
}

message ClearPaneHighlightsPayload {
  PaneId pane_id = 1;
}

message OpenPluginPaneFloatingPayload {
  string plugin_url = 1;
  map<string, string> configuration = 2;
  optional FloatingPaneCoordinates floating_pane_coordinates = 3;
  repeated ContextItem context = 4;
}

message OpenPluginPaneFloatingResponse {
  optional PaneId pane_id = 1;
}

message GetSessionListPayload {}

message SessionListSnapshot {
  repeated event.SessionManifest live_sessions = 1;
  repeated event.ResurrectableSession resurrectable_sessions = 2;
}

message GetSessionListResponse {
  oneof result {
    SessionListSnapshot snapshot = 1;
    string error = 2;
  }
}