Open maraino opened 5 years ago
I am running into the same thing. It looks like for every character that is past the end of the width of the terminal, it prints a new prompt line. In your example, hi
were the extra characters, so you got 2 extra lines. I have a much longer string and it's dumping out a ton of lines. (We are expecting users to copy/paste a long string into the terminal)
I ran into this, too. It's being caused by line wrapping in the terminal.
After a little research, there isn't a perfect way to disable this, but I've made the issue better in many (most?) modern terminals by disabling wrapping:
https://github.com/shaneharter/promptui/commit/33d9dc105f3f49679d8cec3544835fdf5be3612e
I've not raised a PR because it seems a bit of a hack
Description
When a prompt and the user input fills the terminal width and the input has to go to the next line, the prompt is written again in a new line.
In a small terminal, the proof of concept bellow will cause multiple lines like:
Proof of concept: