diff options
author | Aram Drevekenin <aram@poor.dev> | 2023-02-26 15:38:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-26 15:38:52 +0100 |
commit | c41dfa33df0427fc683a9552853493bc67472e3a (patch) | |
tree | dfb34b5247479d72eb9f0b3ee24929667549e898 /zellij-server/src/tab | |
parent | c5929d45bf37924611010c1e82ee5ca140998c1b (diff) |
fix(messaging): cache hold pane messages by their tab_id if the tab is not ready (#2196)
* fix(messaging): cache hold pane messages by their tab_id if the tab is not ready
* style(fmt): rustfmt
Diffstat (limited to 'zellij-server/src/tab')
-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); |