Skip to content

Commit

Permalink
Fix crash on renaming a floating pane (#1323)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphCode committed Apr 28, 2022
1 parent 88e63e5 commit 274dad5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions zellij-server/src/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1741,10 +1741,14 @@ impl Tab {

pub fn update_active_pane_name(&mut self, buf: Vec<u8>, client_id: ClientId) {
if let Some(active_terminal_id) = self.get_active_terminal_id(client_id) {
let active_terminal = self
.tiled_panes
.get_pane_mut(PaneId::Terminal(active_terminal_id))
.unwrap();
let active_terminal = if self.are_floating_panes_visible() {
self.floating_panes
.get_pane_mut(PaneId::Terminal(active_terminal_id))
} else {
self.tiled_panes
.get_pane_mut(PaneId::Terminal(active_terminal_id))
}
.unwrap();

// It only allows printable unicode, delete and backspace keys.
let is_updatable = buf.iter().all(|u| matches!(u, 0x20..=0x7E | 0x08 | 0x7F));
Expand Down

0 comments on commit 274dad5

Please sign in to comment.