Skip to content

Commit 417dac1

Browse files
committed
doc: readline.getCursorPos() documentation
1 parent 5f4f780 commit 417dac1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/api/readline.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,19 @@ reading input from a TTY stream. The position of cursor determines the
398398
portion of the input string that will be modified as input is processed,
399399
as well as the column where the terminal caret will be rendered.
400400

401+
### rl.getCursorPos()
402+
<!-- YAML
403+
added: REPLACEME
404+
-->
405+
406+
* Returns: {Object}
407+
* `rows` {number} the row of the prompt the cursor currently lands on
408+
* `cols` {number} the screen column the cursor currently lands on
409+
410+
Returns the real position of the cursor in relation to the input
411+
prompt + string. Long input (wrapping) strings, as well as multiple
412+
line prompts are included in the calculations.
413+
401414
## readline.clearLine(stream, dir\[, callback\])
402415
<!-- YAML
403416
added: v0.7.7

0 commit comments

Comments
 (0)