diff options
author | def <dennis@felsin9.de> | 2015-04-24 19:41:12 +0200 |
---|---|---|
committer | def <dennis@felsin9.de> | 2015-04-24 19:41:12 +0200 |
commit | e5a186a419920b91f785e2d783da856637472eed (patch) | |
tree | 87363c1e7b2d3284ce245a268cc09125c72b2a1d /lib/pure | |
parent | 6ca38472a13840906d6f113eb92c11a25db49224 (diff) | |
download | Nim-e5a186a419920b91f785e2d783da856637472eed.tar.gz |
Fix Termios wrapper
Diffstat (limited to 'lib/pure')
-rw-r--r-- | lib/pure/terminal.nim | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/pure/terminal.nim b/lib/pure/terminal.nim index a3c5cdcfb..29f700db5 100644 --- a/lib/pure/terminal.nim +++ b/lib/pure/terminal.nim @@ -51,12 +51,13 @@ else: proc setRaw(fd: FileHandle, time: cint = TCSAFLUSH) = var mode: Termios discard fd.tcgetattr(addr mode) - mode.iflag = mode.iflag and not Tcflag(BRKINT or ICRNL or INPCK or ISTRIP or IXON) - mode.oflag = mode.oflag and not Tcflag(OPOST) - mode.cflag = (mode.cflag and not Tcflag(CSIZE or PARENB)) or CS8 - mode.lflag = mode.lflag and not Tcflag(ECHO or ICANON or IEXTEN or ISIG) - mode.cc[VMIN] = 1.cuchar - mode.cc[VTIME] = 0.cuchar + mode.c_iflag = mode.c_iflag and not Tcflag(BRKINT or ICRNL or INPCK or + ISTRIP or IXON) + mode.c_oflag = mode.c_oflag and not Tcflag(OPOST) + mode.c_cflag = (mode.c_cflag and not Tcflag(CSIZE or PARENB)) or CS8 + mode.c_lflag = mode.c_lflag and not Tcflag(ECHO or ICANON or IEXTEN or ISIG) + mode.c_cc[VMIN] = 1.cuchar + mode.c_cc[VTIME] = 0.cuchar discard fd.tcsetattr(time, addr mode) proc setCursorPos*(x, y: int) = |