Closes GH-645. Document tty.getWindowSize
This commit is contained in:
parent
9e101f2b01
commit
57fa247f53
@ -25,16 +25,13 @@ terminal.
|
|||||||
process's stdin fd to act either as a raw device or default.
|
process's stdin fd to act either as a raw device or default.
|
||||||
|
|
||||||
|
|
||||||
### tty.getColumns()
|
### tty.setWindowSize(fd, row, col)
|
||||||
|
|
||||||
Returns the number of columns associated with the current process's TTY.
|
`ioctl`s the window size settings to the file descriptor.
|
||||||
|
|
||||||
Note that each time this number is changed the process receives a `SIGWINCH`
|
|
||||||
signal. So you can keep a cache of it like this:
|
### tty.getWindowSize(fd)
|
||||||
|
|
||||||
var columns = tty.getColumns();
|
Returns `[row, col]` for the TTY associated with the file descriptor.
|
||||||
process.on('SIGWINCH', function() {
|
|
||||||
columns = tty.getColumns();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user