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
This commit is contained in:
parent
04b294aabb
commit
f9a7188728
2 changed files with 4 additions and 2 deletions
|
|
@ -1118,7 +1118,7 @@ impl Screen {
|
||||||
},
|
},
|
||||||
c => {
|
c => {
|
||||||
// It only allows printable unicode
|
// 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);
|
active_tab.name.push_str(c);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -2680,7 +2680,9 @@ impl Tab {
|
||||||
.with_context(err_context)?;
|
.with_context(err_context)?;
|
||||||
|
|
||||||
// It only allows printable unicode, delete and backspace keys.
|
// 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 {
|
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);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue