diff options
author | Benji Nguyen <45523555+solidiquis@users.noreply.github.com> | 2023-07-01 18:25:43 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-01 18:25:43 +0700 |
commit | a146da1e82d03bcae1d19f8869d655352bd97813 (patch) | |
tree | 25ff86682a5b52d34f6ae93f82a6b800b29f9551 | |
parent | 2542e2867f5ae83c72893e43233f51c62e1c4f78 (diff) | |
parent | 3f3195d869504e2cbead7b674d7c2ba1697a28fc (diff) |
Merge pull request #215 from solidiquis/stdout-deadlock-fix
Stdout deadlock fix
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | Cargo.lock | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | src/context/mod.rs | 2 | ||||
-rw-r--r-- | src/main.rs | 7 | ||||
-rw-r--r-- | src/progress.rs | 4 |
7 files changed, 13 insertions, 10 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2470c2e..3166862 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) @@ -278,7 +278,7 @@ dependencies = [ [[package]] name = "erdtree" -version = "3.1.0" +version = "3.1.1" dependencies = [ "ansi_term", "chrono", @@ -1,6 +1,6 @@ [package] name = "erdtree" -version = "3.1.0" +version = "3.1.1" edition = "2021" authors = ["Benjamin Nguyen <benjamin.van.nguyen@gmail.com>"] description = """ @@ -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: diff --git a/src/context/mod.rs b/src/context/mod.rs index 829b9ca..7764842 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. <benjamin.van.nguyen@gmail.com>")] -#[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 diff --git a/src/main.rs b/src/main.rs index 5c29e85..5f5e0b4 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 87395f9..a1cf32f 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)?; }, _ => (), } |