Needed help to understand how to prevent from freezing #5530
Replies: 1 comment
-
Okay, I found a resouce which pointed me in the direction of impl RemuxApp {
pub fn new(_cc: &eframe::CreationContext<'_>, _width: usize, _height: usize) -> Self {
// let mut surface = Surface::new(width, height);
// surface.add_change(Change::ClearScreen(ColorAttribute::Default));
//
let (stdin, stdout) = spawn_pty().expect("Failed to start tmux session");
let flags = nix::fcntl::fcntl(stdout.as_raw_fd(), nix::fcntl::FcntlArg::F_GETFL).unwrap();
let mut flags = nix::fcntl::OFlag::from_bits(flags).unwrap();
flags.set(nix::fcntl::OFlag::O_NONBLOCK, true);
nix::fcntl::fcntl(stdout.as_raw_fd(), nix::fcntl::FcntlArg::F_SETFL(flags)).unwrap();
Self {
stdin,
stdout,
output: String::new(),
input: String::new(),
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to open
tmux
in control mode, and then send and receive commands and render them in egui. The final plan is to be able to process these and behave like a terminal emulator, but there is a problem.With the present implementation, the application starts, gets a chunk of data, puts it. on the screen, and remains frozen until some more data arrives, which is shows again and then freezes. Why is this happening?
Beta Was this translation helpful? Give feedback.
All reactions