summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2022-10-06 06:46:18 +0000
committerGitHub <noreply@github.com>2022-10-06 06:46:18 +0000
commit6715f4629c664885e0800da76cd73ca470705b27 (patch)
tree08eb83fd3212df743f83ec8a9ed399956f926d51
parent46edc590ecda91cfb47456e46be4c618b35c8cc3 (diff)
Server: Remove `panic`s in `tab` module (#1748)
* utils/errors: Add `ToAnyhow` trait for converting `Result` types that don't satisfy `anyhow`s trait constraints (`Display + Send + Sync + 'static`) conveniently. An example of such a Result is the `SendError` returned from `send_to_plugins`, which sends `PluginInstruction`s as message type. One of the enum variants can contain a `mpsc::Sender`, which is `!Sync` and hence makes the whole `SendError` be `!Sync` in this case. Add an implementation for this case that takes the message and converts it into an error containing the message formatted as string, with the additional `ErrorContext` as anyhow context. * server/tab: Remove calls to `unwrap()` and apply error reporting via `anyhow` instead. Make all relevant functions return `Result`s where previously a panic could occur and attach error context. * server/screen: Modify `update_tab!` to accept an optional 4th parameter, a literal "?". If present, this will append a `?` to the given closure verbatim to handle/propagate errors from within the generated macro code. * server/screen: Handle new `Result`s from `Tab` and apply appropriate error context and propagate errors further up. * server/tab/unit: `unwrap` on new `Result`s * server/unit: Unwrap `Results` in screen tests * server/tab: Better message for ad-hoc errors created with `anyhow!`. Since these errors don't have an underlying cause, we describe the cause in the macro instead and then attach the error context as usual before `?`ing the error back up. * utils/cargo: Activate `anyhow`s "backtrace" feature to capture error backtraces at the error origins (i.e. where we first receive an error and convert it to a `anyhow::Error`). Since we propagate error back up the call stack now, the place where we `unwrap` on errors doesn't match the place where the error originated. Hence, the callstack, too, is quite misleading since it contains barely any references of the functions that triggered the error. As a consequence, we have 2 backtraces now when zellij crashes: One from `anyhow` (that is implicitly attached to anyhows error reports), and one from the custom panic handler (which is displayed through `miette`). * utils/errors: Separate stack traces in the output of miette. Since we record backtraces with `anyhow` now, we end up having two backtraces in the output: One from the `anyhow` error and one from the actual call to `panic`. Adds a comment explaining the situation and another "section" to the error output of miette: We print the backtrace from anyhow as "Stack backtrace", and the output from the panic handler as "Panic backtrace". We keep both for the (hopefully unlikely) case that the anyhow backtrace isn't existent, so we still have at least something to work with. * server/screen: Remove calls to `fatal` and leave the `panic`ing to the calling function instead. * server/screen: Remove needless macro which extended `active_tab!` by passing the client IDs to the closure. However, this isn't necessary because closures capture their environment already, and the client_id needn't be mutable. * server/screen: Handle unused result * server/screen: Reintroduce arcane macro that defaults to some default client_id if it isn't valid (e.g. when the ScreenInstruction is sent via CLI). * server/tab/unit: Unwrap new results
-rw-r--r--Cargo.lock3
-rw-r--r--zellij-server/src/screen.rs272
-rw-r--r--zellij-server/src/tab/mod.rs656
-rw-r--r--zellij-server/src/tab/unit/tab_integration_tests.rs876
-rw-r--r--zellij-server/src/tab/unit/tab_tests.rs565
-rw-r--r--zellij-server/src/unit/screen_tests.rs4
-rw-r--r--zellij-utils/Cargo.toml2
-rw-r--r--zellij-utils/src/errors.rs42
8 files changed, 1517 insertions, 903 deletions
diff --git a/Cargo.lock b/Cargo.lock
index ad8705d62..23049df6d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -40,6 +40,9 @@ name = "anyhow"
version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
+dependencies = [
+ "backtrace",
+]
[[package]]
name = "arc-swap"
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs
index 012cc5577..fcb1de8cf 100644
--- a/zellij-server/src/screen.rs
+++ b/zellij-server/src/screen.rs
@@ -40,8 +40,10 @@ use zellij_utils::{
///
/// - screen: An instance of `Screen` to operate on
/// - client_id: The client_id, usually taken from the `ScreenInstruction` that's being processed
-/// - closure: A closure satisfying `|tab: &mut Tab| -> ()`
-
+/// - closure: A closure satisfying `|tab: &mut Tab| -> ()` OR `|tab: &mut Tab| -> Result<T>` (see
+/// '?' below)
+/// - ?: A literal "?", to append a `?` to the closure when it returns a `Result` type. This
+/// argument is optional and not needed when the closure returns `()`
macro_rules! active_tab {
($screen:ident, $client_id:ident, $closure:expr) => {
if let Some(active_tab) = $screen.get_active_tab_mut($client_id) {
@@ -54,7 +56,16 @@ macro_rules! active_tab {
log::error!("Active tab not found for client id: {:?}", $client_id);
}
};
+ // Same as above, but with an added `?` for when the close returns a `Result` type.
+ ($screen:ident, $client_id:ident, $closure:expr, ?) => {
+ if let Some(active_tab) = $screen.get_active_tab_mut($client_id) {
+ $closure(active_tab)?;
+ } else {
+ log::error!("Active tab not found for client id: {:?}", $client_id);
+ }
+ };
}
+
macro_rules! active_tab_and_connected_client_id {
($screen:ident, $client_id:ident, $closure:expr) => {
match $screen.get_active_tab_mut($client_id) {
@@ -71,6 +82,30 @@ macro_rules! active_tab_and_connected_client_id {
log::error!("Active tab not found for client id: {:?}", $client_id);
},
}
+ } else {
+ log::error!("No client ids in screen found");
+ };
+ },
+ }
+ };
+ // Same as above, but with an added `?` for when the closure returns a `Result` type.
+ ($screen:ident, $client_id:ident, $closure:expr, ?) => {
+ match $screen.get_active_tab_mut($client_id) {
+ Some(active_tab) => {
+ $closure(active_tab, $client_id)?;
+ },
+ None => {
+ if let Some(client_id) = $screen.get_first_client_id() {
+ match $screen.get_active_tab_mut(client_id) {
+ Some(active_tab) => {
+ $closure(active_tab, client_id)?;
+ },
+ None => {
+ log::error!("Active tab not found for client id: {:?}", $client_id);
+ },
+ }
+ } else {
+ log::error!("No client ids in screen found");
};
},
}
@@ -393,32 +428,44 @@ impl Screen {
fn move_clients_from_closed_tab(
&mut self,
client_ids_and_mode_infos: Vec<(ClientId, ModeInfo)>,
- ) {
+ ) -> Result<()> {
+ let err_context = || "failed to move clients from closed tab".to_string();
+
if self.tabs.is_empty() {
log::error!(
"No tabs left, cannot move clients: {:?} from closed tab",
client_ids_and_mode_infos
);
- return;
+ return Ok(());
}
- let first_tab_index = *self.tabs.keys().next().unwrap();
+ let first_tab_index = *self
+ .tabs
+ .keys()
+ .next()
+ .context("screen contained no tabs")
+ .with_context(err_context)?;
for (client_id, client_mode_info) in client_ids_and_mode_infos {
let client_tab_history = self.tab_history.entry(client_id).or_insert_with(Vec::new);
if let Some(client_previous_tab) = client_tab_history.pop() {
if let Some(client_active_tab) = self.tabs.get_mut(&client_previous_tab) {
self.active_tab_indices
.insert(client_id, client_previous_tab);
- client_active_tab.add_client(client_id, Some(client_mode_info));
+ client_active_tab
+ .add_client(client_id, Some(client_mode_info))
+ .with_context(err_context)?;
continue;
}
}
self.active_tab_indices.insert(client_id, first_tab_index);
self.tabs
.get_mut(&first_tab_index)
- .unwrap()
- .add_client(client_id, Some(client_mode_info));
+ .with_context(err_context)?
+ .add_client(client_id, Some(client_mode_info))
+ .with_context(err_context)?;
}
+ Ok(())
}
+
fn move_clients_between_tabs(
&mut self,
source_tab_index: usize,
@@ -440,13 +487,18 @@ impl Screen {
.get_indexed_tab_mut(destination_tab_index)
.context("failed to get destination tab by index")
.with_context(err_context)?;
- destination_tab.add_multiple_clients(client_mode_info_in_source_tab);
- destination_tab.update_input_modes();
+ destination_tab
+ .add_multiple_clients(client_mode_info_in_source_tab)
+ .with_context(err_context)?;
+ destination_tab
+ .update_input_modes()
+ .with_context(err_context)?;
destination_tab.set_force_render();
- destination_tab.visible(true);
+ destination_tab.visible(true).with_context(err_context)?;
}
Ok(())
}
+
fn update_client_tab_focus(&mut self, client_id: ClientId, new_tab_index: usize) {
match self.active_tab_indices.remove(&client_id) {
Some(old_active_index) => {
@@ -498,7 +550,7 @@ impl Screen {
if let Some(current_tab) = self.get_indexed_tab_mut(current_tab_index) {
if current_tab.has_no_connected_clients() {
- current_tab.visible(false);
+ current_tab.visible(false).with_context(err_context)?;
}
} else {
log::error!("Tab index: {:?} not found", current_tab_index);
@@ -564,6 +616,7 @@ impl Screen {
fn close_tab_at_index(&mut self, tab_index: usize) -> Result<()> {
let err_context = || format!("failed to close tab at index {tab_index:?}");
+
let mut tab_to_close = self.tabs.remove(&tab_index).with_context(err_context)?;
let pane_ids = tab_to_close.get_all_pane_ids();
// below we don't check the result of sending the CloseTab instruction to the pty thread
@@ -581,13 +634,14 @@ impl Screen {
.with_context(err_context)
} else {
let client_mode_infos_in_closed_tab = tab_to_close.drain_connected_clients(None);
- self.move_clients_from_closed_tab(client_mode_infos_in_closed_tab);
+ self.move_clients_from_closed_tab(client_mode_infos_in_closed_tab)
+ .with_context(err_context)?;
let visible_tab_indices: HashSet<usize> =
self.active_tab_indices.values().copied().collect();
for t in self.tabs.values_mut() {
if visible_tab_indices.contains(&t.index) {
t.set_force_render();
- t.visible(true);
+ t.visible(true).with_context(err_context)?;
}
if t.position > tab_to_close.position {
t.position -= 1;
@@ -683,7 +737,8 @@ impl Screen {
for (tab_index, tab) in &mut self.tabs {
if tab.has_selectable_tiled_panes() {
let vte_overlay = overlay.generate_overlay(size);
- tab.render(&mut output, Some(vte_overlay));
+ tab.render(&mut output, Some(vte_overlay))
+ .context(err_context)?;
} else {
tabs_to_close.push(*tab_index);
}
@@ -793,13 +848,15 @@ impl Screen {
self.terminal_emulator_colors.clone(),
self.terminal_emulator_color_codes.clone(),
);
- tab.apply_layout(layout, new_pids, tab_index, client_id);
+ tab.apply_layout(layout, new_pids, tab_index, client_id)
+ .with_context(err_context)?;
if self.session_is_mirrored {
if let Some(active_tab) = self.get_active_tab_mut(client_id) {
let client_mode_infos_in_source_tab = active_tab.drain_connected_clients(None);
- tab.add_multiple_clients(client_mode_infos_in_source_tab);
+ tab.add_multiple_clients(client_mode_infos_in_source_tab)
+ .with_context(err_context)?;
if active_tab.has_no_connected_clients() {
- active_tab.visible(false);
+ active_tab.visible(false).with_context(err_context)?;
}
}
let all_connected_clients: Vec<ClientId> =
@@ -810,14 +867,15 @@ impl Screen {
} else if let Some(active_tab) = self.get_active_tab_mut(client_id) {
let client_mode_info_in_source_tab =
active_tab.drain_connected_clients(Some(vec![client_id]));
- tab.add_multiple_clients(client_mode_info_in_source_tab);
+ tab.add_multiple_clients(client_mode_info_in_source_tab)
+ .with_context(err_context)?;
if active_tab.has_no_connected_clients() {
- active_tab.visible(false);
+ active_tab.visible(false).with_context(err_context)?;
}
self.update_client_tab_focus(client_id, tab_index);
}
- tab.update_input_modes();
- tab.visible(true);
+ tab.update_input_modes().with_context(err_context)?;
+ tab.visible(true).with_context(err_context)?;
self.tabs.insert(tab_index, tab);
if !self.active_tab_indices.contains_key(&client_id) {
// this means this is a new client and we need to add it to our state properly
@@ -829,6 +887,10 @@ impl Screen {
}
pub fn add_client(&mut self, client_id: ClientId) -> Result<()> {
+ let err_context = |tab_index| {
+ format!("failed to attach client {client_id} to tab with index {tab_index}")
+ };
+
let mut tab_history = vec![];
if let Some((_first_client, first_tab_history)) = self.tab_history.iter().next() {
tab_history = first_tab_history.clone();
@@ -843,7 +905,7 @@ impl Screen {
} else if let Some(tab_index) = self.tabs.keys().next() {
tab_index.to_owned()
} else {
- panic!("Can't find a valid tab to attach client to!");
+ bail!("Can't find a valid tab to attach client to!");
};
self.active_tab_indices.insert(client_id, tab_index);
@@ -851,18 +913,20 @@ impl Screen {
self.tab_history.insert(client_id, tab_history);
self.tabs
.get_mut(&tab_index)
- .with_context(|| format!("Failed to attach client to tab with index {tab_index}"))?
- .add_client(client_id, None);
- Ok(())
+ .with_context(|| err_context(tab_index))?
+ .add_client(client_id, None)
+ .with_context(|| err_context(tab_index))
}
pub fn remove_client(&mut self, client_id: ClientId) -> Result<()> {
- self.tabs.iter_mut().for_each(|(_, tab)| {
+ let err_context = || format!("failed to remove client {client_id}");
+
+ for (_, tab) in self.tabs.iter_mut() {
tab.remove_client(client_id);
if tab.has_no_connected_clients() {
- tab.visible(false);
+ tab.visible(false).with_context(err_context)?;
}
- });
+ }
if self.active_tab_indices.contains_key(&client_id) {
self.active_tab_indices.remove(&client_id);
}
@@ -870,8 +934,7 @@ impl Screen {
self.tab_history.remove(&client_id);
}
self.connected_clients.borrow_mut().remove(&client_id);
- self.update_tabs()
- .with_context(|| format!("failed to remove client {client_id:?}"))
+ self.update_tabs().with_context(err_context)
}
pub fn update_tabs(&self) -> Result<()> {
@@ -908,12 +971,8 @@ impl Screen {
Some(*client_id),
Event::TabUpdate(tab_data),
))
- .or_else(|err| {
- let (_, error_context) = err.0;
- Err(anyhow!("failed to send data to plugins"))
- .context(error_context)
- .context("failed to update tabs")
- })?;
+ .to_anyhow()
+ .context("failed to update tabs")?;
}
Ok(())
}
@@ -978,13 +1037,20 @@ impl Screen {
}
}
- pub fn change_mode(&mut self, mode_info: ModeInfo, client_id: ClientId) {
+ pub fn change_mode(&mut self, mode_info: ModeInfo, client_id: ClientId) -> Result<()> {
let previous_mode = self
.mode_info
.get(&client_id)
.unwrap_or(&self.default_mode_info)
.mode;
+ let err_context = || {
+ format!(
+ "failed to change from mode '{:?}' to mode '{:?}' for client {client_id}",
+ previous_mode, mode_info.mode
+ )
+ };
+
// If we leave the Search-related modes, we need to clear all previous searches
let search_related_modes = [InputMode::EnterSearch, InputMode::Search, InputMode::Scroll];
if search_related_modes.contains(&previous_mode)
@@ -997,7 +1063,9 @@ impl Screen {
&& (mode_info.mode == InputMode::Normal || mode_info.mode == InputMode::Locked)
{
if let Some(active_tab) = self.get_active_tab_mut(client_id) {
- active_tab.clear_active_terminal_scroll(client_id);
+ active_tab
+ .clear_active_terminal_scroll(client_id)
+ .with_context(err_context)?;
}
}
@@ -1023,16 +1091,27 @@ impl Screen {
tab.change_mode_info(mode_info.clone(), client_id);
tab.mark_active_pane_for_rerender(client_id);
}
+ Ok(())
}
- pub fn change_mode_for_all_clients(&mut self, mode_info: ModeInfo) {
+
+ pub fn change_mode_for_all_clients(&mut self, mode_info: ModeInfo) -> Result<()> {
+ let err_context = || {
+ format!(
+ "failed to change input mode to {:?} for all clients",
+ mode_info.mode
+ )
+ };
+
let connected_client_ids: Vec<ClientId> = self.active_tab_indices.keys().copied().collect();
for client_id in connected_client_ids {
- self.change_mode(mode_info.clone(), client_id);
+ self.change_mode(mode_info.clone(), client_id)
+ .with_context(err_context)?;
if let Some(os_input) = &mut self.bus.os_input {
let _ = os_input
.send_to_client(client_id, ServerToClientMsg::SwitchToMode(mode_info.mode));
}
}
+ Ok(())
}
pub fn move_focus_left_or_previous_tab(&mut self, client_id: ClientId) -> Result<()> {
let client_id = if self.get_active_tab(client_id).is_some() {
@@ -1131,8 +1210,7 @@ pub(crate) fn screen_thread_main(
let (event, mut err_ctx) = screen
.bus
.recv()
- .context("failed to receive event on channel")
- .fatal();
+ .context("failed to receive event on channel")?;
err_ctx.add_call(ContextType::Screen((&event).into()));
match event {
@@ -1140,7 +1218,8 @@ pub(crate) fn screen_thread_main(
let all_tabs = screen.get_tabs_mut();
for tab in all_tabs.values_mut() {
if tab.has_terminal_pid(pid) {
- tab.handle_pty_bytes(pid, vte_bytes);
+ tab.handle_pty_bytes(pid, vte_bytes)
+ .context("failed to process pty bytes")?;
break;
}
}
@@ -1151,15 +1230,14 @@ pub(crate) fn screen_thread_main(
ScreenInstruction::NewPane(pid, client_or_tab_index) => {
match client_or_tab_index {
ClientOrTabIndex::ClientId(client_id) => {
- active_tab_and_connected_client_id!(
- screen,
- client_id,
- |tab: &mut Tab, client_id: ClientId| tab.new_pane(pid, Some(client_id))
- );
+ active_tab_and_connected_client_id!(screen, client_id, |tab: &mut Tab,
+ client_id: ClientId| tab .new_pane(pid,
+ Some(client_id)),
+ ?);
},
ClientOrTabIndex::TabIndex(tab_index) => {
if let Some(active_tab) = screen.tabs.get_mut(&tab_index) {
- active_tab.new_pane(pid, None);
+ active_tab.new_pane(pid, None)?;
} else {
log::error!("Tab index not found: {:?}", tab_index);
}
@@ -1172,32 +1250,26 @@ pub(crate) fn screen_thread_main(
},
ScreenInstruction::OpenInPlaceEditor(pid, client_id) => {
active_tab!(screen, client_id, |tab: &mut Tab| tab
- .suppress_active_pane(pid, client_id));
+ .suppress_active_pane(pid, client_id), ?);
screen.unblock_input()?;
screen.update_tabs()?;
screen.render()?;
},
ScreenInstruction::TogglePaneEmbedOrFloating(client_id) => {
- active_tab_and_connected_client_id!(
- screen,
- client_id,
- |tab: &mut Tab, client_id: ClientId| tab
- .toggle_pane_embed_or_floating(client_id)
- );
+ active_tab_and_connected_client_id!(screen, client_id, |tab: &mut Tab, client_id: ClientId| tab
+ .toggle_pane_embed_or_floating(client_id), ?);
screen.unblock_input()?;
screen.update_tabs()?; // update tabs so that the ui indication will be send to the plugins
+
screen.render()?;
},
ScreenInstruction::ToggleFloatingPanes(client_id, default_shell) => {
- active_tab_and_connected_client_id!(
- screen,
- client_id,
- |tab: &mut Tab, client_id: ClientId| tab
- .toggle_floating_panes(client_id, default_shell)
- );
+ active_tab_and_connected_client_id!(screen, client_id, |tab: &mut Tab, client_id: ClientId| tab
+ .toggle_floating_panes(client_id, default_shell), ?);
screen.unblock_input()?;
screen.update_tabs()?; // update tabs so that the ui indication will be send to the plugins
+
screen.render()?;
},
ScreenInstruction::ShowFloatingPanes(client_id) => {
@@ -1208,6 +1280,7 @@ pub(crate) fn screen_thread_main(
);
screen.unblock_input()?;
screen.update_tabs()?; // update tabs so that the ui indication will be send to the plugins
+
screen.render()?;
},
ScreenInstruction::HideFloatingPanes(client_id) => {
@@ -1218,13 +1291,15 @@ pub(crate) fn screen_thread_main(
);
screen.unblock_input()?;
screen.update_tabs()?; // update tabs so that the ui indication will be send to the plugins
+
screen.render()?;
},
ScreenInstruction::HorizontalSplit(pid, client_id) => {
active_tab_and_connected_client_id!(
screen,
client_id,
- |tab: &mut Tab, client_id: ClientId| tab.horizontal_split(pid, client_id)
+ |tab: &mut Tab, client_id: ClientId| tab.horizontal_split(pid, client_id),
+ ?
);
screen.unblock_input()?;
screen.update_tabs()?;
@@ -1234,7 +1309,8 @@ pub(crate) fn screen_thread_main(
active_tab_and_connected_client_id!(
screen,
client_id,
- |tab: &mut Tab, client_id: ClientId| tab.vertical_split(pid, client_id)
+ |tab: &mut Tab, client_id: ClientId| tab.vertical_split(pid, client_id),
+ ?
);
screen.unblock_input()?;
screen.update_tabs()?;
@@ -1249,7 +1325,8 @@ pub(crate) fn screen_thread_main(
true => tab.write_to_terminals_on_current_tab(bytes),
false => tab.write_to_active_terminal(bytes, client_id),
}
- }
+ },
+ ?
);
},
ScreenInstruction::ResizeLeft(client_id) => {
@@ -1393,7 +1470,8 @@ pub(crate) fn screen_thread_main(
active_tab_and_connected_client_id!(
screen,
client_id,
- |tab: &mut Tab, client_id: ClientId| tab.edit_scrollback(client_id)
+ |tab: &mut Tab, client_id: ClientId| tab.edit_scrollback(client_id),
+ ?
);
screen.render()?;
},
@@ -1456,7 +1534,7 @@ pub(crate) fn screen_thread_main(
screen,
client_id,
|tab: &mut Tab, client_id: ClientId| tab
- .handle_scrollwheel_up(&point, 3, client_id)
+ .handle_scrollwheel_up(&point, 3, client_id), ?
);
screen.render()?;
screen.unblock_input()?;
@@ -1465,7 +1543,7 @@ pub(crate) fn screen_thread_main(
active_tab_and_connected_client_id!(
screen,
client_id,
- |tab: &mut Tab, client_id: ClientId| tab.scroll_active_terminal_down(client_id)
+ |tab: &mut Tab, client_id: ClientId| tab.scroll_active_terminal_down(client_id), ?
);
screen.render()?;
screen.unblock_input()?;
@@ -1475,7 +1553,7 @@ pub(crate) fn screen_thread_main(
screen,
client_id,
|tab: &mut Tab, client_id: ClientId| tab
- .handle_scrollwheel_down(&point, 3, client_id)
+ .handle_scrollwheel_down(&point, 3, client_id), ?
);
screen.render()?;
screen.unblock_input()?;
@@ -1485,7 +1563,7 @@ pub(crate) fn screen_thread_main(
screen,
client_id,
|tab: &mut Tab, client_id: ClientId| tab
- .scroll_active_terminal_to_bottom(client_id)
+ .scroll_active_terminal_to_bottom(client_id), ?
);
screen.render()?;
screen.unblock_input()?;
@@ -1505,7 +1583,7 @@ pub(crate) fn screen_thread_main(
screen,
client_id,
|tab: &mut Tab, client_id: ClientId| tab
- .scroll_active_terminal_down_page(client_id)
+ .scroll_active_terminal_down_page(client_id), ?
);
screen.render()?;
screen.unblock_input()?;
@@ -1525,7 +1603,7 @@ pub(crate) fn screen_thread_main(
screen,
client_id,
|tab: &mut Tab, client_id: ClientId| tab
- .scroll_active_terminal_down_half_page(client_id)
+ .scroll_active_terminal_down_half_page(client_id), ?
);
screen.render()?;
screen.unblock_input()?;
@@ -1535,7 +1613,7 @@ pub(crate) fn screen_thread_main(
screen,
client_id,
|tab: &mut Tab, client_id: ClientId| tab
- .clear_active_termina