Other terminals do this when enabling focus tracking, and some programs behave much better when they get it. For instance, vim enables focus tracking when resumed after being backgrounded, and then processes things on the focus event, such as noticing if a file was changed. Without this patch: saving a file in vim, Ctrl-Z, `cargo fmt --all`, and `fg`; vim doesn't immediately notice the file was changed to reload it. (and then, you might edit the file further, and get a conflict later when vim notices) With this patch: vim notices the changes right away, making for a smoother experience.
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