fix(tabs): allow CJK in tab names (#2119)

This commit is contained in:
哇呜哇呜呀咦耶 2023-02-21 00:23:49 +08:00 committed by GitHub
parent 99639be1c9
commit 72a5d4d619
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -1165,7 +1165,7 @@ impl Screen {
}, },
c => { c => {
// It only allows printable unicode // It only allows printable unicode
if buf.iter().all(|u| matches!(u, 0x20..=0x7E | 0xA0..=0xFF)) { if buf.iter().all(|u| matches!(u, 0x20..=0x7E | 0x80..=0xFF)) {
active_tab.name.push_str(c); active_tab.name.push_str(c);
} }
}, },

View file

@ -2962,7 +2962,7 @@ impl Tab {
// It only allows printable unicode, delete and backspace keys. // It only allows printable unicode, delete and backspace keys.
let is_updatable = buf let is_updatable = buf
.iter() .iter()
.all(|u| matches!(u, 0x20..=0x7E | 0xA0..=0xFF | 0x08 | 0x7F)); .all(|u| matches!(u, 0x20..=0x7E | 0x80..=0xFF | 0x08 | 0x7F));
if is_updatable { if is_updatable {
let s = str::from_utf8(&buf).with_context(err_context)?; let s = str::from_utf8(&buf).with_context(err_context)?;
active_terminal.update_name(s); active_terminal.update_name(s);