diff --git a/Cargo.lock b/Cargo.lock index efd4b45c2c3..f94713845a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -847,13 +847,14 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" +checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" dependencies = [ "castaway", "cfg-if", "itoa", + "rustversion", "ryu", "static_assertions", ] @@ -1015,16 +1016,16 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crossterm" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" +checksum = "829d955a0bb380ef178a640b91779e3987da38c9aea133b20614cfed8cdea9c6" dependencies = [ "bitflags 2.6.0", "crossterm_winapi", "filedescriptor", - "libc", - "mio 0.8.11", + "mio", "parking_lot", + "rustix", "serde", "signal-hook", "signal-hook-mio", @@ -2208,6 +2209,12 @@ dependencies = [ "web-time", ] +[[package]] +name = "indoc" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5" + [[package]] name = "inout" version = "0.1.3" @@ -2217,6 +2224,20 @@ dependencies = [ "generic-array", ] +[[package]] +name = "instability" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "898e106451f7335950c9cc64f8ec67b5f65698679ac67ed00619aeef14e1cf75" +dependencies = [ + "darling", + "indoc", + "pretty_assertions", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "interim" version = "0.1.2" @@ -2558,18 +2579,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eea6e49e831ee0ee624f0435c357e452f6a68e194335f457a4d1551c09c9a300" -[[package]] -name = "mio" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "mio" version = "1.0.3" @@ -2577,6 +2586,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", + "log", "wasi", "windows-sys 0.52.0", ] @@ -3376,23 +3386,23 @@ dependencies = [ [[package]] name = "ratatui" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16546c5b5962abf8ce6e2881e722b4e0ae3b6f1a08a26ae3573c55853ca68d3" +checksum = "eabd94c2f37801c20583fc49dd5cd6b0ba68c716787c2dd6ed18571e1e63117b" dependencies = [ "bitflags 2.6.0", "cassowary", "compact_str", "crossterm", + "indoc", + "instability", "itertools", "lru", "paste", - "stability", "strum", - "strum_macros", "unicode-segmentation", "unicode-truncate", - "unicode-width 0.1.14", + "unicode-width 0.2.0", ] [[package]] @@ -4061,7 +4071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34db1a06d485c9142248b7a054f034b349b212551f3dfd19c94d45a754a217cd" dependencies = [ "libc", - "mio 0.8.11", + "mio", "signal-hook", ] @@ -4375,16 +4385,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "stability" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" -dependencies = [ - "quote", - "syn", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4694,7 +4694,7 @@ dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.3", + "mio", "parking_lot", "pin-project-lite", "signal-hook-registry", diff --git a/crates/atuin-client/Cargo.toml b/crates/atuin-client/Cargo.toml index 02f189595c6..56d1e6d250f 100644 --- a/crates/atuin-client/Cargo.toml +++ b/crates/atuin-client/Cargo.toml @@ -57,10 +57,7 @@ serde_with = "3.8.1" # encryption rusty_paseto = { version = "0.7.0", default-features = false } -rusty_paserk = { version = "0.4.0", default-features = false, features = [ - "v4", - "serde", -] } +rusty_paserk = { version = "0.4.0", default-features = false, features = ["v4", "serde"] } # sync urlencoding = { version = "2.1.0", optional = true } @@ -71,7 +68,7 @@ indicatif = "0.17.7" tiny-bip39 = "=1.0.0" # theme -crossterm = { version = "0.27.0", features = ["serde"] } +crossterm = { version = "0.28.1", features = ["serde"] } palette = { version = "0.7.5", features = ["serializing"] } lazy_static = "1.4.0" strum_macros = "0.26.3" diff --git a/crates/atuin-history/Cargo.toml b/crates/atuin-history/Cargo.toml index fc3fc88a47c..305323a8837 100644 --- a/crates/atuin-history/Cargo.toml +++ b/crates/atuin-history/Cargo.toml @@ -24,7 +24,7 @@ directories = { workspace = true } indicatif = "0.17.5" serde = { workspace = true } serde_json = { workspace = true } -crossterm = { version = "0.27", features = ["use-dev-tty"] } +crossterm = { version = "0.28.1", features = ["use-dev-tty"] } unicode-width = "0.1" itertools = { workspace = true } tokio = { workspace = true } diff --git a/crates/atuin/Cargo.toml b/crates/atuin/Cargo.toml index ca9bfcd96f0..a43bf563d7f 100644 --- a/crates/atuin/Cargo.toml +++ b/crates/atuin/Cargo.toml @@ -58,7 +58,7 @@ directories = { workspace = true } indicatif = "0.17.5" serde = { workspace = true } serde_json = { workspace = true } -crossterm = { version = "0.27", features = ["use-dev-tty"] } +crossterm = { version = "0.28.1", features = ["use-dev-tty"] } unicode-width = "0.1" itertools = { workspace = true } tokio = { workspace = true } @@ -78,13 +78,13 @@ tiny-bip39 = "1" futures-util = "0.3" fuzzy-matcher = "0.3.7" colored = "2.0.4" -ratatui = "0.27" +ratatui = "0.29.0" tracing = "0.1" tracing-subscriber = { workspace = true } uuid = { workspace = true } unicode-segmentation = "1.11.0" sysinfo = "0.30.7" -regex="1.10.5" +regex = "1.10.5" [target.'cfg(any(target_os = "windows", target_os = "macos"))'.dependencies] arboard = { version = "3.4", optional = true } diff --git a/crates/atuin/src/command/client/search/history_list.rs b/crates/atuin/src/command/client/search/history_list.rs index ace8234bb9a..792e89b86ed 100644 --- a/crates/atuin/src/command/client/search/history_list.rs +++ b/crates/atuin/src/command/client/search/history_list.rs @@ -7,6 +7,7 @@ use atuin_client::{ use atuin_common::utils::Escapable as _; use ratatui::{ buffer::Buffer, + crossterm::style, layout::Rect, style::{Modifier, Style}, widgets::{Block, StatefulWidget, Widget}, @@ -206,7 +207,7 @@ impl DrawState<'_> { { // if not applying alternative highlighting to the whole row, color the command style = self.theme.as_style(Meaning::AlertError); - style.attributes.set(crossterm::style::Attribute::Bold); + style.attributes.set(style::Attribute::Bold); } for section in h.command.escape_control().split_ascii_whitespace() { diff --git a/crates/atuin/src/command/client/search/inspector.rs b/crates/atuin/src/command/client/search/inspector.rs index 05a0fe2173a..718433c211c 100644 --- a/crates/atuin/src/command/client/search/inspector.rs +++ b/crates/atuin/src/command/client/search/inspector.rs @@ -5,8 +5,8 @@ use atuin_client::{ history::{History, HistoryStats}, settings::Settings, }; -use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use ratatui::{ + crossterm::event::{KeyCode, KeyEvent, KeyModifiers}, layout::Rect, prelude::{Constraint, Direction, Layout}, style::Style, diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs index a2d32ee8d48..c1a678f0872 100644 --- a/crates/atuin/src/command/client/search/interactive.rs +++ b/crates/atuin/src/command/client/search/interactive.rs @@ -4,15 +4,6 @@ use std::{ }; use atuin_common::utils::{self, Escapable as _}; -use crossterm::{ - cursor::SetCursorStyle, - event::{ - self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers, - KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags, - PushKeyboardEnhancementFlags, - }, - execute, terminal, -}; use eyre::Result; use futures_util::FutureExt; use semver::Version; @@ -38,6 +29,15 @@ use crate::{command::client::search::engines, VERSION}; use ratatui::{ backend::CrosstermBackend, + crossterm::{ + cursor::SetCursorStyle, + event::{ + self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent, KeyModifiers, + KeyboardEnhancementFlags, MouseEvent, PopKeyboardEnhancementFlags, + PushKeyboardEnhancementFlags, + }, + execute, terminal, + }, layout::{Alignment, Constraint, Direction, Layout}, prelude::*, style::{Modifier, Style}, @@ -588,13 +588,13 @@ impl State { theme: &Theme, ) { let compact = match settings.style { - atuin_client::settings::Style::Auto => f.size().height < 14, + atuin_client::settings::Style::Auto => f.area().height < 14, atuin_client::settings::Style::Compact => true, atuin_client::settings::Style::Full => false, }; let invert = settings.invert; let border_size = if compact { 0 } else { 1 }; - let preview_width = f.size().width - 2; + let preview_width = f.area().width - 2; let preview_height = Self::calc_preview_height( settings, results, @@ -604,12 +604,12 @@ impl State { border_size, preview_width, ); - let show_help = settings.show_help && (!compact || f.size().height > 1); + let show_help = settings.show_help && (!compact || f.area().height > 1); // This is an OR, as it seems more likely for someone to wish to override // tabs unexpectedly being missed, than unexpectedly present. let hide_extra = settings.auto_hide_height != 0 && compact - && f.size().height <= settings.auto_hide_height; + && f.area().height <= settings.auto_hide_height; let show_tabs = settings.show_tabs && !hide_extra; let chunks = Layout::default() .direction(Direction::Vertical) @@ -643,7 +643,7 @@ impl State { } .as_ref(), ) - .split(f.size()); + .split(f.area()); let input_chunk = if invert { chunks[0] } else { chunks[3] }; let results_list_chunk = if invert { chunks[1] } else { chunks[2] }; @@ -722,9 +722,8 @@ impl State { let message = Paragraph::new("Nothing to inspect") .block( Block::new() - .title( - Title::from(" Info ".to_string()).alignment(Alignment::Center), - ) + .title(Title::from(" Info ".to_string())) + .title_alignment(Alignment::Center) .borders(Borders::ALL) .padding(Padding::vertical(2)), ) @@ -774,11 +773,11 @@ impl State { let extra_width = UnicodeWidthStr::width(self.search.input.substring()); let cursor_offset = if compact { 0 } else { 1 }; - f.set_cursor( + f.set_cursor_position(( // Put cursor past the end of the input text input_chunk.x + extra_width as u16 + PREFIX_LENGTH + 1 + cursor_offset, input_chunk.y + cursor_offset, - ); + )); } }