Expand description
Cross-platform terminal screen clearing.
This library provides a set of ways to clear a screen, plus a “best effort” convenience function to do the right thing most of the time.
Unlike many cross-platform libraries, this one exposes every available choice all the time, and only the convenience function varies based on compilation target or environmental factors.
90% of the time, you’ll want to use the convenience short-hand:
clearscreen::clear().expect("failed to clear screen");For anything else, refer to the ClearScreen enum.
On Windows, the sequence-based methods enable VT processing on the console for the duration of the operation (restoring the previous console mode afterwards), with no version detection or manifest required; if the console host does not support VT escapes, they fall back to the legacy Windows Console clear.
Structs§
- NixError
- Nix error type.
- Terminfo
Error - Terminfo error type.
Enums§
- Clear
Screen - Ways to clear the screen.
- Error
- Error type.
Functions§
- clear
- Shorthand for
ClearScreen::default().clear(). - is_
microsoft_ terminal - Detects whether the console host supports VT escape processing.