From 41ff73e3d376382dd102ddea42d9dabb20910a27 Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 13 Dec 2019 07:12:35 +0100 Subject: [PATCH] 0.14 (#343) --- CHANGELOG.md | 20 ++++++++++++-------- Cargo.toml | 6 +++--- README.md | 47 ++++++++++++++++++++-------------------------- examples/README.md | 9 +++++---- src/cursor.rs | 2 +- src/style.rs | 2 +- src/terminal.rs | 2 +- 7 files changed, 43 insertions(+), 45 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bd7c1b..7731183 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,20 +1,24 @@ -# Version Master +# Version 0.14 -- `queue!` & `execute!` macros allow trailing comma - Replace the `input` module with brand new `event` module - - It's **highly recommended** to read the + - Terminal Resize Events + - Advanced modifier (SHIFT | ALT | CTRL) support for both mouse and key events and + - futures Stream (feature 'event-stream') + - Poll/read API + - It's **highly recommended** to read the [Upgrade from 0.13 to 0.14](https://github.com/crossterm-rs/crossterm/wiki/Upgrade-from-0.13-to-0.14) - documentation + documentation - Replace `docs/UPGRADE.md` with the [Upgrade Paths](https://github.com/crossterm-rs/crossterm/wiki#upgrade-paths) documentation - - Add `MoveToColumn`, `MoveToPreviousLine`, `MoveToNextLine` commands - - Merge `screen` module into `terminal` +- Add `MoveToColumn`, `MoveToPreviousLine`, `MoveToNextLine` commands +- Merge `screen` module into `terminal` - Remove `screen::AlternateScreen` - Remove `screen::Rawscreen` - * Move and rename `Rawscreen::into_raw_mode` and `Rawscreen::disable_raw_mode` to `terminal::enable_raw_mode` and `terminal::disable_raw_mode` + * Move and rename `Rawscreen::into_raw_mode` and `Rawscreen::disable_raw_mode` to `terminal::enable_raw_mode` and `terminal::disable_raw_mode` - Move `screen::EnterAlternateScreen` and `screen::LeaveAlternateScreen` to `terminal::EnterAlternateScreen` and `terminal::LeaveAlternateScreen` - Replace `utils::Output` command with `style::Print` command - - Fix enable/disable mouse capture commands on Windows. +- Fix enable/disable mouse capture commands on Windows +- Allow trailing comma `queue!` & `execute!` macros # Version 0.13.3 diff --git a/Cargo.toml b/Cargo.toml index 25d8599..35ecd42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "crossterm" -version = "0.13.3" +version = "0.14.0" authors = ["T. Post"] description = "An crossplatform terminal library for manipulating terminals." repository = "https://github.com/crossterm-rs/crossterm" documentation = "https://docs.rs/crossterm/" license = "MIT" -keywords = ["console", "color", "cursor", "input", "terminal"] +keywords = ["event", "color", "cursor", "input", "terminal"] exclude = ["target", "Cargo.lock"] readme = "README.md" edition = "2018" @@ -55,7 +55,7 @@ crossterm_winapi = "0.5.1" [target.'cfg(unix)'.dependencies] libc = "0.2.51" mio = "0.6.19" -signal-hook = { version = "0.1.11", features = ["mio-support"] } +signal-hook = { version = "0.1.12", features = ["mio-support"] } # # Dev dependencies (examples, ...) diff --git a/README.md b/README.md index c5c1fb0..5b4628c 100644 --- a/README.md +++ b/README.md @@ -49,33 +49,36 @@ repository. Sorry for the inconvenience. - Multi-threaded (send, sync) - Detailed documentation - Few dependencies -- Full control over output buffer -- Cursor (feature `cursor`) +- Full control over writing and flushing output buffer +- Cursor - Move the cursor N times (up, down, left, right) + - Move to previous / next line + - Move to column - Set/get the cursor position - Store the cursor position and restore to it later - Hide/show the cursor - Enable/disable cursor blinking (not all terminals do support this feature) -- Styled output (feature `style`) +- Styled output - Foreground color (16 base colors) - Background color (16 base colors) - 256 (ANSI) color support (Windows 10 and UNIX only) - RGB color support (Windows 10 and UNIX only) - - Text attributes like bold, italic, underscore, crossed, etc. -- Terminal (feature `terminal`) + - Text attributes like bold, italic, underscore, crossed, etc +- Terminal - Clear (all lines, current line, from cursor down and up, until new line) - Scroll up, down - Set/get the terminal size - Exit current process -- Input (feature `input`) - - Read character - - Read line - - Read key input events (async / sync) - - Read mouse input events (press, release, position, button) -- Screen (feature `screen`) - Alternate screen - Raw screen - +- Input + - Input Events + - Mouse Events (press, release, position, button, drag) + - Terminal Resize Events + - Advanced modifier (SHIFT | ALT | CTRL) support for both mouse and key events and + - futures Stream (feature 'event-stream') + - Poll/read API + @@ -141,22 +144,18 @@ Checkout this [list](https://docs.rs/crossterm/0.13.0/crossterm/index.html#suppo ### Feature Flags -All features are enabled by default. You can disable default features and enable some of them only. +To optional feature flags. ```toml [dependencies.crossterm] -version = "0.12" +version = "0.14" default-features = false # Disable default features -features = ["cursor", "screen"] # Enable required features only +features = ["event-stream"] # Enable required features only ``` | Feature | Description | | :-- | :-- | -| `input` | Sync/Async input readers | -| `cursor` | Cursor manipulation | -| `screen` | Alternate screen & raw mode | -| `terminal` | Size, clear, scroll | -| `style` | Colors, text attributes | +| `event-stream` | `futures::Stream` producing `Result`.| ### Other Resources @@ -172,19 +171,13 @@ features = ["cursor", "screen"] # Enable required features only ## Contributing -I highly appreciate when anyone contributes to this crate. Before you do, please, +We highly appreciate when anyone contributes to this crate. Before you do, please, read the [Contributing](docs/CONTRIBUTING.md) guidelines. ## Authors * **Timon Post** - *Project Owner & creator* -## Support - -Would you like Crossterm to be even more gorgeous and beautiful? You can help with this by donating. - -[![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Z8QK6XU749JB2) - ## License This project, `crossterm` and all it's sub-crates: `crossterm_screen`, `crossterm_cursor`, `crossterm_style`, diff --git a/examples/README.md b/examples/README.md index 560212b..8626620 100644 --- a/examples/README.md +++ b/examples/README.md @@ -12,10 +12,11 @@ The examples are compatible with the latest release. │   └── event-* │   └── stderr ``` - -* `examples/interactive-test`, interactive demo -* `event-*`, event reading demo -* `stderr` , crossterm over stderr demo +| File Name | Description | Topics +| :------- | :------- | :------- | +| `examples/interactive-test` | interactive, walk trough, demo | cursor, style, event +| `event-*`| event reading demos | (async) event reading +| `stderr` | crossterm over stderr demo, | raw mode, alternate screen, custom output ## Run examples diff --git a/src/cursor.rs b/src/cursor.rs index d898fd3..47fd8a5 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -4,7 +4,7 @@ //! //! This documentation does not contain a lot of examples. The reason is that it's fairly //! obvious how to use this crate. Although, we do provide -//! [examples](https://github.com/crossterm-rs/examples) repository +//! [examples](https://github.com/crossterm-rs/crossterm/tree/master/examples) repository //! to demonstrate the capabilities. //! //! ## Examples diff --git a/src/style.rs b/src/style.rs index 4972fff..7b020ba 100644 --- a/src/style.rs +++ b/src/style.rs @@ -4,7 +4,7 @@ //! //! This documentation does not contain a lot of examples. The reason is that it's fairly //! obvious how to use this crate. Although, we do provide -//! [examples](https://github.com/crossterm-rs/examples) repository +//! [examples](https://github.com/crossterm-rs/crossterm/tree/master/examples) repository //! to demonstrate the capabilities. //! //! ## Platform-specific Notes diff --git a/src/terminal.rs b/src/terminal.rs index a32be19..856c4eb 100644 --- a/src/terminal.rs +++ b/src/terminal.rs @@ -4,7 +4,7 @@ //! //! This documentation does not contain a lot of examples. The reason is that it's fairly //! obvious how to use this crate. Although, we do provide -//! [examples](https://github.com/crossterm-rs/examples) repository +//! [examples](https://github.com/crossterm-rs/crossterm/tree/master/examples) repository //! to demonstrate the capabilities. //! //! Most terminal actions can be performed with commands.