From f7a7da03fc27cc6fe4e6a44dabddcd303f939bb9 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Fri, 12 Jun 2026 19:07:07 +0300 Subject: fix: stabilize public pane and tab ids refs #569 --- src/pane.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/pane.rs') diff --git a/src/pane.rs b/src/pane.rs index 64fbf32b..601334d9 100644 --- a/src/pane.rs +++ b/src/pane.rs @@ -1323,6 +1323,7 @@ impl PaneRuntime { events: mpsc::Sender, render_notify: Arc, render_dirty: Arc, + public_pane_id: Option<&str>, ) -> std::io::Result { Self::spawn_with_initial_history( pane_id, @@ -1336,9 +1337,12 @@ impl PaneRuntime { events, render_notify, render_dirty, + public_pane_id, ) } + // Runtime construction needs to thread PTY size, environment, theme, and render hooks together. + #[allow(clippy::too_many_arguments)] pub(crate) fn spawn_with_initial_history( pane_id: PaneId, rows: u16, @@ -1351,12 +1355,13 @@ impl PaneRuntime { events: mpsc::Sender, render_notify: Arc, render_dirty: Arc, + public_pane_id: Option<&str>, ) -> std::io::Result { let mut cmd = pane_shell_command_builder(shell_config)?; cmd.cwd(cwd); cmd.env(crate::HERDR_ENV_VAR, crate::HERDR_ENV_VALUE); apply_pane_terminal_env(&mut cmd); - crate::integration::apply_pane_env(&mut cmd, pane_id); + crate::integration::apply_pane_env(&mut cmd, pane_id, public_pane_id); Self::spawn_command_builder( pane_id, rows, @@ -1375,6 +1380,8 @@ impl PaneRuntime { ) } + // Runtime construction needs to thread PTY size, environment, theme, and render hooks together. + #[allow(clippy::too_many_arguments)] pub fn spawn_shell_command( pane_id: PaneId, rows: u16, @@ -1387,6 +1394,7 @@ impl PaneRuntime { events: mpsc::Sender, render_notify: Arc, render_dirty: Arc, + public_pane_id: Option<&str>, ) -> std::io::Result { let mut cmd = CommandBuilder::new("/bin/sh"); cmd.arg("-c"); @@ -1394,7 +1402,7 @@ impl PaneRuntime { cmd.cwd(cwd); cmd.env(crate::HERDR_ENV_VAR, crate::HERDR_ENV_VALUE); apply_pane_terminal_env(&mut cmd); - crate::integration::apply_pane_env(&mut cmd, pane_id); + crate::integration::apply_pane_env(&mut cmd, pane_id, public_pane_id); for (key, value) in extra_env { cmd.env(key, value); } @@ -1424,6 +1432,7 @@ impl PaneRuntime { events: mpsc::Sender, render_notify: Arc, render_dirty: Arc, + public_pane_id: Option<&str>, ) -> std::io::Result { let Some((program, args)) = argv.split_first() else { return Err(std::io::Error::new( @@ -1438,7 +1447,7 @@ impl PaneRuntime { cmd.cwd(cwd); cmd.env(crate::HERDR_ENV_VAR, crate::HERDR_ENV_VALUE); apply_pane_terminal_env(&mut cmd); - crate::integration::apply_pane_env(&mut cmd, pane_id); + crate::integration::apply_pane_env(&mut cmd, pane_id, public_pane_id); Self::spawn_command_builder( pane_id, rows, -- cgit v1.2.3