summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--jefs.fs15
1 files changed, 10 insertions, 5 deletions
diff --git a/jefs.fs b/jefs.fs
index 663f556..321bb8a 100644
--- a/jefs.fs
+++ b/jefs.fs
@@ -430,12 +430,17 @@ make old-termios old-termios# allot
: cooked restore-termios ;
\ SETTING RAW MODE FLAGS {{{
\ see termios(3)
-: raw-iflag termios termios.c_iflag @ ;
-: raw-oflag ;
-: raw-lflag ;
-: raw-cflag ;
+: raw-iflag ( tios -- ) termios.c_iflag dup @
+ IGNBRK BRKINT or PARMRK or ISTRIP or INLCR or IGNCR or ICRNL or IXON or
+ negate and swap ! ;
+: raw-oflag ( tios -- ) termios.c_oflag dup @ OPOST negate and swap ! ;
+: raw-lflag ( tios -- ) termios.c_lflag dup @
+ ECHO ECHONL or ICANON or ISIG or IEXTEN or negate and swap ! ;
+: raw-cflag ( tios -- ) termios.c_cflag dup @
+ CSIZE PARENB or negate and CS8 or swap ! ;
\ }}}
-: raw backup-termios ;
+: raw backup-termios termios dup raw-iflag dup raw-oflag dup raw-lflag
+ dup raw-cflag TCSETSF stdin ioctl ;
\ }}}
\ DUMP {{{