summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author哇呜哇呜呀咦耶 <pingao777@gmail.com>2023-01-19 21:28:04 +0800
committerGitHub <noreply@github.com>2023-01-19 22:28:04 +0900
commitf9a718872876b9ef2df263855081d9562104ce1d (patch)
treef933fa4387ee26b9da26fdd7c8dba287fb192572
parent04b294aabb1ac31ba385f6152c6f4c709bf85097 (diff)
Support UTF-8 character in tab name and pane name (#2102)
* Support UTF-8 character in tab name and pane name * Support UTF-8 character in tab name and pane name
-rw-r--r--zellij-server/src/screen.rs2
-rw-r--r--zellij-server/src/tab/mod.rs4
2 files changed, 4 insertions, 2 deletions
diff --git a/zellij-server/src/screen.rs b/zellij-server/src/screen.rs
index 84fbb7688..b2fdf4f80 100644
--- a/zellij-server/src/screen.rs
+++ b/zellij-server/src/screen.rs
@@ -1118,7 +1118,7 @@ impl Screen {
},
c => {
// It only allows printable unicode
- if buf.iter().all(|u| matches!(u, 0x20..=0x7E)) {
+ if buf.iter().all(|u| matches!(u, 0x20..=0x7E | 0xA0..=0xFF)) {
active_tab.name.push_str(c);
}
},
diff --git a/zellij-server/src/tab/mod.rs b/zellij-server/src/tab/mod.rs
index 98555654d..093237eae 100644
--- a/zellij-server/src/tab/mod.rs
+++ b/zellij-server/src/tab/mod.rs
@@ -2680,7 +2680,9 @@ impl Tab {
.with_context(err_context)?;
// It only allows printable unicode, delete and backspace keys.
- let is_updatable = buf.iter().all(|u| matches!(u, 0x20..=0x7E | 0x08 | 0x7F));
+ let is_updatable = buf
+ .iter()
+ .all(|u| matches!(u, 0x20..=0x7E | 0xA0..=0xFF | 0x08 | 0x7F));
if is_updatable {
let s = str::from_utf8(&buf).with_context(err_context)?;
active_terminal.update_name(s);