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
If you are supporting Windows in any capacity, the
is_windows_10() documentation is
Ways to clear the screen.
Detects Microsoft Terminal.
Detects Windows ≥10.