From fd1e3b8b056b2937fc0a5c90bf482e01d269f6b2 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 29 Mar 2026 04:23:22 +0300 Subject: feat: add initial socket api for workspace and pane control add unix socket request/response api scaffolding implement initial workspace and pane commands: - ping - workspace.list - workspace.get - workspace.create - pane.list - pane.get - pane.read - pane.send_text - pane.send_keys - pane.wait_for_output improve pane read semantics: - visible trims trailing blank viewport rows - recent reads from parser scrollback/current screen - wait_for_output returns matched snapshot plus matched_line add real subprocess integration tests for socket api --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 6bcaa111..e3c54541 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,6 +18,7 @@ const NESTED_HERDR_MESSAGES: [&str; 6] = [ "recursion detected. base case not found. aborting.", ]; +mod api; mod app; mod config; mod detect; @@ -223,6 +224,9 @@ fn main() -> io::Result<()> { init_logging(); + let (api_tx, api_rx) = std::sync::mpsc::channel(); + let _api_server = api::start_server(api_tx)?; + let no_session = std::env::args().any(|a| a == "--no-session"); let in_tmux = std::env::var("TMUX").is_ok(); @@ -284,7 +288,7 @@ fn main() -> io::Result<()> { std::io::stdout().flush()?; } - let mut app = app::App::new(config, no_session, config_diagnostic); + let mut app = app::App::new(config, no_session, config_diagnostic, api_rx); let result = app.run(&mut terminal).await; // Reset modifyOtherKeys if we enabled it -- cgit v1.2.3