Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update crossterm to the latest version #277

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inquire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
crossterm = { version = "0.25", optional = true }
crossterm = { version = "0.28.1", optional = true }
termion = { version = "2.0", optional = true }
console = { version = "0.15", optional = true, features = [
"windows-console-colors",
Expand All @@ -52,7 +52,7 @@ unicode-width = "0.1"
fxhash = "0.2"

[dev-dependencies]
rstest = "0.18.2"
rstest = "0.22.0"
chrono = { version = "0.4" }

[[example]]
Expand Down
6 changes: 4 additions & 2 deletions inquire/src/terminal/crossterm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::io::{stderr, Result, Stderr, Write};

use crossterm::{
cursor,
event::{self, KeyCode, KeyEvent, KeyModifiers},
event::{self, KeyCode, KeyEvent, KeyEventKind, KeyModifiers},
queue,
style::{Attribute, Color, Print, SetAttribute, SetBackgroundColor, SetForegroundColor},
terminal::{self, ClearType},
Expand Down Expand Up @@ -38,7 +38,9 @@ impl InputReader for CrosstermKeyReader {
fn read_key(&mut self) -> InquireResult<Key> {
loop {
if let event::Event::Key(key_event) = event::read()? {
return Ok(key_event.into());
if KeyEventKind::Press == key_event.kind {
return Ok(key_event.into());
}
}
}
}
Expand Down
Loading