Skip to content
Snippets Groups Projects
Commit 7feedbd8 authored by George Nachman's avatar George Nachman
Browse files

Add a few new notifications to the API server for session terminated (i.e.,...

Add a few new notifications to the API server for session terminated (i.e., removed from UI) and layout changed. Update the python library to keep its window hierarchy in synch with the truth.
parent fb818c17
No related branches found
No related tags found
No related merge requests found
Showing
with 830 additions and 200 deletions
Loading
Loading
@@ -20,7 +20,7 @@ DESCRIPTOR = _descriptor.FileDescriptor(
name='api.proto',
package='iterm2',
syntax='proto2',
serialized_pb=_b('\n\tapi.proto\x12\x06iterm2\"\xd6\x04\n\x07Request\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x34\n\x12get_buffer_request\x18\x64 \x01(\x0b\x32\x18.iterm2.GetBufferRequest\x12\x34\n\x12get_prompt_request\x18\x65 \x01(\x0b\x32\x18.iterm2.GetPromptRequest\x12\x37\n\x13transaction_request\x18\x66 \x01(\x0b\x32\x1a.iterm2.TransactionRequest\x12\x39\n\x14notification_request\x18g \x01(\x0b\x32\x1b.iterm2.NotificationRequest\x12:\n\x15register_tool_request\x18h \x01(\x0b\x32\x1b.iterm2.RegisterToolRequest\x12G\n\x1cset_profile_property_request\x18i \x01(\x0b\x32!.iterm2.SetProfilePropertyRequest\x12:\n\x15list_sessions_request\x18j \x01(\x0b\x32\x1b.iterm2.ListSessionsRequest\x12\x32\n\x11send_text_request\x18k \x01(\x0b\x32\x17.iterm2.SendTextRequest\x12\x34\n\x12\x63reate_tab_request\x18l \x01(\x0b\x32\x18.iterm2.CreateTabRequest\x12\x34\n\x12split_pane_request\x18m \x01(\x0b\x32\x18.iterm2.SplitPaneRequest\"\x98\x05\n\x08Response\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x36\n\x13get_buffer_response\x18\x64 \x01(\x0b\x32\x19.iterm2.GetBufferResponse\x12\x36\n\x13get_prompt_response\x18\x65 \x01(\x0b\x32\x19.iterm2.GetPromptResponse\x12\x39\n\x14transaction_response\x18\x66 \x01(\x0b\x32\x1b.iterm2.TransactionResponse\x12;\n\x15notification_response\x18g \x01(\x0b\x32\x1c.iterm2.NotificationResponse\x12<\n\x16register_tool_response\x18h \x01(\x0b\x32\x1c.iterm2.RegisterToolResponse\x12I\n\x1dset_profile_property_response\x18i \x01(\x0b\x32\".iterm2.SetProfilePropertyResponse\x12<\n\x16list_sessions_response\x18j \x01(\x0b\x32\x1c.iterm2.ListSessionsResponse\x12\x34\n\x12send_text_response\x18k \x01(\x0b\x32\x18.iterm2.SendTextResponse\x12\x36\n\x13\x63reate_tab_response\x18l \x01(\x0b\x32\x19.iterm2.CreateTabResponse\x12\x36\n\x13split_pane_response\x18m \x01(\x0b\x32\x19.iterm2.SplitPaneResponse\x12+\n\x0cnotification\x18\xe8\x07 \x01(\x0b\x32\x14.iterm2.Notification\"\xd8\x01\n\x13RegisterToolRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x01(\t\x12+\n\x1creveal_if_already_registered\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x46\n\ttool_type\x18\x03 \x01(\x0e\x32$.iterm2.RegisterToolRequest.ToolType:\rWEB_VIEW_TOOL\x12\x0b\n\x03URL\x18\x04 \x01(\t\"\x1d\n\x08ToolType\x12\x11\n\rWEB_VIEW_TOOL\x10\x01\"\x8b\x01\n\x14RegisterToolResponse\x12\x33\n\x06status\x18\x01 \x01(\x0e\x32#.iterm2.RegisterToolResponse.Status\">\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11REQUEST_MALFORMED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\"n\n\x13NotificationRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x11\n\tsubscribe\x18\x02 \x01(\x08\x12\x33\n\x11notification_type\x18\x03 \x01(\x0e\x32\x18.iterm2.NotificationType\"\xb7\x01\n\x14NotificationResponse\x12\x33\n\x06status\x18\x01 \x01(\x0e\x32#.iterm2.NotificationResponse.Status\"j\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x15\n\x11REQUEST_MALFORMED\x10\x02\x12\x12\n\x0eNOT_SUBSCRIBED\x10\x03\x12\x16\n\x12\x41LREADY_SUBSCRIBED\x10\x04\"\xaf\x03\n\x0cNotification\x12=\n\x16keystroke_notification\x18\x01 \x01(\x0b\x32\x1d.iterm2.KeystrokeNotification\x12\x44\n\x1ascreen_update_notification\x18\x02 \x01(\x0b\x32 .iterm2.ScreenUpdateNotification\x12\x37\n\x13prompt_notification\x18\x03 \x01(\x0b\x32\x1a.iterm2.PromptNotification\x12H\n\x1clocation_change_notification\x18\x04 \x01(\x0b\x32\".iterm2.LocationChangeNotification\x12U\n#custom_escape_sequence_notification\x18\x05 \x01(\x0b\x32(.iterm2.CustomEscapeSequenceNotification\x12@\n\x18new_session_notification\x18\x06 \x01(\x0b\x32\x1e.iterm2.NewSessionNotification\"\x86\x02\n\x15KeystrokeNotification\x12\x12\n\ncharacters\x18\x01 \x01(\t\x12#\n\x1b\x63haractersIgnoringModifiers\x18\x02 \x01(\t\x12:\n\tmodifiers\x18\x03 \x03(\x0e\x32\'.iterm2.KeystrokeNotification.Modifiers\x12\x0f\n\x07keyCode\x18\x04 \x01(\x05\x12\x0f\n\x07session\x18\x05 \x01(\t\"V\n\tModifiers\x12\x0b\n\x07\x43ONTROL\x10\x01\x12\n\n\x06OPTION\x10\x02\x12\x0b\n\x07\x43OMMAND\x10\x03\x12\t\n\x05SHIFT\x10\x04\x12\x0c\n\x08\x46UNCTION\x10\x05\x12\n\n\x06NUMPAD\x10\x06\"+\n\x18ScreenUpdateNotification\x12\x0f\n\x07session\x18\x01 \x01(\t\"%\n\x12PromptNotification\x12\x0f\n\x07session\x18\x01 \x01(\t\"f\n\x1aLocationChangeNotification\x12\x11\n\thost_name\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12\x11\n\tdirectory\x18\x03 \x01(\t\x12\x0f\n\x07session\x18\x04 \x01(\t\"]\n CustomEscapeSequenceNotification\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x17\n\x0fsender_identity\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\t\"2\n\x16NewSessionNotification\x12\x18\n\x10uniqueIdentifier\x18\x01 \x01(\t\"J\n\x10GetBufferRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12%\n\nline_range\x18\x02 \x01(\x0b\x32\x11.iterm2.LineRange\"\xa6\x02\n\x11GetBufferResponse\x12\x34\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.GetBufferResponse.Status:\x02OK\x12\x1c\n\x05range\x18\x02 \x01(\x0b\x32\r.iterm2.Range\x12&\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x14.iterm2.LineContents\x12\x1d\n\x06\x63ursor\x18\x04 \x01(\x0b\x32\r.iterm2.Coord\x12\x1e\n\x16num_lines_above_screen\x18\x05 \x01(\x03\"V\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x16\n\x12INVALID_LINE_RANGE\x10\x02\x12\x15\n\x11REQUEST_MALFORMED\x10\x03\"#\n\x10GetPromptRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\"\xcc\x02\n\x11GetPromptResponse\x12\x34\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.GetPromptResponse.Status:\x02OK\x12(\n\x0cprompt_range\x18\x02 \x01(\x0b\x32\x12.iterm2.CoordRange\x12)\n\rcommand_range\x18\x03 \x01(\x0b\x32\x12.iterm2.CoordRange\x12(\n\x0coutput_range\x18\x04 \x01(\x0b\x32\x12.iterm2.CoordRange\x12\x19\n\x11working_directory\x18\x05 \x01(\t\x12\x0f\n\x07\x63ommand\x18\x06 \x01(\t\"V\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x15\n\x11REQUEST_MALFORMED\x10\x02\x12\x16\n\x12PROMPT_UNAVAILABLE\x10\x03\"M\n\x19SetProfilePropertyRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x12\n\njson_value\x18\x03 \x01(\t\"\x9b\x01\n\x1aSetProfilePropertyResponse\x12=\n\x06status\x18\x01 \x01(\x0e\x32).iterm2.SetProfilePropertyResponse.Status:\x02OK\">\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x15\n\x11REQUEST_MALFORMED\x10\x02\"#\n\x12TransactionRequest\x12\r\n\x05\x62\x65gin\x18\x01 \x01(\x08\"\x8f\x01\n\x13TransactionResponse\x12\x36\n\x06status\x18\x01 \x01(\x0e\x32\".iterm2.TransactionResponse.Status:\x02OK\"@\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eNO_TRANSACTION\x10\x01\x12\x1a\n\x16\x41LREADY_IN_TRANSACTION\x10\x02\"A\n\tLineRange\x12\x1c\n\x14screen_contents_only\x18\x01 \x01(\x08\x12\x16\n\x0etrailing_lines\x18\x02 \x01(\x05\")\n\x05Range\x12\x10\n\x08location\x18\x01 \x01(\x03\x12\x0e\n\x06length\x18\x02 \x01(\x03\"F\n\nCoordRange\x12\x1c\n\x05start\x18\x01 \x01(\x0b\x32\r.iterm2.Coord\x12\x1a\n\x03\x65nd\x18\x02 \x01(\x0b\x32\r.iterm2.Coord\"\x1d\n\x05\x43oord\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x03\"\xeb\x01\n\x0cLineContents\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x37\n\x14\x63ode_points_per_cell\x18\x02 \x03(\x0b\x32\x19.iterm2.CodePointsPerCell\x12N\n\x0c\x63ontinuation\x18\x03 \x01(\x0e\x32!.iterm2.LineContents.Continuation:\x15\x43ONTINUATION_HARD_EOL\"D\n\x0c\x43ontinuation\x12\x19\n\x15\x43ONTINUATION_HARD_EOL\x10\x01\x12\x19\n\x15\x43ONTINUATION_SOFT_EOL\x10\x02\"@\n\x11\x43odePointsPerCell\x12\x1a\n\x0fnum_code_points\x18\x01 \x01(\x05:\x01\x31\x12\x0f\n\x07repeats\x18\x02 \x01(\x05\"\x15\n\x13ListSessionsRequest\"0\n\x0fSendTextRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t\"l\n\x10SendTextResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x1f.iterm2.SendTextResponse.Status\"\'\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\"\xea\x01\n\x14ListSessionsResponse\x12\x34\n\x07windows\x18\x01 \x03(\x0b\x32#.iterm2.ListSessionsResponse.Window\x1a\x38\n\x06Window\x12.\n\x04tabs\x18\x01 \x03(\x0b\x32 .iterm2.ListSessionsResponse.Tab\x1a=\n\x03Tab\x12\x36\n\x08sessions\x18\x01 \x03(\x0b\x32$.iterm2.ListSessionsResponse.Session\x1a#\n\x07Session\x12\x18\n\x10uniqueIdentifier\x18\x01 \x01(\t\"_\n\x10\x43reateTabRequest\x12\x14\n\x0cprofile_name\x18\x01 \x01(\t\x12\x11\n\twindow_id\x18\x02 \x01(\t\x12\x11\n\ttab_index\x18\x03 \x01(\r\x12\x0f\n\x07\x63ommand\x18\x04 \x01(\t\"\xf0\x01\n\x11\x43reateTabResponse\x12\x30\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.CreateTabResponse.Status\x12\x11\n\twindow_id\x18\x02 \x01(\t\x12\x0e\n\x06tab_id\x18\x03 \x01(\x05\x12\x12\n\nsession_id\x18\x04 \x01(\t\"r\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x18\n\x14INVALID_PROFILE_NAME\x10\x01\x12\x15\n\x11INVALID_WINDOW_ID\x10\x02\x12\x15\n\x11INVALID_TAB_INDEX\x10\x03\x12\x18\n\x14MISSING_SUBSTITUTION\x10\x04\"\xbb\x01\n\x10SplitPaneRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12@\n\x0fsplit_direction\x18\x02 \x01(\x0e\x32\'.iterm2.SplitPaneRequest.SplitDirection\x12\x0e\n\x06\x62\x65\x66ore\x18\x03 \x01(\x08\x12\x14\n\x0cprofile_name\x18\x04 \x01(\t\".\n\x0eSplitDirection\x12\x0c\n\x08VERTICAL\x10\x00\x12\x0e\n\nHORIZONTAL\x10\x01\"\xae\x01\n\x11SplitPaneResponse\x12\x30\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.SplitPaneResponse.Status\x12\x12\n\nsession_id\x18\x02 \x01(\t\"S\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x18\n\x14INVALID_PROFILE_NAME\x10\x02\x12\x10\n\x0c\x43\x41NNOT_SPLIT\x10\x03*\xbe\x01\n\x10NotificationType\x12\x17\n\x13NOTIFY_ON_KEYSTROKE\x10\x01\x12\x1b\n\x17NOTIFY_ON_SCREEN_UPDATE\x10\x02\x12\x14\n\x10NOTIFY_ON_PROMPT\x10\x03\x12\x1d\n\x19NOTIFY_ON_LOCATION_CHANGE\x10\x04\x12$\n NOTIFY_ON_CUSTOM_ESCAPE_SEQUENCE\x10\x05\x12\x19\n\x15NOTIFY_ON_NEW_SESSION\x10\x06\x42\x06\xa2\x02\x03ITM')
serialized_pb=_b('\n\tapi.proto\x12\x06iterm2\"\xd6\x04\n\x07Request\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x34\n\x12get_buffer_request\x18\x64 \x01(\x0b\x32\x18.iterm2.GetBufferRequest\x12\x34\n\x12get_prompt_request\x18\x65 \x01(\x0b\x32\x18.iterm2.GetPromptRequest\x12\x37\n\x13transaction_request\x18\x66 \x01(\x0b\x32\x1a.iterm2.TransactionRequest\x12\x39\n\x14notification_request\x18g \x01(\x0b\x32\x1b.iterm2.NotificationRequest\x12:\n\x15register_tool_request\x18h \x01(\x0b\x32\x1b.iterm2.RegisterToolRequest\x12G\n\x1cset_profile_property_request\x18i \x01(\x0b\x32!.iterm2.SetProfilePropertyRequest\x12:\n\x15list_sessions_request\x18j \x01(\x0b\x32\x1b.iterm2.ListSessionsRequest\x12\x32\n\x11send_text_request\x18k \x01(\x0b\x32\x17.iterm2.SendTextRequest\x12\x34\n\x12\x63reate_tab_request\x18l \x01(\x0b\x32\x18.iterm2.CreateTabRequest\x12\x34\n\x12split_pane_request\x18m \x01(\x0b\x32\x18.iterm2.SplitPaneRequest\"\x98\x05\n\x08Response\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x36\n\x13get_buffer_response\x18\x64 \x01(\x0b\x32\x19.iterm2.GetBufferResponse\x12\x36\n\x13get_prompt_response\x18\x65 \x01(\x0b\x32\x19.iterm2.GetPromptResponse\x12\x39\n\x14transaction_response\x18\x66 \x01(\x0b\x32\x1b.iterm2.TransactionResponse\x12;\n\x15notification_response\x18g \x01(\x0b\x32\x1c.iterm2.NotificationResponse\x12<\n\x16register_tool_response\x18h \x01(\x0b\x32\x1c.iterm2.RegisterToolResponse\x12I\n\x1dset_profile_property_response\x18i \x01(\x0b\x32\".iterm2.SetProfilePropertyResponse\x12<\n\x16list_sessions_response\x18j \x01(\x0b\x32\x1c.iterm2.ListSessionsResponse\x12\x34\n\x12send_text_response\x18k \x01(\x0b\x32\x18.iterm2.SendTextResponse\x12\x36\n\x13\x63reate_tab_response\x18l \x01(\x0b\x32\x19.iterm2.CreateTabResponse\x12\x36\n\x13split_pane_response\x18m \x01(\x0b\x32\x19.iterm2.SplitPaneResponse\x12+\n\x0cnotification\x18\xe8\x07 \x01(\x0b\x32\x14.iterm2.Notification\"\xd8\x01\n\x13RegisterToolRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nidentifier\x18\x02 \x01(\t\x12+\n\x1creveal_if_already_registered\x18\x05 \x01(\x08:\x05\x66\x61lse\x12\x46\n\ttool_type\x18\x03 \x01(\x0e\x32$.iterm2.RegisterToolRequest.ToolType:\rWEB_VIEW_TOOL\x12\x0b\n\x03URL\x18\x04 \x01(\t\"\x1d\n\x08ToolType\x12\x11\n\rWEB_VIEW_TOOL\x10\x01\"\x8b\x01\n\x14RegisterToolResponse\x12\x33\n\x06status\x18\x01 \x01(\x0e\x32#.iterm2.RegisterToolResponse.Status\">\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11REQUEST_MALFORMED\x10\x01\x12\x15\n\x11PERMISSION_DENIED\x10\x02\"n\n\x13NotificationRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x11\n\tsubscribe\x18\x02 \x01(\x08\x12\x33\n\x11notification_type\x18\x03 \x01(\x0e\x32\x18.iterm2.NotificationType\"\xb7\x01\n\x14NotificationResponse\x12\x33\n\x06status\x18\x01 \x01(\x0e\x32#.iterm2.NotificationResponse.Status\"j\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x15\n\x11REQUEST_MALFORMED\x10\x02\x12\x12\n\x0eNOT_SUBSCRIBED\x10\x03\x12\x16\n\x12\x41LREADY_SUBSCRIBED\x10\x04\"\xc5\x04\n\x0cNotification\x12=\n\x16keystroke_notification\x18\x01 \x01(\x0b\x32\x1d.iterm2.KeystrokeNotification\x12\x44\n\x1ascreen_update_notification\x18\x02 \x01(\x0b\x32 .iterm2.ScreenUpdateNotification\x12\x37\n\x13prompt_notification\x18\x03 \x01(\x0b\x32\x1a.iterm2.PromptNotification\x12H\n\x1clocation_change_notification\x18\x04 \x01(\x0b\x32\".iterm2.LocationChangeNotification\x12U\n#custom_escape_sequence_notification\x18\x05 \x01(\x0b\x32(.iterm2.CustomEscapeSequenceNotification\x12@\n\x18new_session_notification\x18\x06 \x01(\x0b\x32\x1e.iterm2.NewSessionNotification\x12L\n\x1eterminate_session_notification\x18\x07 \x01(\x0b\x32$.iterm2.TerminateSessionNotification\x12\x46\n\x1blayout_changed_notification\x18\x08 \x01(\x0b\x32!.iterm2.LayoutChangedNotification\"\x86\x02\n\x15KeystrokeNotification\x12\x12\n\ncharacters\x18\x01 \x01(\t\x12#\n\x1b\x63haractersIgnoringModifiers\x18\x02 \x01(\t\x12:\n\tmodifiers\x18\x03 \x03(\x0e\x32\'.iterm2.KeystrokeNotification.Modifiers\x12\x0f\n\x07keyCode\x18\x04 \x01(\x05\x12\x0f\n\x07session\x18\x05 \x01(\t\"V\n\tModifiers\x12\x0b\n\x07\x43ONTROL\x10\x01\x12\n\n\x06OPTION\x10\x02\x12\x0b\n\x07\x43OMMAND\x10\x03\x12\t\n\x05SHIFT\x10\x04\x12\x0c\n\x08\x46UNCTION\x10\x05\x12\n\n\x06NUMPAD\x10\x06\"+\n\x18ScreenUpdateNotification\x12\x0f\n\x07session\x18\x01 \x01(\t\"%\n\x12PromptNotification\x12\x0f\n\x07session\x18\x01 \x01(\t\"f\n\x1aLocationChangeNotification\x12\x11\n\thost_name\x18\x01 \x01(\t\x12\x11\n\tuser_name\x18\x02 \x01(\t\x12\x11\n\tdirectory\x18\x03 \x01(\t\x12\x0f\n\x07session\x18\x04 \x01(\t\"]\n CustomEscapeSequenceNotification\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x17\n\x0fsender_identity\x18\x02 \x01(\t\x12\x0f\n\x07payload\x18\x03 \x01(\t\"2\n\x16NewSessionNotification\x12\x18\n\x10uniqueIdentifier\x18\x01 \x01(\t\"8\n\x1cTerminateSessionNotification\x12\x18\n\x10uniqueIdentifier\x18\x01 \x01(\t\"Y\n\x19LayoutChangedNotification\x12<\n\x16list_sessions_response\x18\x01 \x01(\x0b\x32\x1c.iterm2.ListSessionsResponse\"J\n\x10GetBufferRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12%\n\nline_range\x18\x02 \x01(\x0b\x32\x11.iterm2.LineRange\"\xa6\x02\n\x11GetBufferResponse\x12\x34\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.GetBufferResponse.Status:\x02OK\x12\x1c\n\x05range\x18\x02 \x01(\x0b\x32\r.iterm2.Range\x12&\n\x08\x63ontents\x18\x03 \x03(\x0b\x32\x14.iterm2.LineContents\x12\x1d\n\x06\x63ursor\x18\x04 \x01(\x0b\x32\r.iterm2.Coord\x12\x1e\n\x16num_lines_above_screen\x18\x05 \x01(\x03\"V\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x16\n\x12INVALID_LINE_RANGE\x10\x02\x12\x15\n\x11REQUEST_MALFORMED\x10\x03\"#\n\x10GetPromptRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\"\xcc\x02\n\x11GetPromptResponse\x12\x34\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.GetPromptResponse.Status:\x02OK\x12(\n\x0cprompt_range\x18\x02 \x01(\x0b\x32\x12.iterm2.CoordRange\x12)\n\rcommand_range\x18\x03 \x01(\x0b\x32\x12.iterm2.CoordRange\x12(\n\x0coutput_range\x18\x04 \x01(\x0b\x32\x12.iterm2.CoordRange\x12\x19\n\x11working_directory\x18\x05 \x01(\t\x12\x0f\n\x07\x63ommand\x18\x06 \x01(\t\"V\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x15\n\x11REQUEST_MALFORMED\x10\x02\x12\x16\n\x12PROMPT_UNAVAILABLE\x10\x03\"M\n\x19SetProfilePropertyRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x0b\n\x03key\x18\x02 \x01(\t\x12\x12\n\njson_value\x18\x03 \x01(\t\"\x9b\x01\n\x1aSetProfilePropertyResponse\x12=\n\x06status\x18\x01 \x01(\x0e\x32).iterm2.SetProfilePropertyResponse.Status:\x02OK\">\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x15\n\x11REQUEST_MALFORMED\x10\x02\"#\n\x12TransactionRequest\x12\r\n\x05\x62\x65gin\x18\x01 \x01(\x08\"\x8f\x01\n\x13TransactionResponse\x12\x36\n\x06status\x18\x01 \x01(\x0e\x32\".iterm2.TransactionResponse.Status:\x02OK\"@\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eNO_TRANSACTION\x10\x01\x12\x1a\n\x16\x41LREADY_IN_TRANSACTION\x10\x02\"A\n\tLineRange\x12\x1c\n\x14screen_contents_only\x18\x01 \x01(\x08\x12\x16\n\x0etrailing_lines\x18\x02 \x01(\x05\")\n\x05Range\x12\x10\n\x08location\x18\x01 \x01(\x03\x12\x0e\n\x06length\x18\x02 \x01(\x03\"F\n\nCoordRange\x12\x1c\n\x05start\x18\x01 \x01(\x0b\x32\r.iterm2.Coord\x12\x1a\n\x03\x65nd\x18\x02 \x01(\x0b\x32\r.iterm2.Coord\"\x1d\n\x05\x43oord\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x03\"\xeb\x01\n\x0cLineContents\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x37\n\x14\x63ode_points_per_cell\x18\x02 \x03(\x0b\x32\x19.iterm2.CodePointsPerCell\x12N\n\x0c\x63ontinuation\x18\x03 \x01(\x0e\x32!.iterm2.LineContents.Continuation:\x15\x43ONTINUATION_HARD_EOL\"D\n\x0c\x43ontinuation\x12\x19\n\x15\x43ONTINUATION_HARD_EOL\x10\x01\x12\x19\n\x15\x43ONTINUATION_SOFT_EOL\x10\x02\"@\n\x11\x43odePointsPerCell\x12\x1a\n\x0fnum_code_points\x18\x01 \x01(\x05:\x01\x31\x12\x0f\n\x07repeats\x18\x02 \x01(\x05\"\x15\n\x13ListSessionsRequest\"0\n\x0fSendTextRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t\"l\n\x10SendTextResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x1f.iterm2.SendTextResponse.Status\"\'\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\"\x8d\x02\n\x14ListSessionsResponse\x12\x34\n\x07windows\x18\x01 \x03(\x0b\x32#.iterm2.ListSessionsResponse.Window\x1aK\n\x06Window\x12.\n\x04tabs\x18\x01 \x03(\x0b\x32 .iterm2.ListSessionsResponse.Tab\x12\x11\n\twindow_id\x18\x02 \x01(\t\x1aM\n\x03Tab\x12\x36\n\x08sessions\x18\x01 \x03(\x0b\x32$.iterm2.ListSessionsResponse.Session\x12\x0e\n\x06tab_id\x18\x02 \x01(\t\x1a#\n\x07Session\x12\x18\n\x10uniqueIdentifier\x18\x01 \x01(\t\"_\n\x10\x43reateTabRequest\x12\x14\n\x0cprofile_name\x18\x01 \x01(\t\x12\x11\n\twindow_id\x18\x02 \x01(\t\x12\x11\n\ttab_index\x18\x03 \x01(\r\x12\x0f\n\x07\x63ommand\x18\x04 \x01(\t\"\xf0\x01\n\x11\x43reateTabResponse\x12\x30\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.CreateTabResponse.Status\x12\x11\n\twindow_id\x18\x02 \x01(\t\x12\x0e\n\x06tab_id\x18\x03 \x01(\x05\x12\x12\n\nsession_id\x18\x04 \x01(\t\"r\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x18\n\x14INVALID_PROFILE_NAME\x10\x01\x12\x15\n\x11INVALID_WINDOW_ID\x10\x02\x12\x15\n\x11INVALID_TAB_INDEX\x10\x03\x12\x18\n\x14MISSING_SUBSTITUTION\x10\x04\"\xc2\x01\n\x10SplitPaneRequest\x12\x0f\n\x07session\x18\x01 \x01(\t\x12@\n\x0fsplit_direction\x18\x02 \x01(\x0e\x32\'.iterm2.SplitPaneRequest.SplitDirection\x12\x15\n\x06\x62\x65\x66ore\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x14\n\x0cprofile_name\x18\x04 \x01(\t\".\n\x0eSplitDirection\x12\x0c\n\x08VERTICAL\x10\x00\x12\x0e\n\nHORIZONTAL\x10\x01\"\xae\x01\n\x11SplitPaneResponse\x12\x30\n\x06status\x18\x01 \x01(\x0e\x32 .iterm2.SplitPaneResponse.Status\x12\x12\n\nsession_id\x18\x02 \x01(\t\"S\n\x06Status\x12\x06\n\x02OK\x10\x00\x12\x15\n\x11SESSION_NOT_FOUND\x10\x01\x12\x18\n\x14INVALID_PROFILE_NAME\x10\x02\x12\x10\n\x0c\x43\x41NNOT_SPLIT\x10\x03*\xfc\x01\n\x10NotificationType\x12\x17\n\x13NOTIFY_ON_KEYSTROKE\x10\x01\x12\x1b\n\x17NOTIFY_ON_SCREEN_UPDATE\x10\x02\x12\x14\n\x10NOTIFY_ON_PROMPT\x10\x03\x12\x1d\n\x19NOTIFY_ON_LOCATION_CHANGE\x10\x04\x12$\n NOTIFY_ON_CUSTOM_ESCAPE_SEQUENCE\x10\x05\x12\x19\n\x15NOTIFY_ON_NEW_SESSION\x10\x06\x12\x1f\n\x1bNOTIFY_ON_TERMINATE_SESSION\x10\x07\x12\x1b\n\x17NOTIFY_ON_LAYOUT_CHANGE\x10\x08\x42\x06\xa2\x02\x03ITM')
)
_sym_db.RegisterFileDescriptor(DESCRIPTOR)
 
Loading
Loading
@@ -54,11 +54,19 @@ _NOTIFICATIONTYPE = _descriptor.EnumDescriptor(
name='NOTIFY_ON_NEW_SESSION', index=5, number=6,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NOTIFY_ON_TERMINATE_SESSION', index=6, number=7,
options=None,
type=None),
_descriptor.EnumValueDescriptor(
name='NOTIFY_ON_LAYOUT_CHANGE', index=7, number=8,
options=None,
type=None),
],
containing_type=None,
options=None,
serialized_start=5792,
serialized_end=5982,
serialized_start=6133,
serialized_end=6385,
)
_sym_db.RegisterEnumDescriptor(_NOTIFICATIONTYPE)
 
Loading
Loading
@@ -69,6 +77,8 @@ NOTIFY_ON_PROMPT = 3
NOTIFY_ON_LOCATION_CHANGE = 4
NOTIFY_ON_CUSTOM_ESCAPE_SEQUENCE = 5
NOTIFY_ON_NEW_SESSION = 6
NOTIFY_ON_TERMINATE_SESSION = 7
NOTIFY_ON_LAYOUT_CHANGE = 8
 
 
_REGISTERTOOLREQUEST_TOOLTYPE = _descriptor.EnumDescriptor(
Loading
Loading
@@ -182,8 +192,8 @@ _KEYSTROKENOTIFICATION_MODIFIERS = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=2559,
serialized_end=2645,
serialized_start=2709,
serialized_end=2795,
)
_sym_db.RegisterEnumDescriptor(_KEYSTROKENOTIFICATION_MODIFIERS)
 
Loading
Loading
@@ -212,8 +222,8 @@ _GETBUFFERRESPONSE_STATUS = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=3267,
serialized_end=3353,
serialized_start=3566,
serialized_end=3652,
)
_sym_db.RegisterEnumDescriptor(_GETBUFFERRESPONSE_STATUS)
 
Loading
Loading
@@ -242,8 +252,8 @@ _GETPROMPTRESPONSE_STATUS = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=3639,
serialized_end=3725,
serialized_start=3938,
serialized_end=4024,
)
_sym_db.RegisterEnumDescriptor(_GETPROMPTRESPONSE_STATUS)
 
Loading
Loading
@@ -294,8 +304,8 @@ _TRANSACTIONRESPONSE_STATUS = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=4081,
serialized_end=4145,
serialized_start=4380,
serialized_end=4444,
)
_sym_db.RegisterEnumDescriptor(_TRANSACTIONRESPONSE_STATUS)
 
Loading
Loading
@@ -316,8 +326,8 @@ _LINECONTENTS_CONTINUATION = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=4528,
serialized_end=4596,
serialized_start=4827,
serialized_end=4895,
)
_sym_db.RegisterEnumDescriptor(_LINECONTENTS_CONTINUATION)
 
Loading
Loading
@@ -372,8 +382,8 @@ _CREATETABRESPONSE_STATUS = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=5308,
serialized_end=5422,
serialized_start=5642,
serialized_end=5756,
)
_sym_db.RegisterEnumDescriptor(_CREATETABRESPONSE_STATUS)
 
Loading
Loading
@@ -394,8 +404,8 @@ _SPLITPANEREQUEST_SPLITDIRECTION = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=5566,
serialized_end=5612,
serialized_start=5907,
serialized_end=5953,
)
_sym_db.RegisterEnumDescriptor(_SPLITPANEREQUEST_SPLITDIRECTION)
 
Loading
Loading
@@ -424,8 +434,8 @@ _SPLITPANERESPONSE_STATUS = _descriptor.EnumDescriptor(
],
containing_type=None,
options=None,
serialized_start=5706,
serialized_end=5789,
serialized_start=6047,
serialized_end=6130,
)
_sym_db.RegisterEnumDescriptor(_SPLITPANERESPONSE_STATUS)
 
Loading
Loading
@@ -857,6 +867,20 @@ _NOTIFICATION = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='terminate_session_notification', full_name='iterm2.Notification.terminate_session_notification', index=6,
number=7, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='layout_changed_notification', full_name='iterm2.Notification.layout_changed_notification', index=7,
number=8, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
Loading
Loading
@@ -870,7 +894,7 @@ _NOTIFICATION = _descriptor.Descriptor(
oneofs=[
],
serialized_start=1949,
serialized_end=2380,
serialized_end=2530,
)
 
 
Loading
Loading
@@ -929,8 +953,8 @@ _KEYSTROKENOTIFICATION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2383,
serialized_end=2645,
serialized_start=2533,
serialized_end=2795,
)
 
 
Loading
Loading
@@ -960,8 +984,8 @@ _SCREENUPDATENOTIFICATION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2647,
serialized_end=2690,
serialized_start=2797,
serialized_end=2840,
)
 
 
Loading
Loading
@@ -991,8 +1015,8 @@ _PROMPTNOTIFICATION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2692,
serialized_end=2729,
serialized_start=2842,
serialized_end=2879,
)
 
 
Loading
Loading
@@ -1043,8 +1067,8 @@ _LOCATIONCHANGENOTIFICATION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2731,
serialized_end=2833,
serialized_start=2881,
serialized_end=2983,
)
 
 
Loading
Loading
@@ -1088,8 +1112,8 @@ _CUSTOMESCAPESEQUENCENOTIFICATION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2835,
serialized_end=2928,
serialized_start=2985,
serialized_end=3078,
)
 
 
Loading
Loading
@@ -1119,8 +1143,70 @@ _NEWSESSIONNOTIFICATION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2930,
serialized_end=2980,
serialized_start=3080,
serialized_end=3130,
)
_TERMINATESESSIONNOTIFICATION = _descriptor.Descriptor(
name='TerminateSessionNotification',
full_name='iterm2.TerminateSessionNotification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='uniqueIdentifier', full_name='iterm2.TerminateSessionNotification.uniqueIdentifier', index=0,
number=1, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3132,
serialized_end=3188,
)
_LAYOUTCHANGEDNOTIFICATION = _descriptor.Descriptor(
name='LayoutChangedNotification',
full_name='iterm2.LayoutChangedNotification',
filename=None,
file=DESCRIPTOR,
containing_type=None,
fields=[
_descriptor.FieldDescriptor(
name='list_sessions_response', full_name='iterm2.LayoutChangedNotification.list_sessions_response', index=0,
number=1, type=11, cpp_type=10, label=1,
has_default_value=False, default_value=None,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
nested_types=[],
enum_types=[
],
options=None,
is_extendable=False,
syntax='proto2',
extension_ranges=[],
oneofs=[
],
serialized_start=3190,
serialized_end=3279,
)
 
 
Loading
Loading
@@ -1157,8 +1243,8 @@ _GETBUFFERREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=2982,
serialized_end=3056,
serialized_start=3281,
serialized_end=3355,
)
 
 
Loading
Loading
@@ -1217,8 +1303,8 @@ _GETBUFFERRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=3059,
serialized_end=3353,
serialized_start=3358,
serialized_end=3652,
)
 
 
Loading
Loading
@@ -1248,8 +1334,8 @@ _GETPROMPTREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=3355,
serialized_end=3390,
serialized_start=3654,
serialized_end=3689,
)
 
 
Loading
Loading
@@ -1315,8 +1401,8 @@ _GETPROMPTRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=3393,
serialized_end=3725,
serialized_start=3692,
serialized_end=4024,
)
 
 
Loading
Loading
@@ -1360,8 +1446,8 @@ _SETPROFILEPROPERTYREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=3727,
serialized_end=3804,
serialized_start=4026,
serialized_end=4103,
)
 
 
Loading
Loading
@@ -1392,8 +1478,8 @@ _SETPROFILEPROPERTYRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=3807,
serialized_end=3962,
serialized_start=4106,
serialized_end=4261,
)
 
 
Loading
Loading
@@ -1423,8 +1509,8 @@ _TRANSACTIONREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=3964,
serialized_end=3999,
serialized_start=4263,
serialized_end=4298,
)
 
 
Loading
Loading
@@ -1455,8 +1541,8 @@ _TRANSACTIONRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4002,
serialized_end=4145,
serialized_start=4301,
serialized_end=4444,
)
 
 
Loading
Loading
@@ -1493,8 +1579,8 @@ _LINERANGE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4147,
serialized_end=4212,
serialized_start=4446,
serialized_end=4511,
)
 
 
Loading
Loading
@@ -1531,8 +1617,8 @@ _RANGE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4214,
serialized_end=4255,
serialized_start=4513,
serialized_end=4554,
)
 
 
Loading
Loading
@@ -1569,8 +1655,8 @@ _COORDRANGE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4257,
serialized_end=4327,
serialized_start=4556,
serialized_end=4626,
)
 
 
Loading
Loading
@@ -1607,8 +1693,8 @@ _COORD = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4329,
serialized_end=4358,
serialized_start=4628,
serialized_end=4657,
)
 
 
Loading
Loading
@@ -1653,8 +1739,8 @@ _LINECONTENTS = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4361,
serialized_end=4596,
serialized_start=4660,
serialized_end=4895,
)
 
 
Loading
Loading
@@ -1691,8 +1777,8 @@ _CODEPOINTSPERCELL = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4598,
serialized_end=4662,
serialized_start=4897,
serialized_end=4961,
)
 
 
Loading
Loading
@@ -1715,8 +1801,8 @@ _LISTSESSIONSREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4664,
serialized_end=4685,
serialized_start=4963,
serialized_end=4984,
)
 
 
Loading
Loading
@@ -1753,8 +1839,8 @@ _SENDTEXTREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4687,
serialized_end=4735,
serialized_start=4986,
serialized_end=5034,
)
 
 
Loading
Loading
@@ -1785,8 +1871,8 @@ _SENDTEXTRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4737,
serialized_end=4845,
serialized_start=5036,
serialized_end=5144,
)
 
 
Loading
Loading
@@ -1804,6 +1890,13 @@ _LISTSESSIONSRESPONSE_WINDOW = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='window_id', full_name='iterm2.ListSessionsResponse.Window.window_id', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
Loading
Loading
@@ -1816,8 +1909,8 @@ _LISTSESSIONSRESPONSE_WINDOW = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4926,
serialized_end=4982,
serialized_start=5225,
serialized_end=5300,
)
 
_LISTSESSIONSRESPONSE_TAB = _descriptor.Descriptor(
Loading
Loading
@@ -1834,6 +1927,13 @@ _LISTSESSIONSRESPONSE_TAB = _descriptor.Descriptor(
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
_descriptor.FieldDescriptor(
name='tab_id', full_name='iterm2.ListSessionsResponse.Tab.tab_id', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
],
extensions=[
],
Loading
Loading
@@ -1846,8 +1946,8 @@ _LISTSESSIONSRESPONSE_TAB = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4984,
serialized_end=5045,
serialized_start=5302,
serialized_end=5379,
)
 
_LISTSESSIONSRESPONSE_SESSION = _descriptor.Descriptor(
Loading
Loading
@@ -1876,8 +1976,8 @@ _LISTSESSIONSRESPONSE_SESSION = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=5047,
serialized_end=5082,
serialized_start=5381,
serialized_end=5416,
)
 
_LISTSESSIONSRESPONSE = _descriptor.Descriptor(
Loading
Loading
@@ -1906,8 +2006,8 @@ _LISTSESSIONSRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=4848,
serialized_end=5082,
serialized_start=5147,
serialized_end=5416,
)
 
 
Loading
Loading
@@ -1958,8 +2058,8 @@ _CREATETABREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=5084,
serialized_end=5179,
serialized_start=5418,
serialized_end=5513,
)
 
 
Loading
Loading
@@ -2011,8 +2111,8 @@ _CREATETABRESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=5182,
serialized_end=5422,
serialized_start=5516,
serialized_end=5756,
)
 
 
Loading
Loading
@@ -2040,7 +2140,7 @@ _SPLITPANEREQUEST = _descriptor.Descriptor(
_descriptor.FieldDescriptor(
name='before', full_name='iterm2.SplitPaneRequest.before', index=2,
number=3, type=8, cpp_type=7, label=1,
has_default_value=False, default_value=False,
has_default_value=True, default_value=False,
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
options=None),
Loading
Loading
@@ -2064,8 +2164,8 @@ _SPLITPANEREQUEST = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=5425,
serialized_end=5612,
serialized_start=5759,
serialized_end=5953,
)
 
 
Loading
Loading
@@ -2103,8 +2203,8 @@ _SPLITPANERESPONSE = _descriptor.Descriptor(
extension_ranges=[],
oneofs=[
],
serialized_start=5615,
serialized_end=5789,
serialized_start=5956,
serialized_end=6130,
)
 
_REQUEST.fields_by_name['get_buffer_request'].message_type = _GETBUFFERREQUEST
Loading
Loading
@@ -2141,8 +2241,11 @@ _NOTIFICATION.fields_by_name['prompt_notification'].message_type = _PROMPTNOTIFI
_NOTIFICATION.fields_by_name['location_change_notification'].message_type = _LOCATIONCHANGENOTIFICATION
_NOTIFICATION.fields_by_name['custom_escape_sequence_notification'].message_type = _CUSTOMESCAPESEQUENCENOTIFICATION
_NOTIFICATION.fields_by_name['new_session_notification'].message_type = _NEWSESSIONNOTIFICATION
_NOTIFICATION.fields_by_name['terminate_session_notification'].message_type = _TERMINATESESSIONNOTIFICATION
_NOTIFICATION.fields_by_name['layout_changed_notification'].message_type = _LAYOUTCHANGEDNOTIFICATION
_KEYSTROKENOTIFICATION.fields_by_name['modifiers'].enum_type = _KEYSTROKENOTIFICATION_MODIFIERS
_KEYSTROKENOTIFICATION_MODIFIERS.containing_type = _KEYSTROKENOTIFICATION
_LAYOUTCHANGEDNOTIFICATION.fields_by_name['list_sessions_response'].message_type = _LISTSESSIONSRESPONSE
_GETBUFFERREQUEST.fields_by_name['line_range'].message_type = _LINERANGE
_GETBUFFERRESPONSE.fields_by_name['status'].enum_type = _GETBUFFERRESPONSE_STATUS
_GETBUFFERRESPONSE.fields_by_name['range'].message_type = _RANGE
Loading
Loading
@@ -2190,6 +2293,8 @@ DESCRIPTOR.message_types_by_name['PromptNotification'] = _PROMPTNOTIFICATION
DESCRIPTOR.message_types_by_name['LocationChangeNotification'] = _LOCATIONCHANGENOTIFICATION
DESCRIPTOR.message_types_by_name['CustomEscapeSequenceNotification'] = _CUSTOMESCAPESEQUENCENOTIFICATION
DESCRIPTOR.message_types_by_name['NewSessionNotification'] = _NEWSESSIONNOTIFICATION
DESCRIPTOR.message_types_by_name['TerminateSessionNotification'] = _TERMINATESESSIONNOTIFICATION
DESCRIPTOR.message_types_by_name['LayoutChangedNotification'] = _LAYOUTCHANGEDNOTIFICATION
DESCRIPTOR.message_types_by_name['GetBufferRequest'] = _GETBUFFERREQUEST
DESCRIPTOR.message_types_by_name['GetBufferResponse'] = _GETBUFFERRESPONSE
DESCRIPTOR.message_types_by_name['GetPromptRequest'] = _GETPROMPTREQUEST
Loading
Loading
@@ -2305,6 +2410,20 @@ NewSessionNotification = _reflection.GeneratedProtocolMessageType('NewSessionNot
))
_sym_db.RegisterMessage(NewSessionNotification)
 
TerminateSessionNotification = _reflection.GeneratedProtocolMessageType('TerminateSessionNotification', (_message.Message,), dict(
DESCRIPTOR = _TERMINATESESSIONNOTIFICATION,
__module__ = 'api_pb2'
# @@protoc_insertion_point(class_scope:iterm2.TerminateSessionNotification)
))
_sym_db.RegisterMessage(TerminateSessionNotification)
LayoutChangedNotification = _reflection.GeneratedProtocolMessageType('LayoutChangedNotification', (_message.Message,), dict(
DESCRIPTOR = _LAYOUTCHANGEDNOTIFICATION,
__module__ = 'api_pb2'
# @@protoc_insertion_point(class_scope:iterm2.LayoutChangedNotification)
))
_sym_db.RegisterMessage(LayoutChangedNotification)
GetBufferRequest = _reflection.GeneratedProtocolMessageType('GetBufferRequest', (_message.Message,), dict(
DESCRIPTOR = _GETBUFFERREQUEST,
__module__ = 'api_pb2'
Loading
Loading
This diff is collapsed.
Loading
Loading
@@ -2,21 +2,55 @@
# This is python 2.7 on macOS 10.12.
 
from __future__ import print_function
import api_pb2
from it2global import get_socket, wait
import it2notifications
import it2session
import it2socket
import it2tab
import it2window
import api_pb2
import logging
class Synchronizer(object):
def __init__(self):
it2notifications.NewSessionSubscription(lambda notification: self._refresh())
it2notifications.TerminateSessionSubscription(lambda notification: self._refresh())
it2notifications.LayoutChangeSubscription(self._layoutDidChange)
self.value = None
self._refresh()
def _refresh(self):
logging.debug("Refreshing hierarchy")
self.future = get_socket().request_hierarchy()
def _layoutDidChange(self, notification):
logging.debug("Layout did change")
self.future = it2socket.Future()
self.future.callback(notification.list_sessions_response)
def get(self):
if self.future is not None:
return self.future.get()
return None
 
class Hierarchy(object):
def __init__(self):
self.synchronizer = Synchronizer()
self.windows = None
self.future = get_socket().request_hierarchy()
def pretty_str(self):
s = ""
for w in self.get_windows():
if len(s) > 0:
s += "\n"
s += w.pretty_str(indent="")
return s
 
def get_windows(self):
if self.future is not None:
self.parse(self.future.get())
self.future = None
newValue = self.synchronizer.get()
if newValue is not None:
self.parse(newValue)
return self.windows
 
def parse(self, response):
Loading
Loading
@@ -26,9 +60,9 @@ class Hierarchy(object):
for tab in window.tabs:
sessions = []
for session in tab.sessions:
sessions.append(Session(session.uniqueIdentifier))
tabs.append(it2tab.Tab(None, sessions))
windows.append(it2window.Window(None, tabs))
sessions.append(it2session.Session(session.uniqueIdentifier))
tabs.append(it2tab.Tab(tab.tab_id, sessions))
windows.append(it2window.Window(window.window_id, tabs))
self.windows = windows
 
def create_window(self, profile=None, command=None):
Loading
Loading
Loading
Loading
@@ -9,6 +9,7 @@ import dispatchq
import it2session
import it2socket
import it2tab
import logging
import threading
import time
 
Loading
Loading
@@ -41,10 +42,19 @@ class NewSessionSubscription(Subscription):
def __init__(self, handler):
Subscription.__init__(self, api_pb2.NOTIFY_ON_NEW_SESSION, None, handler)
 
class TerminateSessionSubscription(Subscription):
def __init__(self, handler):
Subscription.__init__(self, api_pb2.NOTIFY_ON_TERMINATE_SESSION, None, handler)
class KeystrokeSubscription(Subscription):
def __init__(self, session_id, handler):
Subscription.__init__(self, api_pb2.NOTIFY_ON_KEYSTROKE, session_id, handler)
 
class LayoutChangeSubscription(Subscription):
def __init__(self, handler):
Subscription.__init__(self, api_pb2.NOTIFY_ON_LAYOUT_CHANGE, None, handler)
def _extract(notification):
key = None
 
Loading
Loading
@@ -67,15 +77,24 @@ def _extract(notification):
elif notification.HasField('new_session_notification'):
key = (None, api_pb2.NOTIFY_ON_NEW_SESSION)
notification = notification.new_session_notification
elif notification.HasField('terminate_session_notification'):
key = (None, api_pb2.NOTIFY_ON_TERMINATE_SESSION)
notification = notification.terminate_session_notification
elif notification.HasField('layout_changed_notification'):
key = (None, api_pb2.NOTIFY_ON_LAYOUT_CHANGE)
notification = notification.layout_changed_notification
return key, notification
 
def _dispatch_handle_notification(notification):
def _run_handlers():
key, sub_notification = _extract(notification)
handlers = _subscriptions[key]
if handlers is not None:
for handler in handlers:
handler.handle(sub_notification)
logging.debug("Got a notification to dispatch. key=" + str(key) +", notification=\n" + str(notification))
if key in _subscriptions:
handlers = _subscriptions[key]
if handlers is not None:
for handler in handlers:
handler.handle(sub_notification)
_dispatch_queue.dispatch_async(_run_handlers)
 
def wait(timeout=None):
Loading
Loading
Loading
Loading
@@ -23,6 +23,7 @@ class TextSender(object):
def parse(self, response):
self.status = response.status
 
class AbstractSession(object):
def __repr__(self):
raise NotImplementedError("unimplemented")
Loading
Loading
@@ -30,6 +31,10 @@ class AbstractSession(object):
def get_session_id(self):
raise NotImplementedError("unimplemented")
 
def pretty_str(self, indent=""):
return indent + "Session id=%s\n" % self.get_session_id()
class FutureSession(AbstractSession):
def __init__(self, future):
self.future = future
Loading
Loading
Loading
Loading
@@ -19,6 +19,12 @@ class AbstractTab(object):
def get_sessions(self):
raise NotImplementedError("unimplemented")
 
def pretty_str(self, indent=""):
s = indent + "Tab id=%s\n" % self.get_tab_id()
for session in self.get_sessions():
s += session.pretty_str(indent=indent + " ")
return s
class FutureTab(AbstractTab):
def __init__(self, future):
self.future = future
Loading
Loading
Loading
Loading
@@ -13,6 +13,9 @@ class AbstractWindow(object):
def __repr__(self):
raise NotImplementedError("unimplemented")
 
def get_status(self):
raise NotImplementedError("unimplemented")
def get_window_id(self):
raise NotImplementedError("unimplemented")
 
Loading
Loading
@@ -22,6 +25,11 @@ class AbstractWindow(object):
def create_tab(self, profile=None, command=None, index=None):
raise NotImplementedError("unimplemented")
 
def pretty_str(self, indent=""):
s = indent + "Window id=%s\n" % self.get_window_id()
for t in self.get_tabs():
s += t.pretty_str(indent=indent + " ")
return s
 
class FutureWindow(AbstractWindow):
def __init__(self, future):
Loading
Loading
Loading
Loading
@@ -13,16 +13,9 @@ import time
 
import code, traceback, signal
 
def main():
#logging.basicConfig(level=logging.DEBUG)
logging.basicConfig()
def handle_new_session(notification):
print("New session created\n" + str(notification))
logging.debug("Register for new sessions")
it2notifications.NewSessionSubscription(handle_new_session)
debug = False
 
def create_windows_and_tabs():
logging.debug("Get hierarchy")
hierarchy = it2hierarchy.Hierarchy()
 
Loading
Loading
@@ -36,6 +29,7 @@ def main():
s2 = session.split_pane(vertical=True).split_pane()
s2.send_text("Hello world").get_status()
 
def read_keystrokes():
def handle_keystroke(notification):
print("Keypress\n" + str(notification))
 
Loading
Loading
@@ -43,6 +37,20 @@ def main():
while True:
it2notifications.wait(1)
 
def watch_hierarchy():
hierarchy = it2hierarchy.Hierarchy()
while True:
print(hierarchy.pretty_str())
it2notifications.wait(1)
def main():
if debug:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig()
watch_hierarchy()
if __name__ == "__main__":
main()
 
Loading
Loading
@@ -84,6 +84,8 @@ enum NotificationType {
 
// Notifications that ignore the `session` parameter.
NOTIFY_ON_NEW_SESSION = 6;
NOTIFY_ON_TERMINATE_SESSION = 7;
NOTIFY_ON_LAYOUT_CHANGE = 8;
}
 
message NotificationRequest {
Loading
Loading
@@ -112,9 +114,11 @@ message Notification {
optional KeystrokeNotification keystroke_notification = 1;
optional ScreenUpdateNotification screen_update_notification = 2;
optional PromptNotification prompt_notification = 3;
optional LocationChangeNotification location_change_notification=4;
optional CustomEscapeSequenceNotification custom_escape_sequence_notification=5;
optional NewSessionNotification new_session_notification=6;
optional LocationChangeNotification location_change_notification = 4;
optional CustomEscapeSequenceNotification custom_escape_sequence_notification = 5;
optional NewSessionNotification new_session_notification = 6;
optional TerminateSessionNotification terminate_session_notification = 7;
optional LayoutChangedNotification layout_changed_notification = 8;
}
 
message KeystrokeNotification {
Loading
Loading
@@ -155,10 +159,20 @@ message CustomEscapeSequenceNotification {
optional string payload = 3;
}
 
// Sent when a new session is created or a closure is undone.
message NewSessionNotification {
optional string uniqueIdentifier = 1;
}
 
// Note this is sent when a session is removed from the screen but its closure remains undoable.
message TerminateSessionNotification {
optional string uniqueIdentifier = 1;
}
message LayoutChangedNotification {
optional ListSessionsResponse list_sessions_response = 1;
}
// Requests the contents of a range of lines.
message GetBufferRequest {
// Leave this empty to use the current session, if any.
Loading
Loading
@@ -498,9 +512,11 @@ message SendTextResponse {
message ListSessionsResponse {
message Window {
repeated Tab tabs = 1;
optional string window_id = 2;
}
message Tab {
repeated Session sessions = 1;
optional string tab_id = 2;
}
message Session {
optional string uniqueIdentifier = 1;
Loading
Loading
Loading
Loading
@@ -10,6 +10,7 @@
#import "SplitSelectionView.h"
 
extern NSString *const iTermMovePaneDragType;
extern NSString *const iTermSessionDidChangeTabNotification;
 
@class PTYTab;
@class PTYSession;
Loading
Loading
Loading
Loading
@@ -14,6 +14,7 @@
#import "TmuxController.h"
 
NSString *const iTermMovePaneDragType = @"iTermDragPanePBType";
NSString *const iTermSessionDidChangeTabNotification = @"iTermSessionDidChangeTabNotification";
 
@implementation MovePaneController {
// If set then moving pane; otherwise swapping.
Loading
Loading
@@ -108,7 +109,9 @@ NSString *const iTermMovePaneDragType = @"iTermDragPanePBType";
[oldView autorelease];
[theTab numberOfSessionsDidChange];
[[term currentTab] numberOfSessionsDidChange];
}
[[NSNotificationCenter defaultCenter] postNotificationName:iTermSessionDidChangeTabNotification object:movingSession];
}
 
- (void)clearSession
{
Loading
Loading
@@ -183,6 +186,7 @@ NSString *const iTermMovePaneDragType = @"iTermDragPanePBType";
[[self.session tmuxController] swapPane:[self.session tmuxPane]
withPane:[dest tmuxPane]];
}
[[NSNotificationCenter defaultCenter] postNotificationName:iTermSessionDidChangeTabNotification object:self.session];
return YES;
}
 
Loading
Loading
@@ -217,6 +221,7 @@ NSString *const iTermMovePaneDragType = @"iTermDragPanePBType";
[destinationTab swapSession:dest withSession:session_];
[destinationTab checkInvariants:@"After swap"];
}
[[NSNotificationCenter defaultCenter] postNotificationName:iTermSessionDidChangeTabNotification object:self.session];
return YES;
}
 
Loading
Loading
Loading
Loading
@@ -28,6 +28,8 @@ extern NSString *const kPTYSessionTmuxFontDidChange;
extern NSString *const kPTYSessionCapturedOutputDidChange;
 
extern NSString *const PTYSessionCreatedNotification;
extern NSString *const PTYSessionTerminatedNotification;
extern NSString *const PTYSessionRevivedNotification;
 
@class CapturedOutput;
@class FakeWindow;
Loading
Loading
Loading
Loading
@@ -101,6 +101,8 @@ static NSString *const PTYSessionDidRepairSavedArrangement = @"PTYSessionDidRepa
static NSString *const kAskAboutOutdatedKeyMappingKeyFormat = @"AskAboutOutdatedKeyMappingForGuid%@";
 
NSString *const PTYSessionCreatedNotification = @"PTYSessionCreatedNotification";
NSString *const PTYSessionTerminatedNotification = @"PTYSessionTerminatedNotification";
NSString *const PTYSessionRevivedNotification = @"PTYSessionRevivedNotification";
 
NSString *const kPTYSessionTmuxFontDidChange = @"kPTYSessionTmuxFontDidChange";
NSString *const kPTYSessionCapturedOutputDidChange = @"kPTYSessionCapturedOutputDidChange";
Loading
Loading
@@ -1870,6 +1872,7 @@ ITERM_WEAKLY_REFERENCEABLE
[_pasteHelper abort];
 
[[_delegate realParentWindow] sessionDidTerminate:self];
[[NSNotificationCenter defaultCenter] postNotificationName:PTYSessionTerminatedNotification object:self];
 
_delegate = nil;
}
Loading
Loading
@@ -1945,6 +1948,7 @@ ITERM_WEAKLY_REFERENCEABLE
[[iTermSessionHotkeyController sharedInstance] setShortcut:shortcut forSession:self];
 
[_view autorelease]; // This balances a retain in -terminate prior to calling -makeTerminationUndoable
[[NSNotificationCenter defaultCenter] postNotificationName:PTYSessionRevivedNotification object:self];
return YES;
} else {
return NO;
Loading
Loading
@@ -9202,6 +9206,7 @@ ITERM_WEAKLY_REFERENCEABLE
break;
 
case ITMNotificationType_NotifyOnNewSession:
case ITMNotificationType_NotifyOnTerminateSession:
// We won't get called for this
assert(NO);
break;
Loading
Loading
Loading
Loading
@@ -16,6 +16,8 @@
@class TmuxController;
@class SolidColorView;
 
extern NSString *const iTermTabDidChangeWindowNotification;
// This implements NSSplitViewDelegate but it was an informal protocol in 10.5. If 10.5 support
// is eventually dropped, change this to make it official.
@interface PTYTab : NSObject <
Loading
Loading
Loading
Loading
@@ -30,6 +30,8 @@
 
#define PtyLog DLog
 
NSString *const iTermTabDidChangeWindowNotification = @"iTermTabDidChangeWindowNotification";
// No growl output/idle alerts for a few seconds after a window is resized because there will be bogus bg activity
const int POST_WINDOW_RESIZE_SILENCE_SEC = 5;
 
Loading
Loading
@@ -770,6 +772,9 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
 
- (void)setParentWindow:(NSWindowController<iTermWindowController> *)theParent {
// Parent holds a reference to us (indirectly) so we mustn't reference it.
if (parentWindow_ && theParent && parentWindow_ != theParent) {
[[NSNotificationCenter defaultCenter] postNotificationName:iTermTabDidChangeWindowNotification object:self];
}
parentWindow_ = realParentWindow_ = theParent;
[self updateFlexibleViewColors];
for (PTYSession *session in self.sessions) {
Loading
Loading
@@ -1220,7 +1225,6 @@ static void SetAgainstGrainDim(BOOL isVertical, NSSize *dest, CGFloat value) {
NSSplitView* parentSplit = (NSSplitView*)[node superview];
// 3. A non-root splitview's orientation must be the opposite of its parent's.
ITCriticalError([node isVertical] != [parentSplit isVertical], @"A non-root splitview's orientation must be the opposite of its parent's. %@", when);
assert([node isVertical] != [parentSplit isVertical]);
} else {
if ([[node subviews] count] == 1) {
NSView* onlyChild = [[node subviews] objectAtIndex:0];
Loading
Loading
Loading
Loading
@@ -29,6 +29,8 @@ extern NSString *const kCurrentSessionDidChange;
 
extern NSString *const iTermDidDecodeWindowRestorableStateNotification;
 
extern NSString *const iTermTabDidChangePositionInWindowNotification;
// This class is 1:1 with windows. It controls the tabs, the window's fulscreen
// status, and coordinates resizing of sessions (either session-initiated
// or window-initiated).
Loading
Loading
Loading
Loading
@@ -94,6 +94,7 @@
NSString *const kCurrentSessionDidChange = @"kCurrentSessionDidChange";
NSString *const kTerminalWindowControllerWasCreatedNotification = @"kTerminalWindowControllerWasCreatedNotification";
NSString *const iTermDidDecodeWindowRestorableStateNotification = @"iTermDidDecodeWindowRestorableStateNotification";
NSString *const iTermTabDidChangePositionInWindowNotification = @"iTermTabDidChangePositionInWindowNotification";
 
static NSString *const kWindowNameFormat = @"iTerm Window %d";
 
Loading
Loading
@@ -4712,6 +4713,7 @@ ITERM_WEAKLY_REFERENCEABLE
}
}
[controller setPartialWindowIdOrder:windowIds];
[[NSNotificationCenter defaultCenter] postNotificationName:iTermTabDidChangePositionInWindowNotification object:nil];
}
 
- (PTYTabView *)tabView
Loading
Loading
Loading
Loading
@@ -69,6 +69,7 @@
#import "iTermToolbeltView.h"
#import "iTermURLStore.h"
#import "iTermWarning.h"
#import "MovePaneController.h"
#import "NSApplication+iTerm.h"
#import "NSArray+iTerm.h"
#import "NSFileManager+iTerm.h"
Loading
Loading
@@ -194,6 +195,9 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
 
NSArray<NSDictionary *> *_buriedSessionsState;
NSMutableDictionary<id, ITMNotificationRequest *> *_newSessionSubscriptions;
NSMutableDictionary<id, ITMNotificationRequest *> *_terminateSessionSubscriptions;
NSMutableDictionary<id, ITMNotificationRequest *> *_layoutChangeSubscriptions;
BOOL _layoutChanged;
}
 
- (instancetype)init {
Loading
Loading
@@ -246,6 +250,27 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
selector:@selector(sessionCreated:)
name:PTYSessionCreatedNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(sessionCreated:)
name:PTYSessionRevivedNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(sessionDidTerminate:)
name:PTYSessionTerminatedNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(layoutChanged:)
name:iTermSessionDidChangeTabNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(layoutChanged:)
name:iTermTabDidChangeWindowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(layoutChanged:)
name:iTermTabDidChangePositionInWindowNotification
object:nil];
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
andSelector:@selector(getUrl:withReplyEvent:)
forEventClass:kInternetEventClass
Loading
Loading
@@ -263,6 +288,8 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
[[[NSWorkspace sharedWorkspace] notificationCenter] removeObserver:self];
[_appNapStoppingActivity release];
[_newSessionSubscriptions release];
[_layoutChangeSubscriptions release];
[_terminateSessionSubscriptions release];
[super dealloc];
}
 
Loading
Loading
@@ -1110,6 +1137,30 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
}];
}
 
- (void)layoutChanged:(NSNotification *)notification {
if (!_layoutChanged) {
_layoutChanged = YES;
dispatch_async(dispatch_get_main_queue(), ^{
_layoutChanged = NO;
[_layoutChangeSubscriptions enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, ITMNotificationRequest * _Nonnull obj, BOOL * _Nonnull stop) {
ITMNotification *notification = [[[ITMNotification alloc] init] autorelease];
notification.layoutChangedNotification.listSessionsResponse = [self newListSessionsResponse];
[[[iTermApplication sharedApplication] delegate] postAPINotification:notification toConnection:key];
}];
});
}
}
- (void)sessionDidTerminate:(NSNotification *)notification {
PTYSession *session = notification.object;
[_terminateSessionSubscriptions enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, ITMNotificationRequest * _Nonnull obj, BOOL * _Nonnull stop) {
ITMNotification *notification = [[[ITMNotification alloc] init] autorelease];
notification.terminateSessionNotification = [[[ITMTerminateSessionNotification alloc] init] autorelease];
notification.terminateSessionNotification.uniqueIdentifier = session.guid;
[[[iTermApplication sharedApplication] delegate] postAPINotification:notification toConnection:key];
}];
}
- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent {
NSString *urlStr = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
NSURL *url = [NSURL URLWithString:urlStr];
Loading
Loading
@@ -2309,19 +2360,31 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
}
if (!_newSessionSubscriptions) {
_newSessionSubscriptions = [[NSMutableDictionary alloc] init];
_terminateSessionSubscriptions = [[NSMutableDictionary alloc] init];
_layoutChangeSubscriptions = [[NSMutableDictionary alloc] init];
}
NSMutableDictionary<id, ITMNotificationRequest *> *subscriptions;
if (request.notificationType == ITMNotificationType_NotifyOnNewSession) {
subscriptions = _newSessionSubscriptions;
} else if (request.notificationType == ITMNotificationType_NotifyOnTerminateSession) {
subscriptions = _terminateSessionSubscriptions;
} else if (request.notificationType == ITMNotificationType_NotifyOnLayoutChange) {
subscriptions = _layoutChangeSubscriptions;
} else {
assert(false);
}
if (request.subscribe) {
if (_newSessionSubscriptions[connection]) {
if (subscriptions[connection]) {
response.status = ITMNotificationResponse_Status_AlreadySubscribed;
return response;
}
_newSessionSubscriptions[connection] = request;
subscriptions[connection] = request;
} else {
if (!_newSessionSubscriptions[connection]) {
if (!subscriptions[connection]) {
response.status = ITMNotificationResponse_Status_NotSubscribed;
return response;
}
[_newSessionSubscriptions removeObjectForKey:connection];
[subscriptions removeObjectForKey:connection];
}
 
response.status = ITMNotificationResponse_Status_Ok;
Loading
Loading
@@ -2331,7 +2394,9 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
- (void)apiServerNotification:(ITMNotificationRequest *)request
connection:(id)connection
handler:(void (^)(ITMNotificationResponse *))handler {
if (request.notificationType == ITMNotificationType_NotifyOnNewSession) {
if (request.notificationType == ITMNotificationType_NotifyOnNewSession ||
request.notificationType == ITMNotificationType_NotifyOnTerminateSession |
request.notificationType == ITMNotificationType_NotifyOnLayoutChange) {
handler([self handleAPINotificationRequest:request connection:connection]);
} else {
PTYSession *session = [self sessionForAPIIdentifier:request.hasSession ? request.session : nil];
Loading
Loading
@@ -2410,12 +2475,18 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
 
- (void)apiServerListSessions:(ITMListSessionsRequest *)request
handler:(void (^)(ITMListSessionsResponse *))handler {
handler([self newListSessionsResponse]);
}
- (ITMListSessionsResponse *)newListSessionsResponse {
ITMListSessionsResponse *response = [[[ITMListSessionsResponse alloc] init] autorelease];
for (PseudoTerminal *window in [[iTermController sharedInstance] terminals]) {
ITMListSessionsResponse_Window *windowMessage = [[[ITMListSessionsResponse_Window alloc] init] autorelease];
windowMessage.windowId = window.terminalGuid;
 
for (PTYTab *tab in window.tabs) {
ITMListSessionsResponse_Tab *tabMessage = [[[ITMListSessionsResponse_Tab alloc] init] autorelease];
tabMessage.tabId = [@(tab.uniqueId) stringValue];
 
for (PTYSession *session in tab.sessions) {
ITMListSessionsResponse_Session *sessionMessage = [[[ITMListSessionsResponse_Session alloc] init] autorelease];
Loading
Loading
@@ -2428,7 +2499,7 @@ static const NSTimeInterval kOneMonth = 30 * 24 * 60 * 60;
 
[response.windowsArray addObject:windowMessage];
}
handler(response);
return response;
}
 
- (void)apiServerSendText:(ITMSendTextRequest *)request handler:(void (^)(ITMSendTextResponse *))handler {
Loading
Loading
Loading
Loading
@@ -38,6 +38,7 @@ CF_EXTERN_C_BEGIN
@class ITMGetPromptRequest;
@class ITMGetPromptResponse;
@class ITMKeystrokeNotification;
@class ITMLayoutChangedNotification;
@class ITMLineContents;
@class ITMLineRange;
@class ITMListSessionsRequest;
Loading
Loading
@@ -61,6 +62,7 @@ CF_EXTERN_C_BEGIN
@class ITMSetProfilePropertyResponse;
@class ITMSplitPaneRequest;
@class ITMSplitPaneResponse;
@class ITMTerminateSessionNotification;
@class ITMTransactionRequest;
@class ITMTransactionResponse;
 
Loading
Loading
@@ -78,6 +80,8 @@ typedef GPB_ENUM(ITMNotificationType) {
 
/** Notifications that ignore the `session` parameter. */
ITMNotificationType_NotifyOnNewSession = 6,
ITMNotificationType_NotifyOnTerminateSession = 7,
ITMNotificationType_NotifyOnLayoutChange = 8,
};
 
GPBEnumDescriptor *ITMNotificationType_EnumDescriptor(void);
Loading
Loading
@@ -573,6 +577,8 @@ typedef GPB_ENUM(ITMNotification_FieldNumber) {
ITMNotification_FieldNumber_LocationChangeNotification = 4,
ITMNotification_FieldNumber_CustomEscapeSequenceNotification = 5,
ITMNotification_FieldNumber_NewSessionNotification = 6,
ITMNotification_FieldNumber_TerminateSessionNotification = 7,
ITMNotification_FieldNumber_LayoutChangedNotification = 8,
};
 
@interface ITMNotification : GPBMessage
Loading
Loading
@@ -601,6 +607,14 @@ typedef GPB_ENUM(ITMNotification_FieldNumber) {
/** Test to see if @c newSessionNotification has been set. */
@property(nonatomic, readwrite) BOOL hasNewSessionNotification;
 
@property(nonatomic, readwrite, strong, null_resettable) ITMTerminateSessionNotification *terminateSessionNotification;
/** Test to see if @c terminateSessionNotification has been set. */
@property(nonatomic, readwrite) BOOL hasTerminateSessionNotification;
@property(nonatomic, readwrite, strong, null_resettable) ITMLayoutChangedNotification *layoutChangedNotification;
/** Test to see if @c layoutChangedNotification has been set. */
@property(nonatomic, readwrite) BOOL hasLayoutChangedNotification;
@end
 
#pragma mark - ITMKeystrokeNotification
Loading
Loading
@@ -727,6 +741,9 @@ typedef GPB_ENUM(ITMNewSessionNotification_FieldNumber) {
ITMNewSessionNotification_FieldNumber_UniqueIdentifier = 1,
};
 
/**
* Sent when a new session is created or a closure is undone.
**/
@interface ITMNewSessionNotification : GPBMessage
 
@property(nonatomic, readwrite, copy, null_resettable) NSString *uniqueIdentifier;
Loading
Loading
@@ -735,6 +752,37 @@ typedef GPB_ENUM(ITMNewSessionNotification_FieldNumber) {
 
@end
 
#pragma mark - ITMTerminateSessionNotification
typedef GPB_ENUM(ITMTerminateSessionNotification_FieldNumber) {
ITMTerminateSessionNotification_FieldNumber_UniqueIdentifier = 1,
};
/**
* Note this is sent when a session is removed from the screen but its closure remains undoable.
**/
@interface ITMTerminateSessionNotification : GPBMessage
@property(nonatomic, readwrite, copy, null_resettable) NSString *uniqueIdentifier;
/** Test to see if @c uniqueIdentifier has been set. */
@property(nonatomic, readwrite) BOOL hasUniqueIdentifier;
@end
#pragma mark - ITMLayoutChangedNotification
typedef GPB_ENUM(ITMLayoutChangedNotification_FieldNumber) {
ITMLayoutChangedNotification_FieldNumber_ListSessionsResponse = 1,
};
@interface ITMLayoutChangedNotification : GPBMessage
@property(nonatomic, readwrite, strong, null_resettable) ITMListSessionsResponse *listSessionsResponse;
/** Test to see if @c listSessionsResponse has been set. */
@property(nonatomic, readwrite) BOOL hasListSessionsResponse;
@end
#pragma mark - ITMGetBufferRequest
 
typedef GPB_ENUM(ITMGetBufferRequest_FieldNumber) {
Loading
Loading
@@ -1301,6 +1349,7 @@ typedef GPB_ENUM(ITMListSessionsResponse_FieldNumber) {
 
typedef GPB_ENUM(ITMListSessionsResponse_Window_FieldNumber) {
ITMListSessionsResponse_Window_FieldNumber_TabsArray = 1,
ITMListSessionsResponse_Window_FieldNumber_WindowId = 2,
};
 
@interface ITMListSessionsResponse_Window : GPBMessage
Loading
Loading
@@ -1309,12 +1358,17 @@ typedef GPB_ENUM(ITMListSessionsResponse_Window_FieldNumber) {
/** The number of items in @c tabsArray without causing the array to be created. */
@property(nonatomic, readonly) NSUInteger tabsArray_Count;
 
@property(nonatomic, readwrite, copy, null_resettable) NSString *windowId;
/** Test to see if @c windowId has been set. */
@property(nonatomic, readwrite) BOOL hasWindowId;
@end
 
#pragma mark - ITMListSessionsResponse_Tab
 
typedef GPB_ENUM(ITMListSessionsResponse_Tab_FieldNumber) {
ITMListSessionsResponse_Tab_FieldNumber_SessionsArray = 1,
ITMListSessionsResponse_Tab_FieldNumber_TabId = 2,
};
 
@interface ITMListSessionsResponse_Tab : GPBMessage
Loading
Loading
@@ -1323,6 +1377,10 @@ typedef GPB_ENUM(ITMListSessionsResponse_Tab_FieldNumber) {
/** The number of items in @c sessionsArray without causing the array to be created. */
@property(nonatomic, readonly) NSUInteger sessionsArray_Count;
 
@property(nonatomic, readwrite, copy, null_resettable) NSString *tabId;
/** Test to see if @c tabId has been set. */
@property(nonatomic, readwrite) BOOL hasTabId;
@end
 
#pragma mark - ITMListSessionsResponse_Session
Loading
Loading
@@ -1440,6 +1498,10 @@ typedef GPB_ENUM(ITMSplitPaneResponse_FieldNumber) {
@property(nonatomic, readwrite) ITMSplitPaneResponse_Status status;
 
@property(nonatomic, readwrite) BOOL hasStatus;
/**
* TODO(gln): this will not be set for tmux integration because the split happens only if/when the
* tmux server acts on the request.
**/
@property(nonatomic, readwrite, copy, null_resettable) NSString *sessionId;
/** Test to see if @c sessionId has been set. */
@property(nonatomic, readwrite) BOOL hasSessionId;
Loading
Loading
Loading
Loading
@@ -52,7 +52,8 @@ GPBEnumDescriptor *ITMNotificationType_EnumDescriptor(void) {
"NotifyOnKeystroke\000NotifyOnScreenUpdate\000N"
"otifyOnPrompt\000NotifyOnLocationChange\000Not"
"ifyOnCustomEscapeSequence\000NotifyOnNewSes"
"sion\000";
"sion\000NotifyOnTerminateSession\000NotifyOnLa"
"youtChange\000";
static const int32_t values[] = {
ITMNotificationType_NotifyOnKeystroke,
ITMNotificationType_NotifyOnScreenUpdate,
Loading
Loading
@@ -60,6 +61,8 @@ GPBEnumDescriptor *ITMNotificationType_EnumDescriptor(void) {
ITMNotificationType_NotifyOnLocationChange,
ITMNotificationType_NotifyOnCustomEscapeSequence,
ITMNotificationType_NotifyOnNewSession,
ITMNotificationType_NotifyOnTerminateSession,
ITMNotificationType_NotifyOnLayoutChange,
};
GPBEnumDescriptor *worker =
[GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(ITMNotificationType)
Loading
Loading
@@ -82,6 +85,8 @@ BOOL ITMNotificationType_IsValidValue(int32_t value__) {
case ITMNotificationType_NotifyOnLocationChange:
case ITMNotificationType_NotifyOnCustomEscapeSequence:
case ITMNotificationType_NotifyOnNewSession:
case ITMNotificationType_NotifyOnTerminateSession:
case ITMNotificationType_NotifyOnLayoutChange:
return YES;
default:
return NO;
Loading
Loading
@@ -773,6 +778,8 @@ BOOL ITMNotificationResponse_Status_IsValidValue(int32_t value__) {
@dynamic hasLocationChangeNotification, locationChangeNotification;
@dynamic hasCustomEscapeSequenceNotification, customEscapeSequenceNotification;
@dynamic hasNewSessionNotification, newSessionNotification;
@dynamic hasTerminateSessionNotification, terminateSessionNotification;
@dynamic hasLayoutChangedNotification, layoutChangedNotification;
 
typedef struct ITMNotification__storage_ {
uint32_t _has_storage_[1];
Loading
Loading
@@ -782,6 +789,8 @@ typedef struct ITMNotification__storage_ {
ITMLocationChangeNotification *locationChangeNotification;
ITMCustomEscapeSequenceNotification *customEscapeSequenceNotification;
ITMNewSessionNotification *newSessionNotification;
ITMTerminateSessionNotification *terminateSessionNotification;
ITMLayoutChangedNotification *layoutChangedNotification;
} ITMNotification__storage_;
 
// This method is threadsafe because it is initially called
Loading
Loading
@@ -844,6 +853,24 @@ typedef struct ITMNotification__storage_ {
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
{
.name = "terminateSessionNotification",
.dataTypeSpecific.className = GPBStringifySymbol(ITMTerminateSessionNotification),
.number = ITMNotification_FieldNumber_TerminateSessionNotification,
.hasIndex = 6,
.offset = (uint32_t)offsetof(ITMNotification__storage_, terminateSessionNotification),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
{
.name = "layoutChangedNotification",
.dataTypeSpecific.className = GPBStringifySymbol(ITMLayoutChangedNotification),
.number = ITMNotification_FieldNumber_LayoutChangedNotification,
.hasIndex = 7,
.offset = (uint32_t)offsetof(ITMNotification__storage_, layoutChangedNotification),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[ITMNotification class]
Loading
Loading
@@ -1271,6 +1298,97 @@ typedef struct ITMNewSessionNotification__storage_ {
 
@end
 
#pragma mark - ITMTerminateSessionNotification
@implementation ITMTerminateSessionNotification
@dynamic hasUniqueIdentifier, uniqueIdentifier;
typedef struct ITMTerminateSessionNotification__storage_ {
uint32_t _has_storage_[1];
NSString *uniqueIdentifier;
} ITMTerminateSessionNotification__storage_;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = nil;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "uniqueIdentifier",
.dataTypeSpecific.className = NULL,
.number = ITMTerminateSessionNotification_FieldNumber_UniqueIdentifier,
.hasIndex = 0,
.offset = (uint32_t)offsetof(ITMTerminateSessionNotification__storage_, uniqueIdentifier),
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldTextFormatNameCustom),
.dataType = GPBDataTypeString,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[ITMTerminateSessionNotification class]
rootClass:[ITMApiRoot class]
file:ITMApiRoot_FileDescriptor()
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(ITMTerminateSessionNotification__storage_)
flags:GPBDescriptorInitializationFlag_None];
#if !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
static const char *extraTextFormatInfo =
"\001\001\020\000";
[localDescriptor setupExtraTextInfo:extraTextFormatInfo];
#endif // !GPBOBJC_SKIP_MESSAGE_TEXTFORMAT_EXTRAS
NSAssert(descriptor == nil, @"Startup recursed!");
descriptor = localDescriptor;
}
return descriptor;
}
@end
#pragma mark - ITMLayoutChangedNotification
@implementation ITMLayoutChangedNotification
@dynamic hasListSessionsResponse, listSessionsResponse;
typedef struct ITMLayoutChangedNotification__storage_ {
uint32_t _has_storage_[1];
ITMListSessionsResponse *listSessionsResponse;
} ITMLayoutChangedNotification__storage_;
// This method is threadsafe because it is initially called
// in +initialize for each subclass.
+ (GPBDescriptor *)descriptor {
static GPBDescriptor *descriptor = nil;
if (!descriptor) {
static GPBMessageFieldDescription fields[] = {
{
.name = "listSessionsResponse",
.dataTypeSpecific.className = GPBStringifySymbol(ITMListSessionsResponse),
.number = ITMLayoutChangedNotification_FieldNumber_ListSessionsResponse,
.hasIndex = 0,
.offset = (uint32_t)offsetof(ITMLayoutChangedNotification__storage_, listSessionsResponse),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeMessage,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[ITMLayoutChangedNotification class]
rootClass:[ITMApiRoot class]
file:ITMApiRoot_FileDescriptor()
fields:fields
fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription))
storageSize:sizeof(ITMLayoutChangedNotification__storage_)
flags:GPBDescriptorInitializationFlag_None];
NSAssert(descriptor == nil, @"Startup recursed!");
descriptor = localDescriptor;
}
return descriptor;
}
@end
#pragma mark - ITMGetBufferRequest
 
@implementation ITMGetBufferRequest
Loading
Loading
@@ -2478,10 +2596,12 @@ typedef struct ITMListSessionsResponse__storage_ {
@implementation ITMListSessionsResponse_Window
 
@dynamic tabsArray, tabsArray_Count;
@dynamic hasWindowId, windowId;
 
typedef struct ITMListSessionsResponse_Window__storage_ {
uint32_t _has_storage_[1];
NSMutableArray *tabsArray;
NSString *windowId;
} ITMListSessionsResponse_Window__storage_;
 
// This method is threadsafe because it is initially called
Loading
Loading
@@ -2499,6 +2619,15 @@ typedef struct ITMListSessionsResponse_Window__storage_ {
.flags = GPBFieldRepeated,
.dataType = GPBDataTypeMessage,
},
{
.name = "windowId",
.dataTypeSpecific.className = NULL,
.number = ITMListSessionsResponse_Window_FieldNumber_WindowId,
.hasIndex = 0,
.offset = (uint32_t)offsetof(ITMListSessionsResponse_Window__storage_, windowId),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeString,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[ITMListSessionsResponse_Window class]
Loading
Loading
@@ -2522,10 +2651,12 @@ typedef struct ITMListSessionsResponse_Window__storage_ {
@implementation ITMListSessionsResponse_Tab
 
@dynamic sessionsArray, sessionsArray_Count;
@dynamic hasTabId, tabId;
 
typedef struct ITMListSessionsResponse_Tab__storage_ {
uint32_t _has_storage_[1];
NSMutableArray *sessionsArray;
NSString *tabId;
} ITMListSessionsResponse_Tab__storage_;
 
// This method is threadsafe because it is initially called
Loading
Loading
@@ -2543,6 +2674,15 @@ typedef struct ITMListSessionsResponse_Tab__storage_ {
.flags = GPBFieldRepeated,
.dataType = GPBDataTypeMessage,
},
{
.name = "tabId",
.dataTypeSpecific.className = NULL,
.number = ITMListSessionsResponse_Tab_FieldNumber_TabId,
.hasIndex = 0,
.offset = (uint32_t)offsetof(ITMListSessionsResponse_Tab__storage_, tabId),
.flags = GPBFieldOptional,
.dataType = GPBDataTypeString,
},
};
GPBDescriptor *localDescriptor =
[GPBDescriptor allocDescriptorForClass:[ITMListSessionsResponse_Tab class]
Loading
Loading
@@ -2849,7 +2989,7 @@ typedef struct ITMSplitPaneRequest__storage_ {
.number = ITMSplitPaneRequest_FieldNumber_Before,
.hasIndex = 2,
.offset = 3, // Stored in _has_storage_ to save space.
.flags = GPBFieldOptional,
.flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldHasDefaultValue),
.dataType = GPBDataTypeBool,
},
{
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment