Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add note to tty.WriteStream event 'resize' on Windows #13576

Closed
wants to merge 9 commits into from
11 changes: 11 additions & 0 deletions doc/api/tty.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,17 @@ process.stdout.on('resize', () => {
});
```

*Note:* On Windows resize events will be emitted only if stdin is unpaused
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nit: *Note:* -> *Note*:

Copy link
Contributor Author

@Dean-Coakley Dean-Coakley Jul 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm...I copied this mistake from async_notes.md Should that be fixed in a separate PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep.
Ref: #13133

(by a call to `resume()` or by adding a data listener) and in raw mode. It can
also be triggered if a terminal control sequence that moves the cursor is written
to the screen.

*Note:* On Windows when changing console height the resize event will be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. *Note:* -> *Note*:
  2. IMHO the two paragraphs could be merged:
    Also, the resize event will be signaled only if the console screen buffer height was also changed...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Sorry, but I'm not entirely sure what you want here.

Can you paste the body of text you'd like? Or be very verbose about what should be replaced.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*Note*: On Windows resize events will be emitted only if stdin is unpaused 
(by a call to `resume()` or by adding a data listener) and in raw mode. It can 
also be triggered if a terminal control sequence that moves the cursor is
written to the screen. Also, the resize event will only be signaled if the
console screen buffer height was also changed. For example shrinking the
console window height will not cause the resize event to be emitted. Increasing
the console window height will only be registered when the new console window
height is greater than the current console buffer size.
  1. Check that it is still true (the word also implies both conditions need to be met)
  2. See if you like it. This one is just a suggestion.

signaled only if the console screen buffer height was also changed. For example
shrinking the console window height will not cause the resize event to be
emitted. Increasing the console window height will only be registered when the
new console window height is greater than the current console buffer size.

### writeStream.columns
<!-- YAML
added: v0.7.7
Expand Down