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

readline: promote _getCursorPos to public api #30687

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
doc: readline.getCursorPos() documentation
  • Loading branch information
Js-Brecht committed Dec 9, 2019
commit 417dac1891026fc09fbef2c76808116c28042a2c
13 changes: 13 additions & 0 deletions doc/api/readline.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,19 @@ reading input from a TTY stream. The position of cursor determines the
portion of the input string that will be modified as input is processed,
as well as the column where the terminal caret will be rendered.

### rl.getCursorPos()
<!-- YAML
added: REPLACEME
Js-Brecht marked this conversation as resolved.
Show resolved Hide resolved
-->

* Returns: {Object}
* `rows` {number} the row of the prompt the cursor currently lands on
* `cols` {number} the screen column the cursor currently lands on

Returns the real position of the cursor in relation to the input
prompt + string. Long input (wrapping) strings, as well as multiple
line prompts are included in the calculations.

## readline.clearLine(stream, dir\[, callback\])
<!-- YAML
added: v0.7.7
Expand Down