GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — TTY: Document WriteStream.cursorTo and others by ur0 · Pull Request #22893 · nodejs/node

Conversation

@ur0

@ur0 ur0 commented Sep 17, 2018

Copy link
Copy Markdown
Contributor

This adds documentation for the following WriteStream instance methods:

  • cursorTo
  • moveCursor
  • clearLine
  • clearScreenDown
  • getWindowSize

Fixes #9853.

Checklist
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@ur0
TTY: Document WriteStream.cursorTo and others
2621840
Adds documentation for the following WriteStream instance methods:
- cursorTo
- moveCursor
- clearLine
- clearScreenDown
- getWindowSize

Fixes nodejs#9853.
@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. tty Issues and PRs related to the tty subsystem. labels Sep 17, 2018
vsemozhetbyt
vsemozhetbyt reviewed Sep 17, 2018
View reviewed changes

@vsemozhetbyt vsemozhetbyt left a comment

Copy link
Copy Markdown
Contributor

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.

Hi @ur0. Thank you for an effort to improve the docs!

I do not know if these methods are intended to be documented but in case they do, I've mentioned some nits that can be fixed)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/tty.md Outdated
* `x` {number}
* `y` {number}

`writeStream.cursorTo` moves this `WriteStream`'s cursor to the specified

@vsemozhetbyt vsemozhetbyt Sep 17, 2018

Copy link
Copy Markdown
Contributor

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.

`writeStream.cursorTo` -> `writeStream.cursorTo()` as per our doc/STYLE_GUIDE.md. The same for the method mentions below.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/tty.md Outdated
`writeStream.cursorTo` moves this `WriteStream`'s cursor to the specified
position.

### writeStream.moveCursor(dx, dy)

@vsemozhetbyt vsemozhetbyt Sep 17, 2018

Copy link
Copy Markdown
Contributor

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.

Doc sections need to be ABC-sorted by their headings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/tty.md Outdated
<!-- YAML
added: v0.7.7
-->
* Returns: {array}

@vsemozhetbyt vsemozhetbyt Sep 17, 2018

Copy link
Copy Markdown
Contributor

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.

{array} -> {Array} (non-primitive types are uppercased).
Or maybe, as we know the array's elements type, we can make this {number[]}.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/tty.md Outdated
-->
* Returns: {array}

`writeStream.getWindowSize` returns the size of the [TTY]() corresponding

@vsemozhetbyt vsemozhetbyt Sep 17, 2018

Copy link
Copy Markdown
Contributor

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.

It seems the link should be [TTY](tty.html) or [TTY](#tty_tty) here and below.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/tty.md Outdated

`writeStream.getWindowSize` returns the size of the [TTY]() corresponding
to this `WriteStream`. The array is of the type `[numColumns, numRows]`
where `numColumns` and `numRows` represents the number of columns and rows

@vsemozhetbyt vsemozhetbyt Sep 17, 2018

Copy link
Copy Markdown
Contributor

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.

represents -> represent.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vsemozhetbyt

vsemozhetbyt commented Sep 17, 2018

Copy link
Copy Markdown
Contributor

cc @nodejs/documentation

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ur0

ur0 commented Sep 18, 2018

Copy link
Copy Markdown
Contributor Author

Thanks @vsemozhetbyt! I’ll fix the issues in a bit.

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Sep 24, 2018

Copy link
Copy Markdown
Member

ping @ur0 … anything we can help with? :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ur0
TTY: Fix nits in WriteStream documentation
632ba5a
- Adds missing parens in function names
- Changes `array` to `number[]`
- Sorts headers
- Adds missing link
@ur0

ur0 commented Sep 25, 2018

Copy link
Copy Markdown
Contributor Author

Sorry for the delay, and thanks for the offer @addaleax!

Just fixed all of the nits. CC @vsemozhetbyt @nodejs/documentation for a review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jasnell
jasnell approved these changes Sep 25, 2018
View reviewed changes

@jasnell jasnell left a comment

Copy link
Copy Markdown
Member

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.

Looks like CI failed so that'll need a look but otherwise LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vsemozhetbyt
vsemozhetbyt approved these changes Sep 25, 2018
View reviewed changes
Comment thread doc/api/tty.md Outdated
where `numColumns` and `numRows` represent the number of columns and rows
in the corresponding [TTY](tty.html).

## tty.isatty(fd)

@vsemozhetbyt vsemozhetbyt Sep 25, 2018

Copy link
Copy Markdown
Contributor

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.

It seems this section should be the last one)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread doc/api/tty.md Outdated
Use the `NODE_DISABLE_COLORS` environment variable to enforce this function to
always return 1.

## writeStream.getWindowSize()

@vsemozhetbyt vsemozhetbyt Sep 25, 2018

Copy link
Copy Markdown
Contributor

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.

## -> ###.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vsemozhetbyt
vsemozhetbyt reviewed Sep 25, 2018
View reviewed changes
Comment thread doc/api/tty.md Outdated
-->
* Returns: {number[]}

`writeStream.getWindowSize()` returns the size of the [TTY](tty.html) corresponding

@vsemozhetbyt vsemozhetbyt Sep 25, 2018

Copy link
Copy Markdown
Contributor

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.

This line exceeds 80 characters limit (linter fails here).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vsemozhetbyt

vsemozhetbyt commented Sep 25, 2018

Copy link
Copy Markdown
Contributor

@ur0 Thank you for the fixes and patience. Just a few nits remain to be addressed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ur0
Reorder sections, fix line overflowing and header levels
c8ac64d
@ur0

ur0 commented Oct 5, 2018

Copy link
Copy Markdown
Contributor Author

@vsemozhetbyt all done, hopefully.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Oct 5, 2018

Copy link
Copy Markdown
Contributor

CI-lite: https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/1131/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt vsemozhetbyt added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Oct 5, 2018
vsemozhetbyt pushed a commit that referenced this pull request Oct 5, 2018
@ur0 @vsemozhetbyt
tty: document WriteStream.cursorTo() and others
2ba19ff
Adds documentation for the following `WriteStream` instance methods:

- `WriteStream.clearLine()`
- `WriteStream.clearScreenDown()`
- `WriteStream.cursorTo()`
- `WriteStream.getWindowSize()`
- `WriteStream.moveCursor()`

PR-URL: #22893
Fixes: #9853
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
@vsemozhetbyt

vsemozhetbyt commented Oct 5, 2018

Copy link
Copy Markdown
Contributor

Landed in 2ba19ff
(with nit fixed: ## tty.isatty(fd) level and position is restored).

Thank you!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt vsemozhetbyt closed this Oct 5, 2018
targos pushed a commit that referenced this pull request Oct 6, 2018
@ur0 @targos
tty: document WriteStream.cursorTo() and others
0f52ee6
Adds documentation for the following `WriteStream` instance methods:

- `WriteStream.clearLine()`
- `WriteStream.clearScreenDown()`
- `WriteStream.cursorTo()`
- `WriteStream.getWindowSize()`
- `WriteStream.moveCursor()`

PR-URL: #22893
Fixes: #9853
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
targos pushed a commit that referenced this pull request Oct 7, 2018
@ur0 @targos
tty: document WriteStream.cursorTo() and others
bf17708
Adds documentation for the following `WriteStream` instance methods:

- `WriteStream.clearLine()`
- `WriteStream.clearScreenDown()`
- `WriteStream.cursorTo()`
- `WriteStream.getWindowSize()`
- `WriteStream.moveCursor()`

PR-URL: #22893
Fixes: #9853
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
@targos targos mentioned this pull request Oct 7, 2018
Release proposal: v10.12.0 #23313
Merged
This was referenced Oct 10, 2018
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#225
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#239
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#226
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#240
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#227
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#241
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#242
Closed
This was referenced Oct 11, 2018
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#228
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#243
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#229
Closed
jasnell pushed a commit that referenced this pull request Oct 17, 2018
@ur0 @jasnell
tty: document WriteStream.cursorTo() and others
6b9965a
Adds documentation for the following `WriteStream` instance methods:

- `WriteStream.clearLine()`
- `WriteStream.clearScreenDown()`
- `WriteStream.cursorTo()`
- `WriteStream.getWindowSize()`
- `WriteStream.moveCursor()`

PR-URL: #22893
Fixes: #9853
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Vse Mozhet Byt <[email protected]>
@reyronald reyronald mentioned this pull request Feb 10, 2019
Add cursorTo & clearLine to streams meta/flow#7082
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell approved these changes
+1 more reviewer
@vsemozhetbyt vsemozhetbyt vsemozhetbyt approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. doc Issues and PRs related to Node.js documentation. tty Issues and PRs related to the tty subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@ur0 @vsemozhetbyt @addaleax @jasnell @nodejs-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.