refs: https://github.com/wezterm/wezterm/issues/1422 refs: https://github.com/wezterm/wezterm/issues/6637 When we encounter a zero-width grapheme we need to be a little bit smarter about how we handle it. In the original implementation we'd unconditionally remap these graphemes into a cell, effectively making them appear as a blank cell with width of one. Later we discovered that eg: BIDI control characters should not be forced to display in this way, so the logic was changed to elide these graphemes from the model. Subsequently we've found that the unicode line separator should be treated as a blank. The unicode FAQ says that any character that has the White_Space property should be treated that way. This commit applies that logic: if we get a zero-width grapheme, if it is white space we'll force it to have a width of 1, otherwise we'll elide it from the model. This probably is still not perfect, but hopefully balances things out to be good enough, at least until we find an example of where it isn't the right call!
wezterm-term
This crate provides the core of the virtual terminal emulator implementation used by wezterm. The home for this crate is in the wezterm repo and development is tracked at https://github.com/wezterm/wezterm/.
It is full featured, providing terminal escape sequence parsing, keyboard and mouse input encoding, a model for the screen cells including scrollback, sixel and iTerm2 image support, OSC 8 Hyperlinks and a wide range of terminal cell attributes.
This crate does not provide any kind of gui, nor does it directly
manage a PTY; you provide a std::io::Write implementation that
could connect to a PTY, and supply bytes to the model via the
advance_bytes method.
The entrypoint to the crate is the Terminal struct.
License: MIT