aboutsummaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2024-05-04 09:06:03 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2024-05-04 09:06:03 +0200
commitb41df538c72c7e9a26f9ff08f2668769c8d1a1d1 (patch)
tree59820cae6b9edb014520487f5d2b0c9f91bc6b17 /src/term.c
parentfdf62fe6c4125d29b3097e49566b2bbe1f650382 (diff)
downloadluasystem-b41df538c72c7e9a26f9ff08f2668769c8d1a1d1.tar.gz
luasystem-b41df538c72c7e9a26f9ff08f2668769c8d1a1d1.tar.bz2
luasystem-b41df538c72c7e9a26f9ff08f2668769c8d1a1d1.zip
switch "has" to "has_all_of" and "has_any_of"
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/term.c b/src/term.c
index 062394d..9a9967d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -386,7 +386,7 @@ local system = require('system')
386local flags = system.getconsoleflags(io.stdout) 386local flags = system.getconsoleflags(io.stdout)
387print("Current stdout flags:", tostring(flags)) 387print("Current stdout flags:", tostring(flags))
388 388
389if flags:has(system.COF_VIRTUAL_TERMINAL_PROCESSING + system.COF_PROCESSED_OUTPUT) then 389if flags:has_all_of(system.COF_VIRTUAL_TERMINAL_PROCESSING + system.COF_PROCESSED_OUTPUT) then
390 print("Both flags are set") 390 print("Both flags are set")
391else 391else
392 print("At least one flag is not set") 392 print("At least one flag is not set")
@@ -445,7 +445,7 @@ The terminal attributes is a table with the following fields:
445local system = require('system') 445local system = require('system')
446 446
447local status = assert(tcgetattr(io.stdin)) 447local status = assert(tcgetattr(io.stdin))
448if status.iflag:has(system.I_IGNBRK) then 448if status.iflag:has_all_of(system.I_IGNBRK) then
449 print("Ignoring break condition") 449 print("Ignoring break condition")
450end 450end
451*/ 451*/
@@ -539,7 +539,7 @@ _Note_: only `iflag`, `oflag`, and `lflag` are supported at the moment. The othe
539local system = require('system') 539local system = require('system')
540 540
541local status = assert(tcgetattr(io.stdin)) 541local status = assert(tcgetattr(io.stdin))
542if not status.lflag:has(system.L_ECHO) then 542if not status.lflag:has_all_of(system.L_ECHO) then
543 -- if echo is off, turn echoing newlines on 543 -- if echo is off, turn echoing newlines on
544 tcsetattr(io.stdin, system.TCSANOW, { lflag = status.lflag + system.L_ECHONL })) 544 tcsetattr(io.stdin, system.TCSANOW, { lflag = status.lflag + system.L_ECHONL }))
545end 545end