From fc392b73a2461c83228712593fa1526b929fd94c Mon Sep 17 00:00:00 2001 From: Benjamin Nguyen Date: Sat, 1 Jul 2023 18:17:35 +0700 Subject: [PATCH 1/3] fix stdout deadlock --- src/main.rs | 7 ++----- src/progress.rs | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5c29e858..5f5e0b46 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,14 +64,11 @@ mod tty; mod utils; fn main() -> ExitCode { - let result = run(); - - tty::restore_tty(); - - if let Err(e) = result { + if let Err(e) = run() { eprintln!("{e}"); return ExitCode::FAILURE; } + ExitCode::SUCCESS } diff --git a/src/progress.rs b/src/progress.rs index 87395f94..a1cf32f3 100644 --- a/src/progress.rs +++ b/src/progress.rs @@ -123,6 +123,7 @@ impl IndicatorHandle { .transpose()?; } } + Ok(()) } } @@ -144,7 +145,7 @@ impl<'a> Indicator<'a> { while let Ok(msg) = rx.recv() { if prx.recv_timeout(PRIORITY_MAIL_TIMEOUT).is_ok() { indicator.update_state(IndicatorState::Done)?; - break; + return Ok(()); } match msg { @@ -185,6 +186,7 @@ impl<'a> Indicator<'a> { let stdout = &mut self.stdout; stdout.execute(terminal::Clear(ClearType::CurrentLine))?; stdout.execute(cursor::RestorePosition)?; + stdout.execute(cursor::Show)?; }, _ => (), } From bceba50eef258773e3ef6b3fcb8d0693d584831f Mon Sep 17 00:00:00 2001 From: Benjamin Nguyen Date: Sat, 1 Jul 2023 18:18:55 +0700 Subject: [PATCH 2/3] readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 269cfee4..aef3f72d 100644 --- a/README.md +++ b/README.md @@ -332,7 +332,7 @@ no reason to have both. #### TOML file -`erdtree` will look for `.erdtree.toml in any of the following locations: +`erdtree` will look for `.erdtree.toml` in any of the following locations: On Unix-systems: From 3f3195d869504e2cbead7b674d7c2ba1697a28fc Mon Sep 17 00:00:00 2001 From: Benjamin Nguyen Date: Sat, 1 Jul 2023 18:24:08 +0700 Subject: [PATCH 3/3] patch version bump --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- Cargo.toml | 2 +- src/context/mod.rs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2470c2e6..31668620 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.1.1] - 2023-07-01 + +[This patches](https://github.com/solidiquis/erdtree/pull/215) a deadlock that occurs when `--pattern` fails to make any matches and the progress indicator is enabled which causes `erdtree` to completely freeze. + ## [3.1.0] - 2023-07-01 ### [What's new](https://github.com/solidiquis/erdtree/pull/202) diff --git a/Cargo.lock b/Cargo.lock index 6e1ed6cb..3d37e679 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -278,7 +278,7 @@ dependencies = [ [[package]] name = "erdtree" -version = "3.1.0" +version = "3.1.1" dependencies = [ "ansi_term", "chrono", diff --git a/Cargo.toml b/Cargo.toml index 65f7ae6c..ee3f74b9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "erdtree" -version = "3.1.0" +version = "3.1.1" edition = "2021" authors = ["Benjamin Nguyen "] description = """ diff --git a/src/context/mod.rs b/src/context/mod.rs index 829b9ca7..77648423 100644 --- a/src/context/mod.rs +++ b/src/context/mod.rs @@ -53,7 +53,7 @@ pub mod time; #[derive(Parser, Debug)] #[command(name = "erdtree")] #[command(author = "Benjamin Nguyen. ")] -#[command(version = "3.1.0")] +#[command(version = "3.1.1")] #[command(about = "erdtree (erd) is a cross-platform, multi-threaded, and general purpose filesystem and disk usage utility.", long_about = None)] pub struct Context { /// Directory to traverse; defaults to current working directory