Add Stdin.isTerminal.
This commit is contained in:
@@ -539,6 +539,12 @@ void stdinIsRawSet(WrenVM* vm)
|
||||
}
|
||||
}
|
||||
|
||||
void stdinIsTerminal(WrenVM* vm)
|
||||
{
|
||||
initStdin();
|
||||
wrenSetSlotBool(vm, 0, uv_guess_handle(stdinDescriptor) == UV_TTY);
|
||||
}
|
||||
|
||||
static void allocCallback(uv_handle_t* handle, size_t suggestedSize,
|
||||
uv_buf_t* buf)
|
||||
{
|
||||
|
||||
@@ -217,6 +217,7 @@ foreign class Stat {
|
||||
class Stdin {
|
||||
foreign static isRaw
|
||||
foreign static isRaw=(value)
|
||||
foreign static isTerminal
|
||||
|
||||
static readByte() {
|
||||
return read_ {
|
||||
|
||||
@@ -219,6 +219,7 @@ static const char* ioModuleSource =
|
||||
"class Stdin {\n"
|
||||
" foreign static isRaw\n"
|
||||
" foreign static isRaw=(value)\n"
|
||||
" foreign static isTerminal\n"
|
||||
"\n"
|
||||
" static readByte() {\n"
|
||||
" return read_ {\n"
|
||||
|
||||
Reference in New Issue
Block a user