Skip to content

Commit c6e8322

Browse files
fix: terminal freezing on shell_insert_output
This bug occurs on `shell_insert_output` and `shell_append_output` commands. The previous implementation would crate a child process using the Rust stdlib's `Command` builder. However, when nothing should be piped in from the editor, the default value for `stdin` would be used. According to the Rust stdlib documentation that is `Stdio::inherit` which will make the child process inherit the parent process' stdin. This would cause the terminal to freeze. This change will set the child process' stdin to `Stdio::null` whenever it doesn't pipe it. In the `if` statement where this change was made there was an extra condition for windows that I am not sure if would require some special treatment.
1 parent c15f1ea commit c6e8322

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

helix-term/src/commands.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4651,6 +4651,8 @@ fn shell_impl(
46514651

46524652
if input.is_some() || cfg!(windows) {
46534653
process.stdin(Stdio::piped());
4654+
} else {
4655+
process.stdin(Stdio::null());
46544656
}
46554657

46564658
let mut process = match process.spawn() {

0 commit comments

Comments
 (0)