@ -15,18 +15,6 @@ in a TTY context is to check `process.stdout.isTTY`:
$ node -p -e "Boolean(process.stdout.isTTY)" | cat
$ node -p -e "Boolean(process.stdout.isTTY)" | cat
false
false
## tty.isatty(fd)
Returns `true` or `false` depending on if the `fd` is associated with a
terminal.
## tty.setRawMode(mode)
Stability: 0 - Deprecated: Use [tty.ReadStream#setRawMode][] (i.e. process.stdin.setRawMode) instead.
## Class: ReadStream
## Class: ReadStream
A `net.Socket` subclass that represents the readable portion of a tty. In normal
A `net.Socket` subclass that represents the readable portion of a tty. In normal
@ -44,6 +32,7 @@ of the `tty.ReadStream` instance.
`tty.ReadStream` to act either as a raw device or default. `isRaw` will be set
`tty.ReadStream` to act either as a raw device or default. `isRaw` will be set
to the resulting mode.
to the resulting mode.
[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode
## Class: WriteStream
## Class: WriteStream
@ -51,16 +40,6 @@ A `net.Socket` subclass that represents the writable portion of a tty. In normal
circumstances, `process.stdout` will be the only `tty.WriteStream` instance
circumstances, `process.stdout` will be the only `tty.WriteStream` instance
ever created (and only when `isatty(1)` is true).
ever created (and only when `isatty(1)` is true).
### ws.columns
A `Number` that gives the number of columns the TTY currently has. This property
gets updated on "resize" events.
### ws.rows
A `Number` that gives the number of rows the TTY currently has. This property
gets updated on "resize" events.
### Event: 'resize'
### Event: 'resize'
`function () {}`
`function () {}`
@ -73,5 +52,21 @@ has changed.
console.log(process.stdout.columns + 'x' + process.stdout.rows);
console.log(process.stdout.columns + 'x' + process.stdout.rows);
});
});
### ws.columns
[tty.ReadStream#setRawMode]: #tty_rs_setrawmode_mode
A `Number` that gives the number of columns the TTY currently has. This property
gets updated on "resize" events.
### ws.rows
A `Number` that gives the number of rows the TTY currently has. This property
gets updated on "resize" events.
## tty.isatty(fd)
Returns `true` or `false` depending on if the `fd` is associated with a
terminal.
## tty.setRawMode(mode)
Stability: 0 - Deprecated: Use [tty.ReadStream#setRawMode][] (i.e. process.stdin.setRawMode) instead.