diff --git a/CHANGELOG.md b/CHANGELOG.md index 234d1f1e0..cec8bb074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). * Windows binaries no longer require `vcruntime140.dll` to be installed (normally through Visual Studio.) +* On quit, the builtin pager no longer waits for all outputs to be discarded. + * `jj branch rename` no longer shows a warning in colocated repos. ## [0.19.0] - 2024-07-03 diff --git a/cli/src/ui.rs b/cli/src/ui.rs index b46045c46..c7c8d99a5 100644 --- a/cli/src/ui.rs +++ b/cli/src/ui.rs @@ -58,6 +58,11 @@ impl Write for &BuiltinPager { } fn write(&mut self, buf: &[u8]) -> io::Result { + // Since minus::Pager holds the rx end internally, push_str() doesn't + // fail even after the paging thread gets terminated. + if self.dynamic_pager_thread.is_finished() { + return Err(io::ErrorKind::BrokenPipe.into()); + } let string = std::str::from_utf8(buf).map_err(io::Error::other)?; self.pager.push_str(string).map_err(io::Error::other)?; Ok(buf.len())