1e332daaed
- 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
40 lines
1.5 KiB
Markdown
40 lines
1.5 KiB
Markdown
From `crossterm 0.6` you are able to use feature flags.
|
|
|
|
With feature flags you can pick the features you want which reduces the size of the library and could prevent you from having unnecessary dependencies.
|
|
|
|
Crossterm provides the following feature flags:
|
|
- input ; reading input events
|
|
- terminal ; terminal actions like resizing
|
|
- style ; styling of the terminal
|
|
- cursor ; moving the terminal cursor
|
|
- screen ; alternate and raw screen
|
|
|
|
By default all of those will be enabled.
|
|
|
|
_Cargo.toml_
|
|
|
|
```
|
|
[dependencies]
|
|
crossterm = { version="0.9", default-features = false, features = ["screen", "terminal", "cursor", "style", "input"] }
|
|
```
|
|
|
|
By default all flags are enabled, the types and functions available to use depend on the specified flags.
|
|
|
|
```rust
|
|
"cursor" => cursor, TerminalCursor
|
|
"input" => input, AsyncReader, InputEvent, KeyEvent, MouseButton, MouseEvent, SyncReader, TerminalInput
|
|
"screen" => AlternateScreen, IntoRawMode, RawScreen
|
|
"style" => color, style, Attribute, Color, Colored, Colorize, ObjectStyle, StyledObject, Styler, TerminalColor,
|
|
"terminal" => terminal, ClearType, Terminal
|
|
```
|
|
|
|
You can also use all the crossterm modules individually by directly referencing the crate.
|
|
|
|
- [Crossterm Style](https://crates.io/crates/crossterm_style)
|
|
- [Crossterm Input](https://crates.io/crates/crossterm_input)
|
|
- [Crossterm Screen](https://crates.io/crates/crossterm_screen)
|
|
- [Crossterm Cursor](https://crates.io/crates/crossterm_cursor)
|
|
- [Crossterm Terminal](https://crates.io/crates/crossterm_terminal)
|
|
|
|
|