From fbd20ad6e488fb3b9efc1612fdffee6e672976c1 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Sun, 14 Jun 2026 02:43:45 +0300 Subject: feat: add plugin v1 system Add manifest-driven plugin actions, event hooks, pane entrypoints, link handlers, and host APIs. Support plugin link, GitHub install, build commands, installed plugin registry, pane movement, runtime context, and plugin docs. --- src/app/api/tabs.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/app/api/tabs.rs') diff --git a/src/app/api/tabs.rs b/src/app/api/tabs.rs index 7c7ad9d7..c88a00d1 100644 --- a/src/app/api/tabs.rs +++ b/src/app/api/tabs.rs @@ -52,6 +52,7 @@ impl App { cwd, focus, label, + env, } = params; let ws_idx = if let Some(workspace_id) = workspace_id { let Some(ws_idx) = self.parse_workspace_id(&workspace_id) else { @@ -74,6 +75,10 @@ impl App { let default_shell = self.state.default_shell.clone(); let scrollback_limit_bytes = self.state.pane_scrollback_limit_bytes; let host_terminal_theme = self.state.host_terminal_theme; + let extra_env = match super::env::normalize_launch_env(env) { + Ok(env) => env, + Err((code, message)) => return encode_error(id, &code, message), + }; let result = self .state .workspaces @@ -87,6 +92,7 @@ impl App { scrollback_limit_bytes, host_terminal_theme, crate::pane::PaneShellConfig::new(&default_shell, self.state.shell_mode), + extra_env, ) }); match result { @@ -195,6 +201,13 @@ impl App { }; let workspace_id = self.public_workspace_id(ws_idx); let terminal_ids = self.state.terminal_ids_for_tab(ws_idx, tab_idx); + let pane_ids = self + .state + .workspaces + .get(ws_idx) + .and_then(|ws| ws.tabs.get(tab_idx)) + .map(|tab| tab.layout.pane_ids()) + .unwrap_or_default(); let Some(ws) = self.state.workspaces.get_mut(ws_idx) else { return tab_not_found(id, &target.tab_id); }; @@ -212,6 +225,9 @@ impl App { format!("tab {} could not be closed", target.tab_id), ); } + for pane_id in pane_ids { + self.state.plugin_panes.remove(&pane_id); + } self.state.remove_unattached_terminal_ids(terminal_ids); self.shutdown_detached_terminal_runtimes(); self.schedule_session_save(); -- cgit v1.2.3