2015-11-08 13:31:22 -08:00
|
|
|
^title Stdin Class
|
|
|
|
|
|
2015-12-29 21:56:44 -08:00
|
|
|
The standard input stream.
|
2015-11-08 13:31:22 -08:00
|
|
|
|
2015-12-29 21:56:44 -08:00
|
|
|
## Static Methods
|
2015-11-08 13:31:22 -08:00
|
|
|
|
2016-05-20 15:19:18 -07:00
|
|
|
### **isRaw**
|
|
|
|
|
|
|
|
|
|
Returns `true` if stdin is in raw mode. When in raw mode, input is not echoed
|
|
|
|
|
or buffered, and all characters, even non-printing and control characters go
|
|
|
|
|
into stdin.
|
|
|
|
|
|
|
|
|
|
Defaults to `false`.
|
|
|
|
|
|
|
|
|
|
### **isRaw**=(value)
|
|
|
|
|
|
|
|
|
|
Sets raw mode on or off.
|
|
|
|
|
|
2016-05-21 12:51:11 -07:00
|
|
|
### **isTerminal**
|
|
|
|
|
|
|
|
|
|
Returns `true` if Stdin is connected to a "TTY". This is true when the user is
|
|
|
|
|
running Wren in an interactive terminal, and false if it its input is coming
|
|
|
|
|
from a pipe.
|
|
|
|
|
|
2016-05-20 11:50:14 -07:00
|
|
|
### **readByte**()
|
|
|
|
|
|
|
|
|
|
Reads one byte of input from stdin. Blocks the current fiber until a byte has
|
|
|
|
|
been received.
|
|
|
|
|
|
|
|
|
|
Returns the byte value as a number or `null` if stdin is closed.
|
|
|
|
|
|
2017-10-09 07:16:05 -07:00
|
|
|
Note that output is not automatically flushed when calling this. If you want to
|
|
|
|
|
display a prompt before reading input, you'll want to call `Stdout.flush()`
|
|
|
|
|
after printing the prompt.
|
|
|
|
|
|
2015-12-29 21:56:44 -08:00
|
|
|
### **readLine**()
|
|
|
|
|
|
|
|
|
|
Reads one line of input from stdin. Blocks the current fiber until a full line
|
|
|
|
|
of input has been received.
|
|
|
|
|
|
|
|
|
|
Returns the string of input or `null` if stdin is closed.
|
2017-10-09 07:16:05 -07:00
|
|
|
|
|
|
|
|
Note that output is not automatically flushed when calling this. If you want to
|
|
|
|
|
display a prompt before reading input, you'll want to call `Stdout.flush()`
|
|
|
|
|
after printing the prompt.
|