diff --git a/Cargo.lock b/Cargo.lock index 880805d..7619a82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,6 +14,7 @@ dependencies = [ [[package]] name = "ansi4tui" version = "0.2.1" +source = "git+https://github.com/austenadler/ansi4tui#8236eef9296fa41350af03ec09937f81f09a32b5" dependencies = [ "termwiz", "tui", diff --git a/Cargo.toml b/Cargo.toml index e0c30f0..5d2cd14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" tui = "0.19" crossterm = { version = "0.25", features = ["bracketed-paste"] } atty = "0.2.14" -ansi4tui = {path = "./ansi4tui/"} +ansi4tui = {git = "https://github.com/austenadler/ansi4tui"} anyhow = "1.0.66" shellwords = "1.1.0" crossbeam = "0.8.2" @@ -17,3 +17,12 @@ parking_lot = "0.12.1" tracing = { version = "0.1.37", features = ["release_max_level_off"] } tracing-subscriber = "0.3.16" ropey = "1.5.0" + +[package.metadata.deb] +maintainer = "Austen Adler " +copyright = "2022, Austen Adler " +extended-description = """\ +A TUI for interactively writing pipelines.""" +depends = "$auto" +section = "utility" +priority = "optional" diff --git a/src/command.rs b/src/command.rs index d185977..63d4055 100644 --- a/src/command.rs +++ b/src/command.rs @@ -34,6 +34,8 @@ pub fn command_event_loop( ) -> Result<()> { loop { match command_request_receiver.recv() { + // TODO: Drain the command request channel so we only run the command once with the latest value + // Could use https://docs.rs/single_value_channel/latest/single_value_channel/ Ok(command_request) => { event_sender.send(EventMessage::CommandCompleted( match run_inner(&command_request) { @@ -42,7 +44,6 @@ pub fn command_event_loop( if !c.status_success && c.stdout.len_bytes() == 0 { CommandCompleted::Failure(c.stderr) } else { - // CommandCompleted::Success((c, FormattedCommandResult::from(&c))) CommandCompleted::Success(c) } } diff --git a/src/main.rs b/src/main.rs index 534a63c..f18e764 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,6 +160,11 @@ impl App { } } +/// Run a command by sending a command request to the inner channel +/// +/// # Errors +/// +/// When the channel closes and the send fails pub fn run_command(&self) -> Result<()> { self.command_request_tx .send((self.command_options.clone(), self.text_orig.clone()))?;