Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions tests/support/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ pub(crate) fn run_image_render_pty(env: Vec<(String, String)>) -> String {
}
configure_pty_child(&mut cmd, &pty.slave);
let mut child = cmd.spawn().expect("spawn fetch under PTY");
// Close the parent-owned slave handles so the capture thread can observe
// EOF after the child exits.
drop(cmd);
drop(pty.slave);
let capture = start_pty_capture(&pty.master);
let status = wait_child(&mut child, Duration::from_secs(3))
Expand All @@ -88,10 +91,8 @@ pub(crate) fn run_image_render_pty(env: Vec<(String, String)>) -> String {
"fetch exited with {status}; PTY output:\n{}",
capture.output()
);
let output = capture.output();
drop(pty.master);
capture.close();
output
capture.finish()
}

#[cfg(unix)]
Expand Down
Loading