aboutsummaryrefslogtreecommitdiff
path: root/src/app/api/tabs.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-14 02:43:45 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-14 03:47:07 +0300
commitfbd20ad6e488fb3b9efc1612fdffee6e672976c1 (patch)
treed21daf93241786f8aa6fde23b41cdb9e15182b79 /src/app/api/tabs.rs
parentd35c642ef36ee5ac2afe7c1b18ad5a717bc807d8 (diff)
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.
Diffstat (limited to 'src/app/api/tabs.rs')
-rw-r--r--src/app/api/tabs.rs16
1 files changed, 16 insertions, 0 deletions
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();