If there is a multibyte string in the previous line, the cursor moves downwards to the wrong position.
The same goes for moving up.
Findings
$this->cursorPosition in Laravel\Prompts\TextareaPrompt includes multibyte widths counted as 2 by mb_strwidth(), and I think it's necessary for determining cursor position in multiline text.
It seems the bug is caused by $this->cursorPosition passed in:
Laravel Prompts Version
0.1.18
Laravel Version
11.3.0
PHP Version
8.2.13
Operating System & Version
Ubuntu 22.04 via WSL2
Terminal Application
VS Code's integrated terminal
Description
Issue
If there is a multibyte string in the previous line, the cursor moves downwards to the wrong position. The same goes for moving up.
Findings
$this->cursorPosition
inLaravel\Prompts\TextareaPrompt
includes multibyte widths counted as 2 bymb_strwidth()
, and I think it's necessary for determining cursor position in multiline text. It seems the bug is caused by$this->cursorPosition
passed in:I'm posting here because I couldn't find a good solution.
Steps To Reproduce
run this code and: