aboutsummaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/atuin-client/Cargo.toml2
-rw-r--r--crates/atuin-history/Cargo.toml2
-rw-r--r--crates/atuin/Cargo.toml4
-rw-r--r--crates/atuin/src/command/client/search/history_list.rs19
-rw-r--r--crates/atuin/src/command/client/search/inspector.rs29
-rw-r--r--crates/atuin/src/command/client/search/interactive.rs19
6 files changed, 39 insertions, 36 deletions
diff --git a/crates/atuin-client/Cargo.toml b/crates/atuin-client/Cargo.toml
index 2e65409f..e2ad5a00 100644
--- a/crates/atuin-client/Cargo.toml
+++ b/crates/atuin-client/Cargo.toml
@@ -68,7 +68,7 @@ indicatif = "0.18.0"
tiny-bip39 = "=1.0.0"
# theme
-crossterm = { version = "0.28.1", features = ["serde"] }
+crossterm = { version = "0.29.0", 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 fe597303..ce4220b1 100644
--- a/crates/atuin-history/Cargo.toml
+++ b/crates/atuin-history/Cargo.toml
@@ -18,7 +18,7 @@ atuin-client = { path = "../atuin-client", version = "18.11.0" }
time = { workspace = true }
serde = { workspace = true }
-crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
+crossterm = { version = "0.29.0", features = ["use-dev-tty"] }
unicode-segmentation = "1.11.0"
[dev-dependencies]
diff --git a/crates/atuin/Cargo.toml b/crates/atuin/Cargo.toml
index 9c4e3de8..77f8dc0a 100644
--- a/crates/atuin/Cargo.toml
+++ b/crates/atuin/Cargo.toml
@@ -65,7 +65,7 @@ eyre = { workspace = true }
indicatif = "0.18.0"
serde = { workspace = true }
serde_json = { workspace = true }
-crossterm = { version = "0.28.1", features = ["use-dev-tty"] }
+crossterm = { version = "0.29.0", features = ["use-dev-tty"] }
unicode-width = "0.2"
itertools = { workspace = true }
tokio = { workspace = true }
@@ -83,7 +83,7 @@ tiny-bip39 = "1"
futures-util = "0.3"
fuzzy-matcher = "0.3.7"
colored = "2.0.4"
-ratatui = "0.29.0"
+ratatui = "0.30.0"
tracing = "0.1"
tracing-subscriber = { workspace = true }
uuid = { workspace = true }
diff --git a/crates/atuin/src/command/client/search/history_list.rs b/crates/atuin/src/command/client/search/history_list.rs
index 565a7972..864a161c 100644
--- a/crates/atuin/src/command/client/search/history_list.rs
+++ b/crates/atuin/src/command/client/search/history_list.rs
@@ -10,6 +10,7 @@ use atuin_client::{
use atuin_common::utils::Escapable as _;
use itertools::Itertools;
use ratatui::{
+ backend::FromCrossterm,
buffer::Buffer,
crossterm::style,
layout::Rect,
@@ -256,7 +257,7 @@ impl DrawState<'_> {
let w = width as usize;
// Right-align duration within its column width, plus trailing space
let display = format!("{formatted:>w$} ");
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
fn time(&mut self, h: &History, width: u16) {
@@ -274,7 +275,7 @@ impl DrawState<'_> {
let w = width as usize;
let time_str = format!("{time} ago");
let display = format!("{time_str:>w$} ");
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
fn command(&mut self, h: &History) {
@@ -299,7 +300,7 @@ impl DrawState<'_> {
let mut pos = 0;
for section in h.command.escape_control().split_ascii_whitespace() {
if pos != 0 {
- self.draw(" ", style.into());
+ self.draw(" ", Style::from_crossterm(style));
}
for ch in section.chars() {
if self.x > self.list_area.width {
@@ -317,7 +318,7 @@ impl DrawState<'_> {
style.attributes.set(style::Attribute::Bold);
}
let s = ch.to_string();
- self.draw(&s, style.into());
+ self.draw(&s, Style::from_crossterm(style));
pos += s.len();
}
pos += 1;
@@ -337,7 +338,7 @@ impl DrawState<'_> {
.unwrap_or_else(|_| "????-??-?? ??:??".to_string());
let w = width as usize;
let display = format!("{formatted:w$} ");
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
/// Render the directory column (working directory, truncated)
@@ -354,7 +355,7 @@ impl DrawState<'_> {
} else {
format!("{cwd:w$} ")
};
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
/// Render the host column (just the hostname)
@@ -371,7 +372,7 @@ impl DrawState<'_> {
} else {
format!("{host:w$} ")
};
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
/// Render the user column
@@ -388,7 +389,7 @@ impl DrawState<'_> {
} else {
format!("{user:w$} ")
};
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
/// Render the exit code column
@@ -400,7 +401,7 @@ impl DrawState<'_> {
};
let w = width as usize;
let display = format!("{:>w$} ", h.exit);
- self.draw(&display, style.into());
+ self.draw(&display, Style::from_crossterm(style));
}
fn draw(&mut self, s: &str, mut style: Style) {
diff --git a/crates/atuin/src/command/client/search/inspector.rs b/crates/atuin/src/command/client/search/inspector.rs
index 890f7ff7..685ed1da 100644
--- a/crates/atuin/src/command/client/search/inspector.rs
+++ b/crates/atuin/src/command/client/search/inspector.rs
@@ -7,6 +7,7 @@ use atuin_client::{
};
use ratatui::{
Frame,
+ backend::FromCrossterm,
crossterm::event::{KeyCode, KeyEvent, KeyModifiers},
layout::Rect,
prelude::{Constraint, Direction, Layout},
@@ -56,16 +57,16 @@ pub fn draw_commands(
let command = Paragraph::new(Text::from(Span::styled(
history.command.clone(),
- theme.as_style(Meaning::Important),
+ Style::from_crossterm(theme.as_style(Meaning::Important)),
)))
.block(if compact {
Block::new()
.borders(Borders::NONE)
- .style(theme.as_style(Meaning::Base))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Base)))
} else {
Block::new()
.borders(Borders::ALL)
- .style(theme.as_style(Meaning::Base))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Base)))
.title("Command")
.padding(Padding::horizontal(1))
});
@@ -79,11 +80,11 @@ pub fn draw_commands(
.block(if compact {
Block::new()
.borders(Borders::NONE)
- .style(theme.as_style(Meaning::Annotation))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation)))
} else {
Block::new()
.borders(Borders::ALL)
- .style(theme.as_style(Meaning::Annotation))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation)))
.title("Previous command")
.padding(Padding::horizontal(1))
});
@@ -99,13 +100,13 @@ pub fn draw_commands(
.block(if compact {
Block::new()
.borders(Borders::NONE)
- .style(theme.as_style(Meaning::Annotation))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation)))
} else {
Block::new()
.borders(Borders::ALL)
.title("Next command")
.padding(Padding::horizontal(1))
- .style(theme.as_style(Meaning::Annotation))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation)))
});
f.render_widget(previous, commands[0]);
@@ -149,7 +150,7 @@ pub fn draw_stats_table(
Block::default()
.title("Command stats")
.borders(Borders::ALL)
- .style(theme.as_style(Meaning::Base))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Base)))
.padding(Padding::vertical(1)),
);
@@ -202,7 +203,7 @@ fn draw_stats_charts(f: &mut Frame<'_>, parent: Rect, stats: &HistoryStats, them
.iter()
.map(|(exit, count)| {
Bar::default()
- .label(exit.to_string().into())
+ .label(exit.to_string())
.value(u64_or_zero(*count))
})
.collect();
@@ -211,7 +212,7 @@ fn draw_stats_charts(f: &mut Frame<'_>, parent: Rect, stats: &HistoryStats, them
.block(
Block::default()
.title("Exit code distribution")
- .style(theme.as_style(Meaning::Base))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Base)))
.borders(Borders::ALL),
)
.bar_width(3)
@@ -226,7 +227,7 @@ fn draw_stats_charts(f: &mut Frame<'_>, parent: Rect, stats: &HistoryStats, them
.iter()
.map(|(day, count)| {
Bar::default()
- .label(num_to_day(day.as_str()).into())
+ .label(num_to_day(day.as_str()))
.value(u64_or_zero(*count))
})
.collect();
@@ -235,7 +236,7 @@ fn draw_stats_charts(f: &mut Frame<'_>, parent: Rect, stats: &HistoryStats, them
.block(
Block::default()
.title("Runs per day")
- .style(theme.as_style(Meaning::Base))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Base)))
.borders(Borders::ALL),
)
.bar_width(3)
@@ -251,7 +252,7 @@ fn draw_stats_charts(f: &mut Frame<'_>, parent: Rect, stats: &HistoryStats, them
.map(|(date, duration)| {
let d = Duration::from_nanos(u64_or_zero(*duration));
Bar::default()
- .label(date.clone().into())
+ .label(date.clone())
.value(u64_or_zero(*duration))
.text_value(format_duration(d))
})
@@ -261,7 +262,7 @@ fn draw_stats_charts(f: &mut Frame<'_>, parent: Rect, stats: &HistoryStats, them
.block(
Block::default()
.title("Duration over time")
- .style(theme.as_style(Meaning::Base))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Base)))
.borders(Borders::ALL),
)
.bar_width(5)
diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs
index bda4873d..116421a2 100644
--- a/crates/atuin/src/command/client/search/interactive.rs
+++ b/crates/atuin/src/command/client/search/interactive.rs
@@ -29,7 +29,7 @@ use crate::{VERSION, command::client::search::engines};
use ratatui::{
Frame, Terminal, TerminalOptions, Viewport,
- backend::CrosstermBackend,
+ backend::{CrosstermBackend, FromCrossterm},
crossterm::{
cursor::SetCursorStyle,
event::{
@@ -42,7 +42,7 @@ use ratatui::{
prelude::*,
style::{Modifier, Style},
text::{Line, Span, Text},
- widgets::{Block, BorderType, Borders, Padding, Paragraph, Tabs, block::Title},
+ widgets::{Block, BorderType, Borders, Padding, Paragraph, Tabs},
};
#[cfg(not(target_os = "windows"))]
@@ -883,7 +883,7 @@ impl State {
.block(Block::default().borders(Borders::NONE))
.select(self.tab_index)
.style(Style::default())
- .highlight_style(theme.as_style(Meaning::Important));
+ .highlight_style(Style::from_crossterm(theme.as_style(Meaning::Important)));
f.render_widget(tabs, tabs_chunk);
}
@@ -954,7 +954,7 @@ impl State {
let message = Paragraph::new("Nothing to inspect")
.block(
Block::new()
- .title(Title::from(" Info ".to_string()))
+ .title(Line::from(" Info ".to_string()))
.title_alignment(Alignment::Center)
.borders(Borders::ALL)
.padding(Padding::vertical(2)),
@@ -1055,13 +1055,13 @@ impl State {
fn build_title(&self, theme: &Theme) -> Paragraph<'_> {
let title = if self.update_needed.is_some() {
- let error_style: Style = theme.get_error().into();
+ let error_style: Style = Style::from_crossterm(theme.get_error());
Paragraph::new(Text::from(Span::styled(
format!("Atuin v{VERSION} - UPDATE"),
error_style.add_modifier(Modifier::BOLD),
)))
} else {
- let style: Style = theme.as_style(Meaning::Base).into();
+ let style: Style = Style::from_crossterm(theme.as_style(Meaning::Base));
Paragraph::new(Text::from(Span::styled(
format!("Atuin v{VERSION}"),
style.add_modifier(Modifier::BOLD),
@@ -1105,7 +1105,7 @@ impl State {
_ => unreachable!("invalid tab index"),
}
- .style(theme.as_style(Meaning::Annotation))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation)))
.alignment(Alignment::Center)
}
@@ -1114,7 +1114,7 @@ impl State {
"history count: {}",
self.history_count,
))))
- .style(theme.as_style(Meaning::Annotation))
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation)))
.alignment(Alignment::Right)
}
@@ -1228,7 +1228,8 @@ impl State {
.border_type(BorderType::Rounded)
.title(format!("{:─>width$}", "", width = chunk_width - 2)),
),
- _ => Paragraph::new(command).style(theme.as_style(Meaning::Annotation)),
+ _ => Paragraph::new(command)
+ .style(Style::from_crossterm(theme.as_style(Meaning::Annotation))),
}
}
}