Skip to content

Commit

Permalink
Use vt100-ctt instead of patching the dep (ChrisTitusTech#952)
Browse files Browse the repository at this point in the history
Thanks @a-kenji
  • Loading branch information
jeevithakannan2 authored Nov 16, 2024
1 parent 2dabb93 commit fa69885
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ members = ["tui", "core", "xtask"]
default-members = ["tui", "core"]
resolver = "2"

[patch.crates-io]
vt100 = { git = "https://github.com/ChrisTitusTech/vt100-rust" }

[profile.release]
opt-level = "z"
debug = false
Expand Down
3 changes: 2 additions & 1 deletion tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ clap = { version = "4.5.20", features = ["derive", "std"], default-features = fa
oneshot = { version = "0.1.8", features = ["std"], default-features = false }
portable-pty = "0.8.1"
ratatui = { version = "0.29.0", features = ["crossterm"], default-features = false }
tui-term = "0.2.0"
tui-term = { version = "0.2.0", default-features = false }
temp-dir = "0.1.14"
time = { version = "0.3.36", features = ["formatting", "local-offset", "macros"], default-features = false }
unicode-width = { version = "0.2.0", default-features = false }
Expand All @@ -31,6 +31,7 @@ anstyle = { version = "1.0.8", default-features = false }
ansi-to-tui = { version = "7.0.0", default-features = false }
zips = "0.1.7"
nix = { version = "0.29.0", features = [ "user" ] }
vt100-ctt = { git = "https://github.com/ChrisTitusTech/vt100-rust" }

[[bin]]
name = "linutil"
Expand Down
9 changes: 4 additions & 5 deletions tui/src/running_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ use std::{
thread::JoinHandle,
};
use time::{macros::format_description, OffsetDateTime};
use tui_term::{
vt100::{self, Screen},
widget::PseudoTerminal,
};
use tui_term::widget::PseudoTerminal;
use vt100_ctt::{Parser, Screen};

pub struct RunningCommand {
/// A buffer to save all the command output (accumulates, until the command exits)
buffer: Arc<Mutex<Vec<u8>>>,
Expand Down Expand Up @@ -285,7 +284,7 @@ impl RunningCommand {
// Process the buffer with a parser with the current screen size
// We don't actually need to create a new parser every time, but it is so much easier this
// way, and doesn't cost that much
let mut parser = vt100::Parser::new(size.height, size.width, 1000);
let mut parser = Parser::new(size.height, size.width, 1000);
let mutex = self.buffer.lock();
let buffer = mutex.as_ref().unwrap();
parser.process(buffer);
Expand Down

0 comments on commit fa69885

Please sign in to comment.