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

0.23 #627

Merged
merged 7 commits into from
Feb 6, 2022
Merged

0.23 #627

Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Version 0.23
- Update dependencies.
- Add 0 check for all cursor functions to prevent undefined behaviour.
- Add CSLu key parsing for unix.
TimonPost marked this conversation as resolved.
Show resolved Hide resolved
- Improve control character window key parsing supporting (e.g. CTRL [ and ])
- Update library to 2021 edition.

# Version 0.22.1
- Update yanked version crossterm-winapi and move to crossterm-winapi 0.9.0.
- Changed panic to error when calling disable-mouse capture without setting it first.
Expand Down
16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "crossterm"
version = "0.22.1"
version = "0.23"
authors = ["T. Post"]
description = "A crossplatform terminal library for manipulating terminals."
repository = "https://github.com/crossterm-rs/crossterm"
Expand All @@ -9,7 +9,7 @@ license = "MIT"
keywords = ["event", "color", "cli", "input", "terminal"]
exclude = ["target", "Cargo.lock"]
readme = "README.md"
edition = "2018"
edition = "2021"
categories = ["command-line-interface", "command-line-utilities"]

[lib]
Expand All @@ -34,7 +34,7 @@ event-stream = ["futures-core"]
#
[dependencies]
bitflags = "1.3"
parking_lot = "0.11"
parking_lot = "0.12"

# optional deps only added when requested
futures-core = { version = "0.3", optional = true, default-features = false }
Expand All @@ -45,7 +45,7 @@ serde = { version = "1.0", features = ["derive"], optional = true }
#
[target.'cfg(windows)'.dependencies.winapi]
version = "0.3.9"
features = ["winuser"]
features = ["winuser", "winerror"]

[target.'cfg(windows)'.dependencies]
crossterm_winapi = "0.9"
Expand All @@ -56,18 +56,18 @@ crossterm_winapi = "0.9"
[target.'cfg(unix)'.dependencies]
libc = "0.2"
mio = { version="0.7", features=["os-poll"] }
signal-hook = { version = "0.3.8" }
signal-hook = { version = "0.3.13" }
signal-hook-mio = { version = "0.2.1", features = ["support-v0_7"] }

#
# Dev dependencies (examples, ...)
#
[dev-dependencies]
tokio = { version = "1.5", features = ["full"] }
tokio = { version = "1.16.1", features = ["full"] }
futures = "0.3"
futures-timer = "3.0"
async-std = "1.9"
serde_json = "1.0.45"
async-std = "1.10"
serde_json = "1.0"

#
# Examples
Expand Down
10 changes: 8 additions & 2 deletions src/cursor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ pub struct MoveToColumn(pub u16);

impl Command for MoveToColumn {
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
write!(f, csi!("{}G"), self.0)
if self.0 != 0 {
write!(f, csi!("{}G"), self.0)?;
}
Ok(())
}

#[cfg(windows)]
Expand All @@ -153,7 +156,10 @@ pub struct MoveToRow(pub u16);

impl Command for MoveToRow {
fn write_ansi(&self, f: &mut impl fmt::Write) -> fmt::Result {
write!(f, csi!("{}d"), self.0)
if self.0 != 0 {
write!(f, csi!("{}d"), self.0)?
}
Ok(())
}

#[cfg(windows)]
Expand Down