fix: Escape control characters in command preview (#1588)

This was missed in the initial change to escape control characters.
This commit is contained in:
Peter Holloway 2024-01-19 11:18:29 +00:00 committed by GitHub
parent cda135d241
commit 62f81a8c91
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,7 +3,7 @@ use std::{
time::Duration, time::Duration,
}; };
use atuin_common::utils; use atuin_common::utils::{self, Escapable as _};
use crossterm::{ use crossterm::{
cursor::SetCursorStyle, cursor::SetCursorStyle,
event::{ event::{
@ -678,7 +678,7 @@ impl State {
.map(|(i, _)| i) .map(|(i, _)| i)
.chain(Some(line.len())) .chain(Some(line.len()))
.tuple_windows() .tuple_windows()
.map(|(a, b)| &line[a..b]) .map(|(a, b)| (&line[a..b]).escape_control().to_string())
}) })
.join("\n") .join("\n")
}; };