diff options
Diffstat (limited to 'zellij-server/src/tab/mod.rs')
-rw-r--r-- | zellij-server/src/tab/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs index 8a8133103..9e11fdfdf 100644 --- a/zellij-server/src/tab/mod.rs +++ b/zellij-server/src/tab/mod.rs @@ -89,6 +89,7 @@ type HoldForCommand = Option<RunCommand>; enum BufferedTabInstruction { SetPaneSelectable(PaneId, bool), HandlePtyBytes(u32, VteBytes), + HoldPane(PaneId, Option<i32>, bool, RunCommand), // Option<i32> is the exit status, bool is is_first_run } pub(crate) struct Tab { @@ -737,6 +738,14 @@ impl Tab { BufferedTabInstruction::HandlePtyBytes(terminal_id, bytes) => { self.handle_pty_bytes(terminal_id, bytes)?; }, + BufferedTabInstruction::HoldPane( + terminal_id, + exit_status, + is_first_run, + run_command, + ) => { + self.hold_pane(terminal_id, exit_status, is_first_run, run_command); + }, } } Ok(()) @@ -2145,6 +2154,16 @@ impl Tab { is_first_run: bool, run_command: RunCommand, ) { + if self.is_pending { + self.pending_instructions + .push(BufferedTabInstruction::HoldPane( + id, + exit_status, + is_first_run, + run_command, + )); + return; + } if self.floating_panes.panes_contain(&id) { self.floating_panes .hold_pane(id, exit_status, is_first_run, run_command); |