- Major refactor and cleanup.
- Improved performance;
- No locking when writing to stdout.
- UNIX doesn't have any dynamic dispatch anymore.
- Windows has improved the way to check if ANSI modes are enabled.
- Removed lot's of complex API calls: `from_screen`, `from_output`
- Removed `Arc<TerminalOutput>` from all internal Api's.
- Removed termios dependency for UNIX systems.
- Upgraded deps.
- Removed about 1000 lines of code
- `TerminalOutput`
- `Screen`
- unsafe code
- Some duplicated code introduced by a previous refactor.
- Raw modes UNIX systems improved
- Added `NoItalic` attribute
22 lines
650 B
Rust
22 lines
650 B
Rust
extern crate crossterm;
|
|
|
|
use crossterm::{Color, Crossterm};
|
|
|
|
/// use the `Crossterm` to get an instance to the cursor module | demonstration.
|
|
pub fn main() {
|
|
// Create the crossterm type to access different modules.
|
|
let crossterm = Crossterm::new();
|
|
|
|
// pass a reference to the current screen.
|
|
let cursor = crossterm.cursor();
|
|
let color = crossterm.color();
|
|
let terminal = crossterm.terminal();
|
|
let terminal = crossterm.input();
|
|
let style = crossterm
|
|
.style("Black font on green background")
|
|
.with(Color::Black)
|
|
.on(Color::Green);
|
|
|
|
// TODO: perform some actions with the instances above.
|
|
}
|