aboutsummaryrefslogtreecommitdiff
path: root/doc_topics
diff options
context:
space:
mode:
Diffstat (limited to 'doc_topics')
-rw-r--r--doc_topics/03-terminal.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/doc_topics/03-terminal.md b/doc_topics/03-terminal.md
index 5bdf543..a5341d6 100644
--- a/doc_topics/03-terminal.md
+++ b/doc_topics/03-terminal.md
@@ -16,6 +16,7 @@ Since there are a myriad of settings available;
16- `system.setconsoleflags` (Windows) 16- `system.setconsoleflags` (Windows)
17- `system.setconsolecp` (Windows) 17- `system.setconsolecp` (Windows)
18- `system.setconsoleoutputcp` (Windows) 18- `system.setconsoleoutputcp` (Windows)
19- `system.detachfds` (Posix)
19- `system.setnonblock` (Posix) 20- `system.setnonblock` (Posix)
20- `system.tcsetattr` (Posix) 21- `system.tcsetattr` (Posix)
21 22
@@ -105,6 +106,7 @@ To use non-blocking input here's how to set it up:
105 sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) - sys.CIF_ECHO_INPUT - sys.CIF_LINE_INPUT) 106 sys.setconsoleflags(io.stdin, sys.getconsoleflags(io.stdin) - sys.CIF_ECHO_INPUT - sys.CIF_LINE_INPUT)
106 107
107 -- setup Posix by disabling echo, canonical mode, and making non-blocking 108 -- setup Posix by disabling echo, canonical mode, and making non-blocking
109 sys.detachfds() -- ensure stdin/out/err have their own file descriptions
108 local of_attr = sys.tcgetattr(io.stdin) 110 local of_attr = sys.tcgetattr(io.stdin)
109 sys.tcsetattr(io.stdin, sys.TCSANOW, { 111 sys.tcsetattr(io.stdin, sys.TCSANOW, {
110 lflag = of_attr.lflag - sys.L_ICANON - sys.L_ECHO, 112 lflag = of_attr.lflag - sys.L_ICANON - sys.L_ECHO,