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 dc7d56b
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions zellij-server/src/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1741,10 +1741,18 @@ 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() {
active_terminal = self
.floating_panes
.get_pane_mut(PaneId::Terminal(active_terminal_id))
.unwrap();
} else {
active_terminal = 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 dc7d56b

Please sign in to comment.