aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2024-05-23 20:46:18 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2024-05-23 20:57:20 +0200
commit56db1511baeb0376a12915c69c1552b04010c26f (patch)
treed03aa6b4c33a6de39371e9be336c471bfd2cafc5 /src
parent8f8d34f03428dbaa6cac229bbe36efc6d80d186d (diff)
downloadluasystem-56db1511baeb0376a12915c69c1552b04010c26f.tar.gz
luasystem-56db1511baeb0376a12915c69c1552b04010c26f.tar.bz2
luasystem-56db1511baeb0376a12915c69c1552b04010c26f.zip
cleanup and documentation
Diffstat (limited to 'src')
-rw-r--r--src/term.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/term.c b/src/term.c
index 99d3b2b..7020f09 100644
--- a/src/term.c
+++ b/src/term.c
@@ -337,7 +337,7 @@ To see flag status and constant names check `listconsoleflags`.
337Note: not all combinations of flags are allowed, as some are mutually exclusive or mutually required. 337Note: not all combinations of flags are allowed, as some are mutually exclusive or mutually required.
338See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode) 338See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode)
339@function setconsoleflags 339@function setconsoleflags
340@tparam file file the file-handle to set the flags on 340@tparam file file file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr`
341@tparam bitflags bitflags the flags to set/unset 341@tparam bitflags bitflags the flags to set/unset
342@treturn[1] boolean `true` on success 342@treturn[1] boolean `true` on success
343@treturn[2] nil 343@treturn[2] nil
@@ -378,8 +378,17 @@ static int lst_setconsoleflags(lua_State *L)
378 378
379/*** 379/***
380Gets console flags (Windows). 380Gets console flags (Windows).
381The `CIF_` and `COF_` constants are available on the module table. Where `CIF` are the
382input flags (for use with `io.stdin`) and `COF` are the output flags (for use with
383`io.stdout`/`io.stderr`).
384
385_Note_: See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode)
386for more information on the flags.
387
388
389
381@function getconsoleflags 390@function getconsoleflags
382@tparam file file the file-handle to get the flags from. 391@tparam file file file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr`
383@treturn[1] bitflags the current console flags. 392@treturn[1] bitflags the current console flags.
384@treturn[2] nil 393@treturn[2] nil
385@treturn[2] string error message 394@treturn[2] string error message
@@ -433,8 +442,8 @@ The terminal attributes is a table with the following fields:
433 442
434- `iflag` input flags 443- `iflag` input flags
435- `oflag` output flags 444- `oflag` output flags
436- `cflag` control flags
437- `lflag` local flags 445- `lflag` local flags
446- `cflag` control flags
438- `ispeed` input speed 447- `ispeed` input speed
439- `ospeed` output speed 448- `ospeed` output speed
440- `cc` control characters 449- `cc` control characters
@@ -528,9 +537,6 @@ flags for the `iflags`, `oflags`, and `lflags` bitmasks.
528To see flag status and constant names check `listtermflags`. For their meaning check 537To see flag status and constant names check `listtermflags`. For their meaning check
529[the manpage](https://www.man7.org/linux/man-pages/man3/termios.3.html). 538[the manpage](https://www.man7.org/linux/man-pages/man3/termios.3.html).
530 539
531_Note_: not all combinations of flags are allowed, as some are mutually exclusive or mutually required.
532See [setconsolemode documentation](https://learn.microsoft.com/en-us/windows/console/setconsolemode)
533
534_Note_: only `iflag`, `oflag`, and `lflag` are supported at the moment. The other fields are ignored. 540_Note_: only `iflag`, `oflag`, and `lflag` are supported at the moment. The other fields are ignored.
535@function tcsetattr 541@function tcsetattr
536@tparam file fd file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr` 542@tparam file fd file handle to operate on, one of `io.stdin`, `io.stdout`, `io.stderr`
@@ -722,6 +728,7 @@ directly, but through the `system.readkey` or `system.readansi` functions. It
722will return the next byte from the input stream, or `nil` if no key was pressed. 728will return the next byte from the input stream, or `nil` if no key was pressed.
723 729
724On Posix, `io.stdin` must be set to non-blocking mode using `setnonblock` 730On Posix, `io.stdin` must be set to non-blocking mode using `setnonblock`
731and canonical mode must be turned off using `tcsetattr`,
725before calling this function. Otherwise it will block. No conversions are 732before calling this function. Otherwise it will block. No conversions are
726done on Posix, so the byte read is returned as-is. 733done on Posix, so the byte read is returned as-is.
727 734