rl.getCursorPos()


  • 返回:<Object>

    ¥Returns: <Object>

    • rows <number> 光标当前所在的提示行

      ¥rows <number> the row of the prompt the cursor currently lands on

    • cols <number> 光标当前所在的屏幕列

      ¥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.