From 4741eb9859abb6057f11589eb3fe5bf279a664e2 Mon Sep 17 00:00:00 2001 From: Yureka Date: Sat, 20 Jun 2026 22:00:52 +0200 Subject: [PATCH] pty: set raw mode Fixes https://github.com/AsahiLinux/kisd/issues/9 Signed-off-by: Yureka --- src/pty.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pty.rs b/src/pty.rs index c453c4e..c432a4c 100644 --- a/src/pty.rs +++ b/src/pty.rs @@ -9,6 +9,7 @@ use std::task::ready; use nix::fcntl::{OFlag, open}; use nix::pty::{PtyMaster, grantpt, posix_openpt, ptsname, unlockpt}; use nix::sys::stat::Mode; +use nix::sys::termios::{SetArg, cfmakeraw, tcgetattr, tcsetattr}; use tokio::io::unix::AsyncFd; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; @@ -27,6 +28,11 @@ impl Pty { grantpt(&fd)?; unlockpt(&fd)?; + // Set raw mode on the server side + let mut termios = tcgetattr(&fd)?; + cfmakeraw(&mut termios); + tcsetattr(&fd, SetArg::TCSANOW, &termios)?; + // Get the pty path let pty_name = unsafe { ptsname(&fd) }?;