mod(terminal): enable termios flags corresponding to termios(3) man page
This commit is contained in:
1 parent
4be3451fbf
commit
2d2e63ac63
2 files changed
+27
-2
No files matched your search
+19
-2
@@ -137,13 +137,30 @@ pub fn enableRawMode(bak: *std.posix.termios) !void {
|
||||
var termios = try std.posix.tcgetattr(std.posix.STDIN_FILENO);
|
||||
bak.* = termios;
|
||||
|
||||
termios.iflag.IXON = false;
|
||||
// termios flags used by termios(3)
|
||||
termios.iflag.IGNBRK = false;
|
||||
termios.iflag.BRKINT = false;
|
||||
termios.iflag.PARMRK = false;
|
||||
termios.iflag.ISTRIP = false;
|
||||
termios.iflag.INLCR = false;
|
||||
termios.iflag.IGNCR = false;
|
||||
termios.iflag.ICRNL = false;
|
||||
termios.iflag.IXON = false;
|
||||
|
||||
// messes with output -> not used
|
||||
// termios.oflag.OPOST = false;
|
||||
|
||||
termios.lflag.ECHO = false;
|
||||
termios.lflag.ECHONL = false;
|
||||
termios.lflag.ICANON = false;
|
||||
termios.lflag.IEXTEN = false;
|
||||
termios.lflag.ISIG = false;
|
||||
termios.lflag.IEXTEN = false;
|
||||
|
||||
termios.cflag.CSIZE = .CS8;
|
||||
termios.cflag.PARENB = false;
|
||||
|
||||
termios.cc[@intFromEnum(std.posix.V.MIN)] = 1;
|
||||
termios.cc[@intFromEnum(std.posix.V.TIME)] = 0;
|
||||
|
||||
try std.posix.tcsetattr(
|
||||
std.posix.STDIN_FILENO,
|
||||
|
||||
Reference in new issue
Block a user