Parser::process_cb
, which works the same asParser::process
except that it calls callbacks during parsing when it finds a terminal escape which is potentially useful but not something that affects the screen itself.- Support for xterm window resize request escape codes, via the new callback mechanism.
Screen::bells_diff
,Screen::audible_bell_count
,Screen::visual_bell_count
, andScreen::errors
have been removed in favor of the new callback api described above.Cell
no longer implementsDefault
.Screen
no longer implementsvte::Perform
.
Parser::set_size
andParser::set_scrollback
have been moved to methods onScreen
, andParser::screen_mut
was added to get a mutable reference to the screen.
- Bumped dependencies
- Removed a lot of unnecessary test data from the packaged crate, making downloads faster
Screen::errors
to track the number of parsing errors seen so far
- No longer generate spurious diffs in some cases where the cursor is past the end of a row
- Fix restoring the cursor position when scrolled back
- Various internal refactorings
- Unknown UTF-8 characters default to a width of 1, rather than 0 (except for control characters, as mentioned below)
- Ignore C1 control characters rather than adding them to the cell data, since they are non-printable
- Delay allocation of the alternate screen until it is used (saves a bit of memory in basic cases)
- Fixed various line wrapping state issues
- Fixed cursor positioning after writing zero width characters at the end of the line
- Fixed
Screen::cursor_state_formatted
to draw the last character in a line with the appropriate drawing attributes if it needs to redraw it
Screen::alternate_screen
to determine if the alternate screen is in useScreen::row_wrapped
to determine whether the row at the given index should wrap its textScreen::cursor_state_formatted
to set the cursor position and hidden state (including internal state like the one-past-the-end state which isn't visible in the return value ofcursor_position
)
Screen::rows_formatted
now outputs correct escape codes in some edge cases at the beginning of a row when the previous row was wrapped- VPA escape sequence can no longer position the cursor off the screen
Screen::state_formatted
andScreen::state_diff
convenience wrappers
Screen::attributes_formatted
now correctly resets previously set attributes where necessary
- Removed
Screen::attributes_diff
, since I can't actually think of any situation where it does a thing that makes sense.
- Drop dependency on
enumset
Screen::attributes_formatted
andScreen::attributes_diff
to retrieve the current state of the drawing attributes as escape sequencesScreen::fgcolor
,Screen::bgcolor
,Screen::bold
,Screen::italic
,Screen::underline
, andScreen::inverse
to retrieve the current state of the drawing attributes directly
- Implementation of
std::io::Write
forParser
Screen::contents_between
, for returning the contents logically between two given cells (for things like clipboard selection)- Support SGR subparameters (so
\e[38:2:255:0:0m
behaves the same way as\e[38;2;255;0;0m
)
- Bump
enumset
to fix a dependency which fails to build
- Bumped
vte
dep to 0.6.
- Removed the unicode-normalization feature altogether - it turns out that it still has a couple edge cases where it causes incorrect behavior, and fixing those would be a lot more effort.
- Fix a couple more end-of-line/wrapping bugs, especially around cursor positioning.
- Fix applying combining characters to wide characters.
- Ensure cells can't have contents with width zero (to avoid ambiguity). If an empty cell gets a combining character applied to it, default that cell to a (normal-width) space first.
- New (default-on) cargo feature
unicode-normalization
which can be disabled to disable normalizing cell contents to NFC - it's a pretty small edge case, and the data tables required to support it are quite large, which affects size-sensitive targets like wasm
- Fix output of
contents_formatted
andcontents_diff
when the cursor position ends at one past the end of a row. - If the cursor position is one past the end of a row, any char, even a combining char, needs to cause the cursor position to wrap.
- Fix zero-width characters when the cursor is at the end of a row.
- Add more debug logging for unhandled escape sequences.
- Unhandled escape sequence warnings are now at the
debug
log level.
Screen::input_mode_formatted
andScreen::input_mode_diff
give escape codes to set the current terminal input modes.Screen::title_formatted
andScreen::title_diff
give escape codes to set the terminal window title.Screen::bells_diff
gives escape codes to trigger any audible or visual bells which have been seen since the previous state.
Screen::contents_diff
no longer includes audible or visual bells (seeScreen::bells_diff
instead).
Screen::set_size
now actually resizes when requested (previously the underlying storage was not being resized, leading to panics when writing outside of the original screen).
- Scrollback support.
Default
impl forParser
which creates an 80x24 terminal with no scrollback.
Parser::screen_mut
(and thepub
&mut self
methods onScreen
). The few things you can do to change the screen state directly are now exposed as methods onParser
itself.
Cell::contents
now returns aString
instead of a&str
.Screen::check_audible_bell
andScreen::check_visual_bell
have been replaced withScreen::audible_bell_count
andScreen::visual_bell_count
. You should keep track of the "since the last method call" state yourself instead of having the screen track it for you.
- Lots of performance and output optimizations.
- Clearing a cell now sets all of that cell's attributes to the current attribute set, since different terminals render different things for an empty cell based on the attributes.
Screen::contents_diff
now includes audible and visual bells when appropriate.
Screen::fgcolor
,Screen::bgcolor
,Screen::bold
,Screen::italic
,Screen::underline
,Screen::inverse
, andScreen::alternate_screen
: these are just implementation details that people shouldn't need to care about.
- Fixed cursor movement when the cursor position is already outside of an active scroll region.
- Clearing cells now correctly sets the cell background color.
- Fixed a couple bugs in wide character handling in
contents_formatted
andcontents_diff
. - Fixed RI when the cursor is at the top of the screen (fixes scrolling up in
less
, for instance). - Fixed VPA incorrectly being clamped to the scroll region.
- Stop treating soft hyphen specially (as far as i can tell, no other terminals do this, and i'm not sure why i thought it was necessary to begin with).
contents_formatted
now also resets attributes at the start, likecontents_diff
does.
- Make
contents_formatted
explicitly show the cursor when necessary, in case the cursor was previously hidden.
Screen::rows
which is likeScreen::contents
except that it returns the data by row instead of all at once, and also allows you to restrict the region returned to a subset of columns.Screen::rows_formatted
which is likeScreen::rows
, but returns escape sequences sufficient to draw the requested subset of each row.Screen::contents_diff
andScreen::rows_diff
which return escape sequences sufficient to turn the visible state of one screen (or a subset of the screen in the case ofrows_diff
) into another.
- The screen is now exposed separately from the parser, and is cloneable.
contents_formatted
now returnsVec<u8>
instead ofString
.contents
andcontents_formatted
now only allow getting the contents of the entire screen rather than a subset (but see the entry forrows
androws_formatted
above).
Cell::new
, since there's not really any reason that this is useful for someone to do from outside of the crate.
contents_formatted
now preserves the state of empty cells instead of filling them with spaces.- We now clear the row wrapping state when the number of columns in the terminal is changed.
contents_formatted
now ensures that the cursor has the correct hidden state and location.contents_formatted
now clears the screen before starting to draw.
- Reimplemented in pure safe rust, with a much more accurate parser
- A bunch of minor API tweaks, some backwards-incompatible
- Fix returning uninit memory in get_string_formatted/get_string_plaintext
- Handle emoji and zero width unicode characters properly
- Fix cursor positioning with regards to scroll regions and wrapping
- Fix parsing of (ignored) character set escapes
- Explicitly suppress status report escapes
- Fix builds
- Initial release