Skip to content

Commit

Permalink
(chore) consistent setter behavior
Browse files Browse the repository at this point in the history
- Resolves wren-lang#54
  • Loading branch information
joshgoebel committed Apr 28, 2021
1 parent 8229047 commit cb381bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/module/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,7 @@ void stdinIsRawSet(WrenVM* vm)
// Can't set raw mode when not talking to a TTY.
// TODO: Make this a runtime error?
}
wrenSetSlotBool(vm, 0, isStdinRaw);
}

void stdinIsTerminal(WrenVM* vm)
Expand Down
3 changes: 3 additions & 0 deletions test/io/stdin/is_raw.wren
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ for (i in 1..4) {
// TODO: This doesn't actually detect a visible difference between raw and
// non-raw mode. Maybe add support to the test runner for writing non-printing
// characters to stdin?

System.print(Stdin.isRaw=false) // expect: false
System.print(Stdin.isRaw=true) // expect: true

0 comments on commit cb381bf

Please sign in to comment.