fix(infra): do not block while reading from terminal, handle more than <cores> terminals
This commit is contained in:
parent
78cea539e6
commit
eaaac9524f
2 changed files with 6 additions and 2 deletions
|
|
@ -1496,6 +1496,8 @@ impl PtyBus {
|
|||
}
|
||||
if !bytes_is_empty {
|
||||
send_screen_instructions.send(ScreenInstruction::Render).unwrap();
|
||||
} else {
|
||||
task::sleep(::std::time::Duration::from_millis(10)).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1518,6 +1520,8 @@ impl PtyBus {
|
|||
}
|
||||
if !bytes_is_empty {
|
||||
send_screen_instructions.send(ScreenInstruction::Render).unwrap();
|
||||
} else {
|
||||
task::sleep(::std::time::Duration::from_millis(10)).await;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ fn spawn_terminal () -> (RawFd, RawFd) {
|
|||
let pid_primary = fork_pty_res.master;
|
||||
let pid_secondary = match fork_pty_res.fork_result {
|
||||
ForkResult::Parent { child } => {
|
||||
fcntl(pid_primary, FcntlArg::F_SETFL(OFlag::empty())).expect("could not fcntl");
|
||||
// fcntl(pid_primary, FcntlArg::F_SETFL(OFlag::O_NONBLOCK)).expect("could not fcntl");
|
||||
// fcntl(pid_primary, FcntlArg::F_SETFL(OFlag::empty())).expect("could not fcntl");
|
||||
fcntl(pid_primary, FcntlArg::F_SETFL(OFlag::O_NONBLOCK)).expect("could not fcntl");
|
||||
child
|
||||
},
|
||||
ForkResult::Child => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue