From a17498999013bbc646201da0ab8bb9095b5320a4 Mon Sep 17 00:00:00 2001 From: Jonah Caplan Date: Mon, 15 Mar 2021 05:52:50 -0400 Subject: [PATCH] fix(tabs): delete characters when renaming tab (#226) --- default-tiles/tab-bar/src/main.rs | 3 +++ src/common/screen.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/default-tiles/tab-bar/src/main.rs b/default-tiles/tab-bar/src/main.rs index 0dd739d8..8c025336 100644 --- a/default-tiles/tab-bar/src/main.rs +++ b/default-tiles/tab-bar/src/main.rs @@ -100,6 +100,9 @@ impl ZellijTile for State { self.new_name.clear(); } Key::Char(c) => self.new_name = format!("{}{}", self.new_name, c), + Key::Backspace | Key::Delete => { + self.new_name.pop(); + } _ => {} } } diff --git a/src/common/screen.rs b/src/common/screen.rs index 199a1223..57bb0e0f 100644 --- a/src/common/screen.rs +++ b/src/common/screen.rs @@ -294,6 +294,10 @@ impl Screen { self.update_tabs(); self.render(); } + "\u{007F}" | "\u{0008}" => { + //delete and backspace keys + self.tabname_buf.pop(); + } c => { self.tabname_buf.push_str(c); }