-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
doc: add note to tty.WriteStream event 'resize' on Windows #13576
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
Changes from 1 commit
6da59fe
a45bd1d
84db75d
63fa375
86dfd24
192a56f
784055f
05ce78a
5944bf0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,12 +82,15 @@ or `writeStream.rows` properties have changed. No arguments are passed to the | |
| listener callback when called. | ||
|
|
||
| ```js | ||
| process.stdin.setRawMode(true); | ||
| process.stdout.on('resize', () => { | ||
| console.log('screen size has changed!'); | ||
| console.log(`${process.stdout.columns}x${process.stdout.rows}`); | ||
| }); | ||
| ``` | ||
|
|
||
| *Note:* Unrealiable event handler execution on all Windows platforms. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about something like:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gibfahn As per your comment I would suggest to include a note about having to use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That seems much better. Is it ok as 2 commits or do I need to squash/rebase?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit terse... can you expand this just a bit more?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could add something like It was also suggested here that raw mode must be enabled but I did not find this in my own testing. |
||
|
|
||
| ### writeStream.columns | ||
| <!-- YAML | ||
| added: v0.7.7 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what @bzoz was saying in #13197 (comment) is that this line is needed on Windows, which implies it isn't needed on other platforms.
The code snippet without this sample works reliably in Unix, and even with this sample it's not reliable on Windows (#13197 (comment)), so I think it's probably best to just not include this (especially if this leads to people not being able to Ctrl+C their program).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct. (as far as I know) Removed. I don't think it's necessary to mention in commit messages since I both added and removed it?