Skip to content

Commit

Permalink
Support UTF-8 character in tab name and pane name (#2102)
Browse files Browse the repository at this point in the history
* Support UTF-8 character in tab name and pane name

* Support UTF-8 character in tab name and pane name
  • Loading branch information
naosense authored Jan 19, 2023
1 parent 04b294a commit f9a7188
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zellij-server/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
},
Expand Down
4 changes: 3 additions & 1 deletion zellij-server/src/tab/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f9a7188

Please sign in to comment.