fix command output not being displayed for short lived commands

repro with:

```
wezterm --config 'exit_behavior="Hold"' start ls
```
This commit is contained in:
Wez Furlong committed 2023-01-26 16:10:19 -07:00
1 parent d7145561c2
commit 9ae6a561a0
2 files changed
+11

No files matched your search

+2
View File
@@ -92,6 +92,8 @@ As features stabilize some brief notes about them will accumulate here.
[#2991](https://github.com/wez/wezterm/issues/2991)
* X11: always update selection owner even if our window already owns it
[#2926](https://github.com/wez/wezterm/issues/2926)
* command output would not be displayed if the command exited almost
immediately after starting up.
#### Changed
* `CTRL-SHIFT-P` now activates the new command palette, instead of `PaneSelect`
+9
View File
@@ -197,6 +197,14 @@ fn parse_buffered_data(pane: Arc<dyn Pane>, dead: &Arc<AtomicBool>, mut rx: File
}
}
}
// Don't forget to send anything that we might have buffered
// to be displayed before we return from here; this is important
// for very short lived commands so that we don't forget to
// display what they displayed.
if !actions.is_empty() {
send_actions_to_mux(&pane, std::mem::take(&mut actions));
}
}
fn set_socket_buffer(fd: &mut FileDescriptor, option: i32, size: usize) -> anyhow::Result<()> {
@@ -277,6 +285,7 @@ fn read_from_pane_pty(
}
Ok(size) => {
histogram!("read_from_pane_pty.bytes.rate", size as f64);
log::trace!("read_pty pane {pane_id} read {size} bytes");
if let Err(err) = tx.write_all(&buf[..size]) {
error!(
"read_pty failed to write to parser: pane {} {:?}",