summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenji Nguyen <45523555+solidiquis@users.noreply.github.com>2023-07-01 18:25:43 +0700
committerGitHub <noreply@github.com>2023-07-01 18:25:43 +0700
commita146da1e82d03bcae1d19f8869d655352bd97813 (patch)
tree25ff86682a5b52d34f6ae93f82a6b800b29f9551
parent2542e2867f5ae83c72893e43233f51c62e1c4f78 (diff)
parent3f3195d869504e2cbead7b674d7c2ba1697a28fc (diff)
Merge pull request #215 from solidiquis/stdout-deadlock-fix
Stdout deadlock fix
-rw-r--r--CHANGELOG.md4
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--README.md2
-rw-r--r--src/context/mod.rs2
-rw-r--r--src/main.rs7
-rw-r--r--src/progress.rs4
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)
diff --git a/Cargo.lock b/Cargo.lock
index 6e1ed6c..3d37e67 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 65f7ae6..ee3f74b 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 <benjamin.van.nguyen@gmail.com>"]
description = """
diff --git a/README.md b/README.md
index 269cfee..aef3f72 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:
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)?;
},
_ => (),
}