performance(rendering): improve rendering performance (#1960)

* refactor(plugins): plugins now need to explicitly ask to be rendered

* performance(render): remove various needless renders

* performance(render): cache boundaries

* performance(render): adjust tests and cache cursor location/shape

* style(comment): remove outdated

* style(fmt): rustfmt
This commit is contained in:
Aram Drevekenin 2022-11-21 20:07:24 +01:00 committed by GitHub
parent 5ad0429adc
commit 63e7531c48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
77 changed files with 755 additions and 774 deletions

View file

@ -22,7 +22,7 @@ struct State {
active_tab_idx: usize, active_tab_idx: usize,
mode_info: ModeInfo, mode_info: ModeInfo,
mouse_click_pos: usize, mouse_click_pos: usize,
should_render: bool, should_change_tab: bool,
} }
static ARROW_SEPARATOR: &str = ""; static ARROW_SEPARATOR: &str = "";
@ -39,13 +39,23 @@ impl ZellijPlugin for State {
]); ]);
} }
fn update(&mut self, event: Event) { fn update(&mut self, event: Event) -> bool {
let mut should_render = false;
match event { match event {
Event::ModeUpdate(mode_info) => self.mode_info = mode_info, Event::ModeUpdate(mode_info) => {
if self.mode_info != mode_info {
should_render = true;
}
self.mode_info = mode_info
},
Event::TabUpdate(tabs) => { Event::TabUpdate(tabs) => {
if let Some(active_tab_index) = tabs.iter().position(|t| t.active) { if let Some(active_tab_index) = tabs.iter().position(|t| t.active) {
// tabs are indexed starting from 1 so we need to add 1 // tabs are indexed starting from 1 so we need to add 1
self.active_tab_idx = active_tab_index + 1; let active_tab_idx = active_tab_index + 1;
if self.active_tab_idx != active_tab_idx || self.tabs != tabs {
should_render = true;
}
self.active_tab_idx = active_tab_idx;
self.tabs = tabs; self.tabs = tabs;
} else { } else {
eprintln!("Could not find active tab."); eprintln!("Could not find active tab.");
@ -53,13 +63,18 @@ impl ZellijPlugin for State {
}, },
Event::Mouse(me) => match me { Event::Mouse(me) => match me {
Mouse::LeftClick(_, col) => { Mouse::LeftClick(_, col) => {
if self.mouse_click_pos != col {
should_render = true;
self.should_change_tab = true;
}
self.mouse_click_pos = col; self.mouse_click_pos = col;
self.should_render = true;
}, },
Mouse::ScrollUp(_) => { Mouse::ScrollUp(_) => {
should_render = true;
switch_tab_to(min(self.active_tab_idx + 1, self.tabs.len()) as u32); switch_tab_to(min(self.active_tab_idx + 1, self.tabs.len()) as u32);
}, },
Mouse::ScrollDown(_) => { Mouse::ScrollDown(_) => {
should_render = true;
switch_tab_to(max(self.active_tab_idx.saturating_sub(1), 1) as u32); switch_tab_to(max(self.active_tab_idx.saturating_sub(1), 1) as u32);
}, },
_ => {}, _ => {},
@ -67,7 +82,8 @@ impl ZellijPlugin for State {
_ => { _ => {
eprintln!("Got unrecognized event: {:?}", event); eprintln!("Got unrecognized event: {:?}", event);
}, },
} };
should_render
} }
fn render(&mut self, _rows: usize, cols: usize) { fn render(&mut self, _rows: usize, cols: usize) {
@ -111,7 +127,7 @@ impl ZellijPlugin for State {
for bar_part in tab_line { for bar_part in tab_line {
s = format!("{}{}", s, &bar_part.part); s = format!("{}{}", s, &bar_part.part);
if self.should_render if self.should_change_tab
&& self.mouse_click_pos >= len_cnt && self.mouse_click_pos >= len_cnt
&& self.mouse_click_pos < len_cnt + bar_part.len && self.mouse_click_pos < len_cnt + bar_part.len
&& bar_part.tab_index.is_some() && bar_part.tab_index.is_some()
@ -134,6 +150,6 @@ impl ZellijPlugin for State {
print!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color); print!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color);
}, },
} }
self.should_render = false; self.should_change_tab = false;
} }
} }

View file

@ -182,26 +182,50 @@ impl ZellijPlugin for State {
]); ]);
} }
fn update(&mut self, event: Event) { fn update(&mut self, event: Event) -> bool {
let mut should_render = false;
match event { match event {
Event::ModeUpdate(mode_info) => { Event::ModeUpdate(mode_info) => {
if self.mode_info != mode_info {
should_render = true;
}
self.mode_info = mode_info; self.mode_info = mode_info;
}, },
Event::TabUpdate(tabs) => { Event::TabUpdate(tabs) => {
if self.tabs != tabs {
should_render = true;
}
self.tabs = tabs; self.tabs = tabs;
}, },
Event::CopyToClipboard(copy_destination) => { Event::CopyToClipboard(copy_destination) => {
match self.text_copy_destination {
Some(text_copy_destination) => {
if text_copy_destination != copy_destination {
should_render = true;
}
},
None => {
should_render = true;
},
}
self.text_copy_destination = Some(copy_destination); self.text_copy_destination = Some(copy_destination);
}, },
Event::SystemClipboardFailure => { Event::SystemClipboardFailure => {
should_render = true;
self.display_system_clipboard_failure = true; self.display_system_clipboard_failure = true;
}, },
Event::InputReceived => { Event::InputReceived => {
if self.text_copy_destination.is_some()
|| self.display_system_clipboard_failure == true
{
should_render = true;
}
self.text_copy_destination = None; self.text_copy_destination = None;
self.display_system_clipboard_failure = false; self.display_system_clipboard_failure = false;
}, },
_ => {}, _ => {},
} };
should_render
} }
fn render(&mut self, rows: usize, cols: usize) { fn render(&mut self, rows: usize, cols: usize) {

View file

@ -13,7 +13,8 @@ impl ZellijPlugin for State {
subscribe(&[EventType::Key, EventType::Mouse]); subscribe(&[EventType::Key, EventType::Mouse]);
} }
fn update(&mut self, event: Event) { fn update(&mut self, event: Event) -> bool {
let mut should_render = false;
let prev_event = if self.ev_history.len() == 2 { let prev_event = if self.ev_history.len() == 2 {
self.ev_history.pop_front() self.ev_history.pop_front()
} else { } else {
@ -23,13 +24,22 @@ impl ZellijPlugin for State {
match event { match event {
Event::Key(key) => match key { Event::Key(key) => match key {
Key::Up | Key::Char('k') => { Key::Up | Key::Char('k') => {
let currently_selected = self.selected();
*self.selected_mut() = self.selected().saturating_sub(1); *self.selected_mut() = self.selected().saturating_sub(1);
if currently_selected != self.selected() {
should_render = true;
}
}, },
Key::Down | Key::Char('j') => { Key::Down | Key::Char('j') => {
let currently_selected = self.selected();
let next = self.selected().saturating_add(1); let next = self.selected().saturating_add(1);
*self.selected_mut() = min(self.files.len().saturating_sub(1), next); *self.selected_mut() = min(self.files.len().saturating_sub(1), next);
if currently_selected != self.selected() {
should_render = true;
}
}, },
Key::Right | Key::Char('\n') | Key::Char('l') if !self.files.is_empty() => { Key::Right | Key::Char('\n') | Key::Char('l') if !self.files.is_empty() => {
should_render = true;
self.traverse_dir_or_open_file(); self.traverse_dir_or_open_file();
self.ev_history.clear(); self.ev_history.clear();
}, },
@ -39,11 +49,13 @@ impl ZellijPlugin for State {
// the reason this is a hard-coded number (2) and not "== ROOT" // the reason this is a hard-coded number (2) and not "== ROOT"
// or some such is that there are certain cases in which self.path // or some such is that there are certain cases in which self.path
// is empty and this will work then too // is empty and this will work then too
should_render = true;
self.path.pop(); self.path.pop();
refresh_directory(self); refresh_directory(self);
} }
}, },
Key::Char('.') => { Key::Char('.') => {
should_render = true;
self.toggle_hidden_files(); self.toggle_hidden_files();
refresh_directory(self); refresh_directory(self);
}, },
@ -52,15 +64,23 @@ impl ZellijPlugin for State {
}, },
Event::Mouse(mouse_event) => match mouse_event { Event::Mouse(mouse_event) => match mouse_event {
Mouse::ScrollDown(_) => { Mouse::ScrollDown(_) => {
let currently_selected = self.selected();
let next = self.selected().saturating_add(1); let next = self.selected().saturating_add(1);
*self.selected_mut() = min(self.files.len().saturating_sub(1), next); *self.selected_mut() = min(self.files.len().saturating_sub(1), next);
if currently_selected != self.selected() {
should_render = true;
}
}, },
Mouse::ScrollUp(_) => { Mouse::ScrollUp(_) => {
let currently_selected = self.selected();
*self.selected_mut() = self.selected().saturating_sub(1); *self.selected_mut() = self.selected().saturating_sub(1);
if currently_selected != self.selected() {
should_render = true;
}
}, },
Mouse::Release(line, _) => { Mouse::Release(line, _) => {
if line < 0 { if line < 0 {
return; return should_render;
} }
let mut should_select = true; let mut should_select = true;
if let Some((Event::Mouse(Mouse::Release(prev_line, _)), t)) = prev_event { if let Some((Event::Mouse(Mouse::Release(prev_line, _)), t)) = prev_event {
@ -70,10 +90,15 @@ impl ZellijPlugin for State {
self.traverse_dir_or_open_file(); self.traverse_dir_or_open_file();
self.ev_history.clear(); self.ev_history.clear();
should_select = false; should_select = false;
should_render = true;
} }
} }
if should_select && self.scroll() + (line as usize) < self.files.len() { if should_select && self.scroll() + (line as usize) < self.files.len() {
let currently_selected = self.selected();
*self.selected_mut() = self.scroll() + (line as usize); *self.selected_mut() = self.scroll() + (line as usize);
if currently_selected != self.selected() {
should_render = true;
}
} }
}, },
_ => {}, _ => {},
@ -81,7 +106,8 @@ impl ZellijPlugin for State {
_ => { _ => {
dbg!("Unknown event {:?}", event); dbg!("Unknown event {:?}", event);
}, },
} };
should_render
} }
fn render(&mut self, rows: usize, cols: usize) { fn render(&mut self, rows: usize, cols: usize) {

View file

@ -22,7 +22,7 @@ struct State {
active_tab_idx: usize, active_tab_idx: usize,
mode_info: ModeInfo, mode_info: ModeInfo,
mouse_click_pos: usize, mouse_click_pos: usize,
should_render: bool, should_change_tab: bool,
} }
static ARROW_SEPARATOR: &str = ""; static ARROW_SEPARATOR: &str = "";
@ -39,13 +39,23 @@ impl ZellijPlugin for State {
]); ]);
} }
fn update(&mut self, event: Event) { fn update(&mut self, event: Event) -> bool {
let mut should_render = false;
match event { match event {
Event::ModeUpdate(mode_info) => self.mode_info = mode_info, Event::ModeUpdate(mode_info) => {
if self.mode_info != mode_info {
should_render = true;
}
self.mode_info = mode_info;
},
Event::TabUpdate(tabs) => { Event::TabUpdate(tabs) => {
if let Some(active_tab_index) = tabs.iter().position(|t| t.active) { if let Some(active_tab_index) = tabs.iter().position(|t| t.active) {
// tabs are indexed starting from 1 so we need to add 1 // tabs are indexed starting from 1 so we need to add 1
self.active_tab_idx = active_tab_index + 1; let active_tab_idx = active_tab_index + 1;
if self.active_tab_idx != active_tab_idx || self.tabs != tabs {
should_render = true;
}
self.active_tab_idx = active_tab_idx;
self.tabs = tabs; self.tabs = tabs;
} else { } else {
eprintln!("Could not find active tab."); eprintln!("Could not find active tab.");
@ -53,13 +63,18 @@ impl ZellijPlugin for State {
}, },
Event::Mouse(me) => match me { Event::Mouse(me) => match me {
Mouse::LeftClick(_, col) => { Mouse::LeftClick(_, col) => {
if self.mouse_click_pos != col {
should_render = true;
self.should_change_tab = true;
}
self.mouse_click_pos = col; self.mouse_click_pos = col;
self.should_render = true;
}, },
Mouse::ScrollUp(_) => { Mouse::ScrollUp(_) => {
should_render = true;
switch_tab_to(min(self.active_tab_idx + 1, self.tabs.len()) as u32); switch_tab_to(min(self.active_tab_idx + 1, self.tabs.len()) as u32);
}, },
Mouse::ScrollDown(_) => { Mouse::ScrollDown(_) => {
should_render = true;
switch_tab_to(max(self.active_tab_idx.saturating_sub(1), 1) as u32); switch_tab_to(max(self.active_tab_idx.saturating_sub(1), 1) as u32);
}, },
_ => {}, _ => {},
@ -68,6 +83,7 @@ impl ZellijPlugin for State {
eprintln!("Got unrecognized event: {:?}", event); eprintln!("Got unrecognized event: {:?}", event);
}, },
} }
should_render
} }
fn render(&mut self, _rows: usize, cols: usize) { fn render(&mut self, _rows: usize, cols: usize) {
@ -110,7 +126,7 @@ impl ZellijPlugin for State {
for bar_part in tab_line { for bar_part in tab_line {
s = format!("{}{}", s, &bar_part.part); s = format!("{}{}", s, &bar_part.part);
if self.should_render if self.should_change_tab
&& self.mouse_click_pos >= len_cnt && self.mouse_click_pos >= len_cnt
&& self.mouse_click_pos < len_cnt + bar_part.len && self.mouse_click_pos < len_cnt + bar_part.len
&& bar_part.tab_index.is_some() && bar_part.tab_index.is_some()
@ -133,6 +149,6 @@ impl ZellijPlugin for State {
print!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color); print!("{}\u{1b}[48;5;{}m\u{1b}[0K", s, color);
}, },
} }
self.should_render = false; self.should_change_tab = false;
} }
} }

View file

@ -396,6 +396,12 @@ impl Output {
} }
Ok(serialized_render_instructions) Ok(serialized_render_instructions)
} }
pub fn is_dirty(&self) -> bool {
!self.pre_vte_instructions.is_empty()
|| !self.post_vte_instructions.is_empty()
|| self.client_character_chunks.values().any(|c| !c.is_empty())
|| self.sixel_chunks.values().any(|c| !c.is_empty())
}
} }
// this struct represents the geometry of a group of floating panes // this struct represents the geometry of a group of floating panes

View file

@ -1081,11 +1081,14 @@ impl Grid {
pub fn reset_viewport(&mut self) { pub fn reset_viewport(&mut self) {
let max_lines_to_scroll = *SCROLL_BUFFER_SIZE.get().unwrap() * 2; // while not very elegant, this can prevent minor bugs from becoming showstoppers by sticking the whole app display in an endless loop let max_lines_to_scroll = *SCROLL_BUFFER_SIZE.get().unwrap() * 2; // while not very elegant, this can prevent minor bugs from becoming showstoppers by sticking the whole app display in an endless loop
let mut lines_scrolled = 0; let mut lines_scrolled = 0;
let should_clear_output_buffer = self.is_scrolled;
while self.is_scrolled && lines_scrolled < max_lines_to_scroll { while self.is_scrolled && lines_scrolled < max_lines_to_scroll {
self.scroll_down_one_line(); self.scroll_down_one_line();
lines_scrolled += 1; lines_scrolled += 1;
} }
self.output_buffer.update_all_lines(); if should_clear_output_buffer {
self.output_buffer.update_all_lines();
}
} }
pub fn rotate_scroll_region_up(&mut self, count: usize) { pub fn rotate_scroll_region_up(&mut self, count: usize) {
if let Some((scroll_region_top, scroll_region_bottom)) = self if let Some((scroll_region_top, scroll_region_bottom)) = self

View file

@ -65,6 +65,8 @@ pub struct TiledPanes {
fullscreen_is_active: bool, fullscreen_is_active: bool,
os_api: Box<dyn ServerOsApi>, os_api: Box<dyn ServerOsApi>,
senders: ThreadSenders, senders: ThreadSenders,
window_title: Option<String>,
client_id_to_boundaries: HashMap<ClientId, Boundaries>,
} }
impl TiledPanes { impl TiledPanes {
@ -100,6 +102,8 @@ impl TiledPanes {
fullscreen_is_active: false, fullscreen_is_active: false,
os_api, os_api,
senders, senders,
window_title: None,
client_id_to_boundaries: HashMap::new(),
} }
} }
pub fn add_pane_with_existing_geom(&mut self, pane_id: PaneId, mut pane: Box<dyn Pane>) { pub fn add_pane_with_existing_geom(&mut self, pane_id: PaneId, mut pane: Box<dyn Pane>) {
@ -264,6 +268,7 @@ impl TiledPanes {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
pub fn can_split_pane_horizontally(&mut self, client_id: ClientId) -> bool { pub fn can_split_pane_horizontally(&mut self, client_id: ClientId) -> bool {
if let Some(active_pane_id) = &self.active_panes.get(&client_id) { if let Some(active_pane_id) = &self.active_panes.get(&client_id) {
@ -338,9 +343,11 @@ impl TiledPanes {
.insert(client_id, pane_id, &mut self.panes); .insert(client_id, pane_id, &mut self.panes);
} }
} }
self.reset_boundaries();
} }
pub fn clear_active_panes(&mut self) { pub fn clear_active_panes(&mut self) {
self.active_panes.clear(&mut self.panes); self.active_panes.clear(&mut self.panes);
self.reset_boundaries();
} }
pub fn first_active_pane_id(&self) -> Option<PaneId> { pub fn first_active_pane_id(&self) -> Option<PaneId> {
self.connected_clients self.connected_clients
@ -373,6 +380,7 @@ impl TiledPanes {
pane.set_should_render_boundaries(true); pane.set_should_render_boundaries(true);
pane.render_full_viewport(); pane.render_full_viewport();
} }
self.reset_boundaries();
} }
pub fn has_active_panes(&self) -> bool { pub fn has_active_panes(&self) -> bool {
!self.active_panes.is_empty() !self.active_panes.is_empty()
@ -435,7 +443,11 @@ impl TiledPanes {
self.session_is_mirrored, self.session_is_mirrored,
); );
} }
pane_contents_and_ui.render_terminal_title_if_needed(*client_id, client_mode); pane_contents_and_ui.render_terminal_title_if_needed(
*client_id,
client_mode,
&mut self.window_title,
);
// this is done for panes that don't have their own cursor (eg. panes of // this is done for panes that don't have their own cursor (eg. panes of
// another user) // another user)
pane_contents_and_ui pane_contents_and_ui
@ -450,14 +462,13 @@ impl TiledPanes {
} }
} }
// render boundaries if needed // render boundaries if needed
for (client_id, boundaries) in &mut client_id_to_boundaries { for (client_id, boundaries) in client_id_to_boundaries {
// TODO: add some conditional rendering here so this isn't rendered for every character let boundaries_to_render = boundaries
.render(self.client_id_to_boundaries.get(&client_id))
.with_context(err_context)?;
self.client_id_to_boundaries.insert(client_id, boundaries);
output output
.add_character_chunks_to_client( .add_character_chunks_to_client(client_id, boundaries_to_render, None)
*client_id,
boundaries.render().with_context(err_context)?,
None,
)
.with_context(err_context)?; .with_context(err_context)?;
} }
Ok(()) Ok(())
@ -517,6 +528,7 @@ impl TiledPanes {
for pane in self.panes.values_mut() { for pane in self.panes.values_mut() {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
} }
pub fn resize_active_pane_right(&mut self, client_id: ClientId) { pub fn resize_active_pane_right(&mut self, client_id: ClientId) {
@ -531,6 +543,7 @@ impl TiledPanes {
for pane in self.panes.values_mut() { for pane in self.panes.values_mut() {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
} }
pub fn resize_active_pane_up(&mut self, client_id: ClientId) { pub fn resize_active_pane_up(&mut self, client_id: ClientId) {
@ -545,6 +558,7 @@ impl TiledPanes {
for pane in self.panes.values_mut() { for pane in self.panes.values_mut() {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
} }
pub fn resize_active_pane_down(&mut self, client_id: ClientId) { pub fn resize_active_pane_down(&mut self, client_id: ClientId) {
@ -559,6 +573,7 @@ impl TiledPanes {
for pane in self.panes.values_mut() { for pane in self.panes.values_mut() {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
} }
pub fn resize_active_pane_increase(&mut self, client_id: ClientId) { pub fn resize_active_pane_increase(&mut self, client_id: ClientId) {
@ -573,6 +588,7 @@ impl TiledPanes {
for pane in self.panes.values_mut() { for pane in self.panes.values_mut() {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
} }
pub fn resize_active_pane_decrease(&mut self, client_id: ClientId) { pub fn resize_active_pane_decrease(&mut self, client_id: ClientId) {
@ -587,6 +603,7 @@ impl TiledPanes {
for pane in self.panes.values_mut() { for pane in self.panes.values_mut() {
resize_pty!(pane, self.os_api, self.senders).unwrap(); resize_pty!(pane, self.os_api, self.senders).unwrap();
} }
self.reset_boundaries();
} }
} }
pub fn focus_next_pane(&mut self, client_id: ClientId) { pub fn focus_next_pane(&mut self, client_id: ClientId) {
@ -605,6 +622,7 @@ impl TiledPanes {
.insert(client_id, next_active_pane_id, &mut self.panes); .insert(client_id, next_active_pane_id, &mut self.panes);
} }
self.set_pane_active_at(next_active_pane_id); self.set_pane_active_at(next_active_pane_id);
self.reset_boundaries();
} }
pub fn focus_previous_pane(&mut self, client_id: ClientId) { pub fn focus_previous_pane(&mut self, client_id: ClientId) {
let connected_clients: Vec<ClientId> = let connected_clients: Vec<ClientId> =
@ -622,6 +640,7 @@ impl TiledPanes {
.insert(client_id, next_active_pane_id, &mut self.panes); .insert(client_id, next_active_pane_id, &mut self.panes);
} }
self.set_pane_active_at(next_active_pane_id); self.set_pane_active_at(next_active_pane_id);
self.reset_boundaries();
} }
fn set_pane_active_at(&mut self, pane_id: PaneId) { fn set_pane_active_at(&mut self, pane_id: PaneId) {
if let Some(pane) = self.get_pane_mut(pane_id) { if let Some(pane) = self.get_pane_mut(pane_id) {
@ -999,6 +1018,7 @@ impl TiledPanes {
} }
} }
pub fn extract_pane(&mut self, pane_id: PaneId) -> Option<Box<dyn Pane>> { pub fn extract_pane(&mut self, pane_id: PaneId) -> Option<Box<dyn Pane>> {
self.reset_boundaries();
self.panes.remove(&pane_id) self.panes.remove(&pane_id)
} }
pub fn remove_pane(&mut self, pane_id: PaneId) -> Option<Box<dyn Pane>> { pub fn remove_pane(&mut self, pane_id: PaneId) -> Option<Box<dyn Pane>> {
@ -1174,6 +1194,9 @@ impl TiledPanes {
.insert(client_id, to_pane_id, &mut self.panes); .insert(client_id, to_pane_id, &mut self.panes);
} }
} }
fn reset_boundaries(&mut self) {
self.client_id_to_boundaries.clear();
}
} }
#[allow(clippy::borrowed_box)] #[allow(clippy::borrowed_box)]

View file

@ -768,11 +768,15 @@ impl Screen {
for tab_index in tabs_to_close { for tab_index in tabs_to_close {
self.close_tab_at_index(tab_index).context(err_context)?; self.close_tab_at_index(tab_index).context(err_context)?;
} }
let serialized_output = output.serialize().context(err_context)?; if output.is_dirty() {
self.bus let serialized_output = output.serialize().context(err_context)?;
.senders self.bus
.send_to_server(ServerInstruction::Render(Some(serialized_output))) .senders
.context(err_context) .send_to_server(ServerInstruction::Render(Some(serialized_output)))
.context(err_context)
} else {
Ok(())
}
} }
/// Returns a mutable reference to this [`Screen`]'s tabs. /// Returns a mutable reference to this [`Screen`]'s tabs.

View file

@ -112,6 +112,9 @@ pub(crate) struct Tab {
terminal_emulator_colors: Rc<RefCell<Palette>>, terminal_emulator_colors: Rc<RefCell<Palette>>,
terminal_emulator_color_codes: Rc<RefCell<HashMap<usize, String>>>, terminal_emulator_color_codes: Rc<RefCell<HashMap<usize, String>>>,
pids_waiting_resize: HashSet<u32>, // u32 is the terminal_id pids_waiting_resize: HashSet<u32>, // u32 is the terminal_id
cursor_positions_and_shape: HashMap<ClientId, (usize, usize, String)>, // (x_position,
// y_position,
// cursor_shape_csi)
} }
#[derive(Clone, Debug, Default, Serialize, Deserialize)] #[derive(Clone, Debug, Default, Serialize, Deserialize)]
@ -485,6 +488,7 @@ impl Tab {
terminal_emulator_colors, terminal_emulator_colors,
terminal_emulator_color_codes, terminal_emulator_color_codes,
pids_waiting_resize: HashSet::new(), pids_waiting_resize: HashSet::new(),
cursor_positions_and_shape: HashMap::new(),
} }
} }
@ -1427,7 +1431,6 @@ impl Tab {
floating_panes_stack, floating_panes_stack,
); );
self.hide_cursor_and_clear_display_as_needed(output);
self.tiled_panes self.tiled_panes
.render(output, self.floating_panes.panes_are_visible()) .render(output, self.floating_panes.panes_are_visible())
.with_context(err_context)?; .with_context(err_context)?;
@ -1437,15 +1440,18 @@ impl Tab {
.with_context(err_context)?; .with_context(err_context)?;
} }
// FIXME: Once clients can be distinguished self.render_cursor(output);
if let Some(overlay_vte) = &overlay { if output.is_dirty() {
output.add_post_vte_instruction_to_multiple_clients( self.hide_cursor_and_clear_display_as_needed(output);
connected_clients.iter().copied(), // FIXME: Once clients can be distinguished
overlay_vte, if let Some(overlay_vte) = &overlay {
); output.add_post_vte_instruction_to_multiple_clients(
connected_clients.iter().copied(),
overlay_vte,
);
}
} }
self.render_cursor(output);
Ok(()) Ok(())
} }
@ -1466,25 +1472,41 @@ impl Tab {
self.should_clear_display_before_rendering = false; self.should_clear_display_before_rendering = false;
} }
} }
fn render_cursor(&self, output: &mut Output) { fn render_cursor(&mut self, output: &mut Output) {
let connected_clients: Vec<ClientId> = let connected_clients: Vec<ClientId> =
{ self.connected_clients.borrow().iter().copied().collect() }; { self.connected_clients.borrow().iter().copied().collect() };
for client_id in connected_clients { for client_id in connected_clients {
match self.get_active_terminal_cursor_position(client_id) { match self.get_active_terminal_cursor_position(client_id) {
Some((cursor_position_x, cursor_position_y)) => { Some((cursor_position_x, cursor_position_y)) => {
let show_cursor = "\u{1b}[?25h"; let desired_cursor_shape = self
let change_cursor_shape = self
.get_active_pane(client_id) .get_active_pane(client_id)
.map(|ap| ap.cursor_shape_csi()) .map(|ap| ap.cursor_shape_csi())
.unwrap_or_default(); .unwrap_or_default();
let goto_cursor_position = &format!( let cursor_changed_position_or_shape = self
"\u{1b}[{};{}H\u{1b}[m{}", .cursor_positions_and_shape
cursor_position_y + 1, .get(&client_id)
cursor_position_x + 1, .map(|(previous_x, previous_y, previous_shape)| {
change_cursor_shape previous_x != &cursor_position_x
); // goto row/col || previous_y != &cursor_position_y
output.add_post_vte_instruction_to_client(client_id, show_cursor); || previous_shape != &desired_cursor_shape
output.add_post_vte_instruction_to_client(client_id, goto_cursor_position); })
.unwrap_or(true);
if output.is_dirty() || cursor_changed_position_or_shape {
let show_cursor = "\u{1b}[?25h";
let goto_cursor_position = &format!(
"\u{1b}[{};{}H\u{1b}[m{}",
cursor_position_y + 1,
cursor_position_x + 1,
desired_cursor_shape
); // goto row/col
output.add_post_vte_instruction_to_client(client_id, show_cursor);
output.add_post_vte_instruction_to_client(client_id, goto_cursor_position);
self.cursor_positions_and_shape.insert(
client_id,
(cursor_position_x, cursor_position_y, desired_cursor_shape),
);
}
}, },
None => { None => {
let hide_cursor = "\u{1b}[?25l"; let hide_cursor = "\u{1b}[?25l";

View file

@ -27,10 +27,10 @@ pub mod boundary_type {
pub const CROSS: &str = ""; pub const CROSS: &str = "";
} }
pub(crate) type BoundaryType = &'static str; // easy way to refer to boundary_type above pub type BoundaryType = &'static str; // easy way to refer to boundary_type above
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) struct BoundarySymbol { pub struct BoundarySymbol {
boundary_type: BoundaryType, boundary_type: BoundaryType,
invisible: bool, invisible: bool,
color: Option<PaletteColor>, color: Option<PaletteColor>,
@ -420,7 +420,7 @@ fn combine_symbols(
} }
#[derive(PartialEq, Eq, Hash, Debug)] #[derive(PartialEq, Eq, Hash, Debug)]
pub(crate) struct Coordinates { pub struct Coordinates {
x: usize, x: usize,
y: usize, y: usize,
} }
@ -433,7 +433,7 @@ impl Coordinates {
pub struct Boundaries { pub struct Boundaries {
viewport: Viewport, viewport: Viewport,
boundary_characters: HashMap<Coordinates, BoundarySymbol>, pub boundary_characters: HashMap<Coordinates, BoundarySymbol>,
} }
impl Boundaries { impl Boundaries {
@ -540,9 +540,19 @@ impl Boundaries {
} }
} }
} }
pub fn render(&self) -> Result<Vec<CharacterChunk>> { pub fn render(
&self,
existing_boundaries_on_screen: Option<&Boundaries>,
) -> Result<Vec<CharacterChunk>> {
let mut character_chunks = vec![]; let mut character_chunks = vec![];
for (coordinates, boundary_character) in &self.boundary_characters { for (coordinates, boundary_character) in &self.boundary_characters {
let already_on_screen = existing_boundaries_on_screen
.and_then(|e| e.boundary_characters.get(coordinates))
.map(|e| e == boundary_character)
.unwrap_or(false);
if already_on_screen {
continue;
}
character_chunks.push(CharacterChunk::new( character_chunks.push(CharacterChunk::new(
vec![boundary_character vec![boundary_character
.as_terminal_character() .as_terminal_character()

View file

@ -65,15 +65,17 @@ impl<'a> PaneContentsAndUi<'a> {
self.z_index, self.z_index,
); );
if let Some(raw_vte_output) = raw_vte_output { if let Some(raw_vte_output) = raw_vte_output {
self.output.add_post_vte_instruction_to_multiple_clients( if !raw_vte_output.is_empty() {
clients.iter().copied(), self.output.add_post_vte_instruction_to_multiple_clients(
&format!( clients.iter().copied(),
"\u{1b}[{};{}H\u{1b}[m{}", &format!(
self.pane.y() + 1, "\u{1b}[{};{}H\u{1b}[m{}",
self.pane.x() + 1, self.pane.y() + 1,
raw_vte_output self.pane.x() + 1,
), raw_vte_output
); ),
);
}
} }
} }
Ok(()) Ok(())
@ -140,11 +142,22 @@ impl<'a> PaneContentsAndUi<'a> {
} }
Ok(()) Ok(())
} }
pub fn render_terminal_title_if_needed(&mut self, client_id: ClientId, client_mode: InputMode) { pub fn render_terminal_title_if_needed(
&mut self,
client_id: ClientId,
client_mode: InputMode,
previous_title: &mut Option<String>,
) {
if !self.focused_clients.contains(&client_id) { if !self.focused_clients.contains(&client_id) {
return; return;
} }
let vte_output = self.pane.render_terminal_title(client_mode); let vte_output = self.pane.render_terminal_title(client_mode);
if let Some(previous_title) = previous_title {
if *previous_title == vte_output {
return;
}
}
*previous_title = Some(vte_output.clone());
self.output self.output
.add_post_vte_instruction_to_client(client_id, &vte_output); .add_post_vte_instruction_to_client(client_id, &vte_output);
} }

View file

@ -41,31 +41,13 @@ use std::collections::HashMap;
use std::rc::Rc; use std::rc::Rc;
use zellij_utils::vte; use zellij_utils::vte;
// TODO: deduplicate with identical function in tab_integration_tests
fn take_snapshot_and_cursor_coordinates( fn take_snapshot_and_cursor_coordinates(
ansi_instructions: &str, ansi_instructions: &str,
rows: usize, grid: &mut Grid,
columns: usize,
palette: Palette,
) -> (Option<(usize, usize)>, String) { ) -> (Option<(usize, usize)>, String) {
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
let character_cell_size = Rc::new(RefCell::new(Some(SizeInPixels {
width: 8,
height: 21,
})));
let mut grid = Grid::new(
rows,
columns,
Rc::new(RefCell::new(palette)),
terminal_emulator_color_codes,
Rc::new(RefCell::new(LinkHandler::new())),
character_cell_size,
sixel_image_store,
);
let mut vte_parser = vte::Parser::new(); let mut vte_parser = vte::Parser::new();
for &byte in ansi_instructions.as_bytes() { for &byte in ansi_instructions.as_bytes() {
vte_parser.advance(&mut grid, byte); vte_parser.advance(grid, byte);
} }
(grid.cursor_coordinates(), format!("{:?}", grid)) (grid.cursor_coordinates(), format!("{:?}", grid))
} }
@ -74,6 +56,21 @@ fn take_snapshots_and_cursor_coordinates_from_render_events<'a>(
all_events: impl Iterator<Item = &'a ServerInstruction>, all_events: impl Iterator<Item = &'a ServerInstruction>,
screen_size: Size, screen_size: Size,
) -> Vec<(Option<(usize, usize)>, String)> { ) -> Vec<(Option<(usize, usize)>, String)> {
let sixel_image_store = Rc::new(RefCell::new(SixelImageStore::default()));
let terminal_emulator_color_codes = Rc::new(RefCell::new(HashMap::new()));
let character_cell_size = Rc::new(RefCell::new(Some(SizeInPixels {
width: 8,
height: 21,
})));
let mut grid = Grid::new(
screen_size.rows,
screen_size.cols,
Rc::new(RefCell::new(Palette::default())),
terminal_emulator_color_codes,
Rc::new(RefCell::new(LinkHandler::new())),
character_cell_size,
sixel_image_store,
);
let snapshots: Vec<(Option<(usize, usize)>, String)> = all_events let snapshots: Vec<(Option<(usize, usize)>, String)> = all_events
.filter_map(|server_instruction| { .filter_map(|server_instruction| {
match server_instruction { match server_instruction {
@ -81,12 +78,8 @@ fn take_snapshots_and_cursor_coordinates_from_render_events<'a>(
if let Some(output) = output { if let Some(output) = output {
// note this only takes a snapshot of the first client! // note this only takes a snapshot of the first client!
let raw_snapshot = output.get(&1).unwrap(); let raw_snapshot = output.get(&1).unwrap();
let snapshot = take_snapshot_and_cursor_coordinates( let snapshot =
raw_snapshot, take_snapshot_and_cursor_coordinates(raw_snapshot, &mut grid);
screen_size.rows,
screen_size.cols,
Palette::default(),
);
Some(snapshot) Some(snapshot)
} else { } else {
None None

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1805 assertion_line: 2223
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
01 (C): 01 (C):
02 (C): 02 (C): │ │
03 (C): 03 (C): │ │
04 (C): 04 (C): │ │
05 (C): 05 (C): │ │
06 (C): 06 (C): │ │
07 (C): 07 (C): │ │
08 (C): 08 (C): │ │
09 (C): 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1805 assertion_line: 2225
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 2
01 (C): │ │
02 (C): │ │
03 (C): │ │
04 (C): │ │
05 (C): │ │
06 (C): │ │
07 (C): │ │
08 (C): │ │
09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2118 assertion_line: 2459
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │ ││ │
02 (C): 02 (C): │ ││ │
03 (C): 03 (C): │ ││ │
04 (C): 04 (C): │ ││ │
05 (C): 05 (C): │ ││ │
06 (C): 06 (C): │ ││ │
07 (C): 07 (C): │ ││ │
08 (C): 08 (C): │ ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2118 assertion_line: 2459
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐ 00 (C): ┌ Pane #1 ─────────────────────────────────────────────────────────────────────┐
01 (C): │ ││ 01 (C): │
02 (C): │ ││ 02 (C): │
03 (C): │ ││ 03 (C): │
04 (C): │ ││ │ 04 (C): └──────────────────────────────────────────────────────────────────────────────┘
05 (C): │ ││ │ 05 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
06 (C): │ ││ 06 (C): │
07 (C): │ ││ 07 (C): │
08 (C): │ ││ 08 (C): │
09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2118 assertion_line: 2461
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): 3
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 939 assertion_line: 1042
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{:?}\", cursor_coordinates)"
--- ---
Some((1, 1)) Some((41, 1))

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 939 assertion_line: 1044
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{}\", snapshot_count)"
--- ---
Some((41, 1)) 2

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 968 assertion_line: 1080
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{:?}\", cursor_coordinates)"
--- ---
Some((1, 1)) Some((41, 1))

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 968 assertion_line: 1082
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{}\", snapshot_count)"
--- ---
Some((41, 1)) 2

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2037 assertion_line: 2423
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │ ││ │
02 (C): 02 (C): │ ││ │
03 (C): 03 (C): │ ││ │
04 (C): 04 (C): │ ││ │
05 (C): 05 (C): │ ││ │
06 (C): 06 (C): │ ││ │
07 (C): 07 (C): │ ││ │
08 (C): 08 (C): │ ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2037 assertion_line: 2423
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐ 00 (C): ┌ Pane #1 ─────────────────────────────────────────────────────────────────────┐
01 (C): │ ││ 01 (C): │
02 (C): │ ││ 02 (C): │
03 (C): │ ││ 03 (C): │
04 (C): │ ││ │ 04 (C): └──────────────────────────────────────────────────────────────────────────────┘
05 (C): │ ││ │ 05 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
06 (C): │ ││ 06 (C): │
07 (C): │ ││ 07 (C): │
08 (C): │ ││ 08 (C): │
09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2037 assertion_line: 2425
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): 3
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1397 assertion_line: 1702
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 9 ││ │
02 (C): 02 (C): │fill pane up with something 10 ││ │
03 (C): 03 (C): │fill pane up with something 11 ││ │
04 (C): 04 (C): │fill pane up with something 12 ││ │
05 (C): 05 (C): │fill pane up with something 13 ││ │
06 (C): 06 (C): │fill pane up with something 14 ││ │
07 (C): 07 (C): │fill pane up with something 15 ││ │
08 (C): 08 (C): │fill pane up with something 16 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1397 assertion_line: 1702
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 8/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 9 │ 01 (C): │fill pane up with something 5 ││ │
02 (C): │fill pane up with something 10 │ 02 (C): │fill pane up with something 6 ││ │
03 (C): │fill pane up with something 11 │ 03 (C): │fill pane up with something 7 ││ │
04 (C): │fill pane up with something 12 │ 04 (C): │fill pane up with something 8 ││ │
05 (C): │fill pane up with something 13 │ 05 (C): │fill pane up with something 9 ││ │
06 (C): │fill pane up with something 14 │ 06 (C): │fill pane up with something 10 ││ │
07 (C): │fill pane up with something 15 │ 07 (C): │fill pane up with something 11 ││ │
08 (C): │fill pane up with something 16 │ 08 (C): │fill pane up with something 12 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1397 assertion_line: 1702
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 8/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 5 │ 01 (C): │fill pane up with something 9 ││ │
02 (C): │fill pane up with something 6 │ 02 (C): │fill pane up with something 10 ││ │
03 (C): │fill pane up with something 7 │ 03 (C): │fill pane up with something 11 ││ │
04 (C): │fill pane up with something 8 │ 04 (C): │fill pane up with something 12 ││ │
05 (C): │fill pane up with something 9 │ 05 (C): │fill pane up with something 13 ││ │
06 (C): │fill pane up with something 10 │ 06 (C): │fill pane up with something 14 ││ │
07 (C): │fill pane up with something 11 │ 07 (C): │fill pane up with something 15 ││ │
08 (C): │fill pane up with something 12 │ 08 (C): │fill pane up with something 16 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1397 assertion_line: 1704
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐ 4
01 (C): │fill pane up with something 9 │
02 (C): │fill pane up with something 10 │
03 (C): │fill pane up with something 11 │
04 (C): │fill pane up with something 12 │
05 (C): │fill pane up with something 13 │
06 (C): │fill pane up with something 14 │
07 (C): │fill pane up with something 15 │
08 (C): │fill pane up with something 16 │
09 (C): └──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1354 assertion_line: 1639
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 9 ││ │
02 (C): 02 (C): │fill pane up with something 10 ││ │
03 (C): 03 (C): │fill pane up with something 11 ││ │
04 (C): 04 (C): │fill pane up with something 12 ││ │
05 (C): 05 (C): │fill pane up with something 13 ││ │
06 (C): 06 (C): │fill pane up with something 14 ││ │
07 (C): 07 (C): │fill pane up with something 15 ││ │
08 (C): 08 (C): │fill pane up with something 16 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1354 assertion_line: 1641
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐ 2
01 (C): │fill pane up with something 9 │
02 (C): │fill pane up with something 10 │
03 (C): │fill pane up with something 11 │
04 (C): │fill pane up with something 12 │
05 (C): │fill pane up with something 13 │
06 (C): │fill pane up with something 14 │
07 (C): │fill pane up with something 15 │
08 (C): │fill pane up with something 16 │
09 (C): └──────────────────────────────────────┘

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1030 assertion_line: 1160
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{:?}\", cursor_coordinates)"
--- ---
Some((1, 1)) Some((41, 1))

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1030 assertion_line: 1162
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{}\", snapshot_count)"
--- ---
Some((41, 1)) 2

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 999 assertion_line: 1120
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{:?}\", cursor_coordinates)"
--- ---
Some((1, 1)) Some((41, 1))

View file

@ -1,6 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 999 assertion_line: 1122
expression: "format!(\"{:?}\", cursor_coordinates)" expression: "format!(\"{}\", snapshot_count)"
--- ---
Some((41, 1)) 2

View file

@ -1,26 +1,26 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1060 assertion_line: 1194
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #2 ─────────────────────────────┐┌ Pane #1 ─────────────────────────────┐
01 (C): 01 (C): │ ││ │
02 (C): 02 (C): │ ││ │
03 (C): 03 (C): │ ││ │
04 (C): 04 (C): │ ││ │
05 (C): 05 (C): │ ││ │
06 (C): 06 (C): │ ││ │
07 (C): 07 (C): │ ││ │
08 (C): 08 (C): │ ││ │
09 (C): 09 (C): │ ││ │
10 (C): 10 (C): │ ││ │
11 (C): 11 (C): │ ││ │
12 (C): 12 (C): │ ││ │
13 (C): 13 (C): │ ││ │
14 (C): 14 (C): │ ││ │
15 (C): 15 (C): │ ││ │
16 (C): 16 (C): │ ││ │
17 (C): 17 (C): │ ││ │
18 (C): 18 (C): │ ││ │
19 (C): 19 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,26 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1060 assertion_line: 1196
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────┐┌ Pane #1 ─────────────────────────────┐ 2
01 (C): │ ││ │
02 (C): │ ││ │
03 (C): │ ││ │
04 (C): │ ││ │
05 (C): │ ││ │
06 (C): │ ││ │
07 (C): │ ││ │
08 (C): │ ││ │
09 (C): │ ││ │
10 (C): │ ││ │
11 (C): │ ││ │
12 (C): │ ││ │
13 (C): │ ││ │
14 (C): │ ││ │
15 (C): │ ││ │
16 (C): │ ││ │
17 (C): │ ││ │
18 (C): │ ││ │
19 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1969 assertion_line: 2346
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │ ││ │
02 (C): 02 (C): │ ││ │
03 (C): 03 (C): │ ││ │
04 (C): 04 (C): │ ││ │
05 (C): 05 (C): │ ││ │
06 (C): 06 (C): │ ││ │
07 (C): 07 (C): │ ││ │
08 (C): 08 (C): │ ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1969 assertion_line: 2346
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐ 00 (C): ┌ Pane #1 ─────────────────────────────────────────────────────────────────────┐
01 (C): │ ││ 01 (C): │
02 (C): │ ││ 02 (C): │
03 (C): │ ││ 03 (C): │
04 (C): │ ││ │ 04 (C): └──────────────────────────────────────────────────────────────────────────────┘
05 (C): │ ││ │ 05 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
06 (C): │ ││ 06 (C): │
07 (C): │ ││ 07 (C): │
08 (C): │ ││ 08 (C): │
09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1969 assertion_line: 2348
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): 3
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1318 assertion_line: 1593
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 9/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 4 ││ │
02 (C): 02 (C): │fill pane up with something 5 ││ │
03 (C): 03 (C): │fill pane up with something 6 ││ │
04 (C): 04 (C): │fill pane up with something 7 ││ │
05 (C): 05 (C): │fill pane up with something 8 ││ │
06 (C): 06 (C): │fill pane up with something 9 ││ │
07 (C): 07 (C): │fill pane up with something 10 ││ │
08 (C): 08 (C): │fill pane up with something 11 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1318 assertion_line: 1593
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 9/13 00 (C): ┌ Pane #1 ───────────── SCROLL: 13/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 4 │ 01 (C): │fill pane up with something 0 ││ │
02 (C): │fill pane up with something 5 │ 02 (C): │fill pane up with something 1 ││ │
03 (C): │fill pane up with something 6 │ 03 (C): │fill pane up with something 2 ││ │
04 (C): │fill pane up with something 7 │ 04 (C): │fill pane up with something 3 ││ │
05 (C): │fill pane up with something 8 │ 05 (C): │fill pane up with something 4 ││ │
06 (C): │fill pane up with something 9 │ 06 (C): │fill pane up with something 5 ││ │
07 (C): │fill pane up with something 10 │ 07 (C): │fill pane up with something 6 ││ │
08 (C): │fill pane up with something 11 │ 08 (C): │fill pane up with something 7 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1318 assertion_line: 1593
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ───────────── SCROLL: 13/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 5/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 0 │ 01 (C): │fill pane up with something 8 ││ │
02 (C): │fill pane up with something 1 │ 02 (C): │fill pane up with something 9 ││ │
03 (C): │fill pane up with something 2 │ 03 (C): │fill pane up with something 10 ││ │
04 (C): │fill pane up with something 3 │ 04 (C): │fill pane up with something 11 ││ │
05 (C): │fill pane up with something 4 │ 05 (C): │fill pane up with something 12 ││ │
06 (C): │fill pane up with something 5 │ 06 (C): │fill pane up with something 13 ││ │
07 (C): │fill pane up with something 6 │ 07 (C): │fill pane up with something 14 ││ │
08 (C): │fill pane up with something 7 │ 08 (C): │fill pane up with something 15 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1318 assertion_line: 1595
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 5/13 ┐ 4
01 (C): │fill pane up with something 8 │
02 (C): │fill pane up with something 9 │
03 (C): │fill pane up with something 10 │
04 (C): │fill pane up with something 11 │
05 (C): │fill pane up with something 12 │
06 (C): │fill pane up with something 13 │
07 (C): │fill pane up with something 14 │
08 (C): │fill pane up with something 15 │
09 (C): └──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1275 assertion_line: 1530
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 9/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 4 ││ │
02 (C): 02 (C): │fill pane up with something 5 ││ │
03 (C): 03 (C): │fill pane up with something 6 ││ │
04 (C): 04 (C): │fill pane up with something 7 ││ │
05 (C): 05 (C): │fill pane up with something 8 ││ │
06 (C): 06 (C): │fill pane up with something 9 ││ │
07 (C): 07 (C): │fill pane up with something 10 ││ │
08 (C): 08 (C): │fill pane up with something 11 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1275 assertion_line: 1532
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 9/13 ┐ 2
01 (C): │fill pane up with something 4 │
02 (C): │fill pane up with something 5 │
03 (C): │fill pane up with something 6 │
04 (C): │fill pane up with something 7 │
05 (C): │fill pane up with something 8 │
06 (C): │fill pane up with something 9 │
07 (C): │fill pane up with something 10 │
08 (C): │fill pane up with something 11 │
09 (C): └──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2003 assertion_line: 2387
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │ ││ │
02 (C): 02 (C): │ ││ │
03 (C): 03 (C): │ ││ │
04 (C): 04 (C): │ ││ │
05 (C): 05 (C): │ ││ │
06 (C): 06 (C): │ ││ │
07 (C): 07 (C): │ ││ │
08 (C): 08 (C): │ ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2003 assertion_line: 2387
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ─────────────────────────────┐┌ Pane #2 ─────────────────────────────┐ 00 (C): ┌ Pane #1 ─────────────────────────────────────────────────────────────────────┐
01 (C): │ ││ 01 (C): │
02 (C): │ ││ 02 (C): │
03 (C): │ ││ 03 (C): │
04 (C): │ ││ │ 04 (C): └──────────────────────────────────────────────────────────────────────────────┘
05 (C): │ ││ │ 05 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
06 (C): │ ││ 06 (C): │
07 (C): │ ││ 07 (C): │
08 (C): │ ││ 08 (C): │
09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 2003 assertion_line: 2389
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): 3
01 (C):
02 (C):
03 (C):
04 (C):
05 (C):
06 (C):
07 (C):
08 (C):
09 (C):

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1407
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 1/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 12 ││ │
02 (C): 02 (C): │fill pane up with something 13 ││ │
03 (C): 03 (C): │fill pane up with something 14 ││ │
04 (C): 04 (C): │fill pane up with something 15 ││ │
05 (C): 05 (C): │fill pane up with something 16 ││ │
06 (C): 06 (C): │fill pane up with something 17 ││ │
07 (C): 07 (C): │fill pane up with something 18 ││ │
08 (C): 08 (C): │fill pane up with something 19 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1407
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 1/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 12 │ 01 (C): │fill pane up with something 11 ││ │
02 (C): │fill pane up with something 13 │ 02 (C): │fill pane up with something 12 ││ │
03 (C): │fill pane up with something 14 │ 03 (C): │fill pane up with something 13 ││ │
04 (C): │fill pane up with something 15 │ 04 (C): │fill pane up with something 14 ││ │
05 (C): │fill pane up with something 16 │ 05 (C): │fill pane up with something 15 ││ │
06 (C): │fill pane up with something 17 │ 06 (C): │fill pane up with something 16 ││ │
07 (C): │fill pane up with something 18 │ 07 (C): │fill pane up with something 17 ││ │
08 (C): │fill pane up with something 19 │ 08 (C): │fill pane up with something 18 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1407
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 3/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 11 │ 01 (C): │fill pane up with something 10 ││ │
02 (C): │fill pane up with something 12 │ 02 (C): │fill pane up with something 11 ││ │
03 (C): │fill pane up with something 13 │ 03 (C): │fill pane up with something 12 ││ │
04 (C): │fill pane up with something 14 │ 04 (C): │fill pane up with something 13 ││ │
05 (C): │fill pane up with something 15 │ 05 (C): │fill pane up with something 14 ││ │
06 (C): │fill pane up with something 16 │ 06 (C): │fill pane up with something 15 ││ │
07 (C): │fill pane up with something 17 │ 07 (C): │fill pane up with something 16 ││ │
08 (C): │fill pane up with something 18 │ 08 (C): │fill pane up with something 17 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1407
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 3/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 10 │ 01 (C): │fill pane up with something 9 ││ │
02 (C): │fill pane up with something 11 │ 02 (C): │fill pane up with something 10 ││ │
03 (C): │fill pane up with something 12 │ 03 (C): │fill pane up with something 11 ││ │
04 (C): │fill pane up with something 13 │ 04 (C): │fill pane up with something 12 ││ │
05 (C): │fill pane up with something 14 │ 05 (C): │fill pane up with something 13 ││ │
06 (C): │fill pane up with something 15 │ 06 (C): │fill pane up with something 14 ││ │
07 (C): │fill pane up with something 16 │ 07 (C): │fill pane up with something 15 ││ │
08 (C): │fill pane up with something 17 │ 08 (C): │fill pane up with something 16 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1407
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 3/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 9 │ 01 (C): │fill pane up with something 10 ││ │
02 (C): │fill pane up with something 10 │ 02 (C): │fill pane up with something 11 ││ │
03 (C): │fill pane up with something 11 │ 03 (C): │fill pane up with something 12 ││ │
04 (C): │fill pane up with something 12 │ 04 (C): │fill pane up with something 13 ││ │
05 (C): │fill pane up with something 13 │ 05 (C): │fill pane up with something 14 ││ │
06 (C): │fill pane up with something 14 │ 06 (C): │fill pane up with something 15 ││ │
07 (C): │fill pane up with something 15 │ 07 (C): │fill pane up with something 16 ││ │
08 (C): │fill pane up with something 16 │ 08 (C): │fill pane up with something 17 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1407
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 3/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 10 │ 01 (C): │fill pane up with something 11 ││ │
02 (C): │fill pane up with something 11 │ 02 (C): │fill pane up with something 12 ││ │
03 (C): │fill pane up with something 12 │ 03 (C): │fill pane up with something 13 ││ │
04 (C): │fill pane up with something 13 │ 04 (C): │fill pane up with something 14 ││ │
05 (C): │fill pane up with something 14 │ 05 (C): │fill pane up with something 15 ││ │
06 (C): │fill pane up with something 15 │ 06 (C): │fill pane up with something 16 ││ │
07 (C): │fill pane up with something 16 │ 07 (C): │fill pane up with something 17 ││ │
08 (C): │fill pane up with something 17 │ 08 (C): │fill pane up with something 18 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1193 assertion_line: 1409
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 ┐ 7
01 (C): │fill pane up with something 11 │
02 (C): │fill pane up with something 12 │
03 (C): │fill pane up with something 13 │
04 (C): │fill pane up with something 14 │
05 (C): │fill pane up with something 15 │
06 (C): │fill pane up with something 16 │
07 (C): │fill pane up with something 17 │
08 (C): │fill pane up with something 18 │
09 (C): └──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1239 assertion_line: 1484
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 1/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 12 ││ │
02 (C): 02 (C): │fill pane up with something 13 ││ │
03 (C): 03 (C): │fill pane up with something 14 ││ │
04 (C): 04 (C): │fill pane up with something 15 ││ │
05 (C): 05 (C): │fill pane up with something 16 ││ │
06 (C): 06 (C): │fill pane up with something 17 ││ │
07 (C): 07 (C): │fill pane up with something 18 ││ │
08 (C): 08 (C): │fill pane up with something 19 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1239 assertion_line: 1484
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 1/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 12 │ 01 (C): │fill pane up with something 11 ││ │
02 (C): │fill pane up with something 13 │ 02 (C): │fill pane up with something 12 ││ │
03 (C): │fill pane up with something 14 │ 03 (C): │fill pane up with something 13 ││ │
04 (C): │fill pane up with something 15 │ 04 (C): │fill pane up with something 14 ││ │
05 (C): │fill pane up with something 16 │ 05 (C): │fill pane up with something 15 ││ │
06 (C): │fill pane up with something 17 │ 06 (C): │fill pane up with something 16 ││ │
07 (C): │fill pane up with something 18 │ 07 (C): │fill pane up with something 17 ││ │
08 (C): │fill pane up with something 19 │ 08 (C): │fill pane up with something 18 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1239 assertion_line: 1484
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 3/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 11 │ 01 (C): │fill pane up with something 10 ││ │
02 (C): │fill pane up with something 12 │ 02 (C): │fill pane up with something 11 ││ │
03 (C): │fill pane up with something 13 │ 03 (C): │fill pane up with something 12 ││ │
04 (C): │fill pane up with something 14 │ 04 (C): │fill pane up with something 13 ││ │
05 (C): │fill pane up with something 15 │ 05 (C): │fill pane up with something 14 ││ │
06 (C): │fill pane up with something 16 │ 06 (C): │fill pane up with something 15 ││ │
07 (C): │fill pane up with something 17 │ 07 (C): │fill pane up with something 16 ││ │
08 (C): │fill pane up with something 18 │ 08 (C): │fill pane up with something 17 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1239 assertion_line: 1484
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 3/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 10 │ 01 (C): │fill pane up with something 9 ││ │
02 (C): │fill pane up with something 11 │ 02 (C): │fill pane up with something 10 ││ │
03 (C): │fill pane up with something 12 │ 03 (C): │fill pane up with something 11 ││ │
04 (C): │fill pane up with something 13 │ 04 (C): │fill pane up with something 12 ││ │
05 (C): │fill pane up with something 14 │ 05 (C): │fill pane up with something 13 ││ │
06 (C): │fill pane up with something 15 │ 06 (C): │fill pane up with something 14 ││ │
07 (C): │fill pane up with something 16 │ 07 (C): │fill pane up with something 15 ││ │
08 (C): │fill pane up with something 17 │ 08 (C): │fill pane up with something 16 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1239 assertion_line: 1484
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 4/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 0/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 9 │ 01 (C): │fill pane up with something 13 ││ │
02 (C): │fill pane up with something 10 │ 02 (C): │fill pane up with something 14 ││ │
03 (C): │fill pane up with something 11 │ 03 (C): │fill pane up with something 15 ││ │
04 (C): │fill pane up with something 12 │ 04 (C): │fill pane up with something 16 ││ │
05 (C): │fill pane up with something 13 │ 05 (C): │fill pane up with something 17 ││ │
06 (C): │fill pane up with something 14 │ 06 (C): │fill pane up with something 18 ││ │
07 (C): │fill pane up with something 15 │ 07 (C): │fill pane up with something 19 ││ │
08 (C): │fill pane up with something 16 │ 08 (C): │ ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1239 assertion_line: 1486
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 0/13 ┐ 6
01 (C): │fill pane up with something 13 │
02 (C): │fill pane up with something 14 │
03 (C): │fill pane up with something 15 │
04 (C): │fill pane up with something 16 │
05 (C): │fill pane up with something 17 │
06 (C): │fill pane up with something 18 │
07 (C): │fill pane up with something 19 │
08 (C): │ │
09 (C): └──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1147 assertion_line: 1327
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ────────────── SCROLL: 1/13 ┐┌ Pane #2 ─────────────────────────────┐
01 (C): 01 (C): │fill pane up with something 12 ││ │
02 (C): 02 (C): │fill pane up with something 13 ││ │
03 (C): 03 (C): │fill pane up with something 14 ││ │
04 (C): 04 (C): │fill pane up with something 15 ││ │
05 (C): 05 (C): │fill pane up with something 16 ││ │
06 (C): 06 (C): │fill pane up with something 17 ││ │
07 (C): 07 (C): │fill pane up with something 18 ││ │
08 (C): 08 (C): │fill pane up with something 19 ││ │
09 (C): 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1147 assertion_line: 1327
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 1/13 00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 ┐┌ Pane #2 ─────────────────────────────
01 (C): │fill pane up with something 12 │ 01 (C): │fill pane up with something 11 ││ │
02 (C): │fill pane up with something 13 │ 02 (C): │fill pane up with something 12 ││ │
03 (C): │fill pane up with something 14 │ 03 (C): │fill pane up with something 13 ││ │
04 (C): │fill pane up with something 15 │ 04 (C): │fill pane up with something 14 ││ │
05 (C): │fill pane up with something 16 │ 05 (C): │fill pane up with something 15 ││ │
06 (C): │fill pane up with something 17 │ 06 (C): │fill pane up with something 16 ││ │
07 (C): │fill pane up with something 18 │ 07 (C): │fill pane up with something 17 ││ │
08 (C): │fill pane up with something 19 │ 08 (C): │fill pane up with something 18 ││ │
09 (C): └──────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1149 assertion_line: 1329
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ────────────── SCROLL: 2/13 ┐ 3
01 (C): │fill pane up with something 11 │
02 (C): │fill pane up with something 12 │
03 (C): │fill pane up with something 13 │
04 (C): │fill pane up with something 14 │
05 (C): │fill pane up with something 15 │
06 (C): │fill pane up with something 16 │
07 (C): │fill pane up with something 17 │
08 (C): │fill pane up with something 18 │
09 (C): └──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1775 assertion_line: 2186
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
01 (C): 01 (C):
02 (C): 02 (C): │ │
03 (C): 03 (C): │ ┌ Pane #1 ─────────────────────────────┐ │
04 (C): 04 (C): │ │ │ │
05 (C): 05 (C): │ │ │ │
06 (C): 06 (C): │ │ │ │
07 (C): 07 (C): │ └──────────────────────────────────────┘ │
08 (C): 08 (C): │ │
09 (C): 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1775 assertion_line: 2186
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
01 (C): │ │ 01 (C): │ │
02 (C): │ │ 02 (C): │ │
03 (C): │ ┌ Pane #1 ─────────────────────────────┐ 03 (C): │
04 (C): │ │ │ 04 (C): │
05 (C): │ │ │ 05 (C): │
06 (C): │ │ │ 06 (C): │
07 (C): │ └──────────────────────────────────────┘ 07 (C): │
08 (C): │ │ 08 (C): │ │
09 (C): └──────────────────────────────────────────────────────────────────────────────┘ 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1775 assertion_line: 2186
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
01 (C): │ │ 01 (C): │ │
02 (C): │ │ 02 (C): │ │
03 (C): │ 03 (C): │ ┌ Pane #1 ─────────────────────────────┐
04 (C): │ 04 (C): │ │ │
05 (C): │ 05 (C): │ │ │
06 (C): │ 06 (C): │ │ │
07 (C): │ 07 (C): │ └──────────────────────────────────────┘
08 (C): │ │ 08 (C): │ │
09 (C): └──────────────────────────────────────────────────────────────────────────────┘ 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1775 assertion_line: 2188
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 4
01 (C): │ │
02 (C): │ │
03 (C): │ ┌ Pane #1 ─────────────────────────────┐ │
04 (C): │ │ │ │
05 (C): │ │ │ │
06 (C): │ │ │ │
07 (C): │ └──────────────────────────────────────┘ │
08 (C): │ │
09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1427 assertion_line: 1739
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #1 ─────────────────────────────────────────────────────────────────────┐
01 (C): 01 (C):
02 (C): 02 (C): │ │
03 (C): 03 (C): │ │
04 (C): 04 (C): │ │
05 (C): 05 (C): │ │
06 (C): 06 (C): │ │
07 (C): 07 (C): │ │
08 (C): 08 (C): │ │
09 (C): 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1427 assertion_line: 1741
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #1 ─────────────────────────────────────────────────────────────────────┐ 2
01 (C): │ │
02 (C): │ │
03 (C): │ │
04 (C): │ │
05 (C): │ │
06 (C): │ │
07 (C): │ │
08 (C): │ │
09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1737 assertion_line: 2131
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐
01 (C): 01 (C):
02 (C): 02 (C): │ │
03 (C): 03 (C): │ ┌ Pane #1 ─────────────────────────────┐ │
04 (C): 04 (C): │ │ │ │
05 (C): 05 (C): │ │ │ │
06 (C): 06 (C): │ │ │ │
07 (C): 07 (C): │ └──────────────────────────────────────┘ │
08 (C): 08 (C): │ │
09 (C): 09 (C): └──────────────────────────────────────────────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1737 assertion_line: 2131
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────────────────────────────────────────────┐ 00 (C): ┌ Pane #2 ─────────────────────────────┐┌ Pane #1 ─────────────────────────────┐
01 (C): │ 01 (C): │ ││
02 (C): │ 02 (C): │ ││
03 (C): │ ┌ Pane #1 ─────────────────────────────┐ 03 (C): │ ││
04 (C): │ │ │ 04 (C): │ │ │
05 (C): │ │ │ 05 (C): │ │ │
06 (C): │ │ │ 06 (C): │ │ │
07 (C): │ └──────────────────────────────────────┘ 07 (C): │ ││
08 (C): │ 08 (C): │ ││
09 (C): └──────────────────────────────────────────────────────────────────────────────┘ 09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1737 assertion_line: 2133
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): ┌ Pane #2 ─────────────────────────────┐┌ Pane #1 ─────────────────────────────┐ 3
01 (C): │ ││ │
02 (C): │ ││ │
03 (C): │ ││ │
04 (C): │ ││ │
05 (C): │ ││ │
06 (C): │ ││ │
07 (C): │ ││ │
08 (C): │ ││ │
09 (C): └──────────────────────────────────────┘└──────────────────────────────────────┘

View file

@ -1,16 +1,16 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1457 assertion_line: 1776
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot)"
--- ---
00 (C): 00 (C):
01 (C): 01 (C):
02 (C): 02 (C):
03 (C): 03 (C):
04 (C): 04 (C):
05 (C): 05 (C):
06 (C): 06 (C):
07 (C): 07 (C):
08 (C): 08 (C):
09 (C): 09 (C):

View file

@ -1,16 +1,6 @@
--- ---
source: zellij-server/src/./unit/screen_tests.rs source: zellij-server/src/./unit/screen_tests.rs
assertion_line: 1457 assertion_line: 1778
expression: "format!(\"{}\", snapshot)" expression: "format!(\"{}\", snapshot_count)"
--- ---
00 (C): │ 2
01 (C): │
02 (C): │
03 (C): │
04 (C): │
05 (C): │
06 (C): │
07 (C): │
08 (C): │
09 (C): │

View file

@ -234,8 +234,10 @@ pub(crate) fn wasm_thread_main(
.get_function("update") .get_function("update")
.with_context(err_context)?; .with_context(err_context)?;
wasi_write_object(&plugin_env.wasi_env, &event); wasi_write_object(&plugin_env.wasi_env, &event);
update.call(&[]).or_else::<anyError, _>(|e| { let update_return =
match e.downcast::<serde_json::Error>() { update.call(&[]).or_else::<anyError, _>(|e| match e
.downcast::<serde_json::Error>()
{
Ok(_) => panic!( Ok(_) => panic!(
"{}", "{}",
anyError::new(VersionMismatchError::new( anyError::new(VersionMismatchError::new(
@ -245,10 +247,13 @@ pub(crate) fn wasm_thread_main(
)) ))
), ),
Err(e) => Err(e).with_context(err_context), Err(e) => Err(e).with_context(err_context),
} })?;
})?; let should_render = match update_return.get(0) {
Some(Value::I32(n)) => *n == 1,
_ => false,
};
if *rows > 0 && *columns > 0 { if *rows > 0 && *columns > 0 && should_render {
let render = instance let render = instance
.exports .exports
.get_function("render") .get_function("render")

View file

@ -6,7 +6,9 @@ use zellij_utils::data::Event;
#[allow(unused_variables)] #[allow(unused_variables)]
pub trait ZellijPlugin { pub trait ZellijPlugin {
fn load(&mut self) {} fn load(&mut self) {}
fn update(&mut self, event: Event) {} fn update(&mut self, event: Event) -> bool {
false
} // return true if it should render
fn render(&mut self, rows: usize, cols: usize) {} fn render(&mut self, rows: usize, cols: usize) {}
} }
@ -41,15 +43,13 @@ macro_rules! register_plugin {
} }
#[no_mangle] #[no_mangle]
pub fn update() { pub fn update() -> bool {
let object = $crate::shim::object_from_stdin() let object = $crate::shim::object_from_stdin()
.context($crate::PLUGIN_MISMATCH) .context($crate::PLUGIN_MISMATCH)
.to_stdout() .to_stdout()
.unwrap(); .unwrap();
STATE.with(|state| { STATE.with(|state| state.borrow_mut().update(object))
state.borrow_mut().update(object);
});
} }
#[no_mangle] #[no_mangle]