-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
inputs repeating question when input wraps #214
Comments
The prompt is re-rendered each time someone type a character, so my guess is once we have a line return the cleanup code for the previous line is not affecting a correct line. A fix could be to compare the real line length to the terminal width and determine how many line we need to cleanup. |
Does seem to be what's happening: when the prompt becomes three lines long, the first two aren't touched. I don't know how to write a test for this, sorry. Can you replicate it? |
I've had the same issue on both windows and mac, in the built-in terminal on mac and iTerm. |
Are there plans to fix this? |
Heh, pasting tokens is the case I had, too |
I have a fix working locally. I'll submit a PR soon. |
👍 🎊 |
that would be great @jviotti. this happens every time I use yeoman |
PR sent: #239. I only tested on OS X, so if you run a different OS, your testing would be appreciated :) |
I found out there was actually not good reason to to this
FYI, I have a one-line fix (tested on Windows). Feel free to try it and comment on whether it works for you or not. |
Seems to be fixing the symptom of the problem and not the problem itself, though. |
Well if (like I assume) there's no reason to redraw the line on each keypress, then fixing the while-writing line-redrawing issue is a waste of time and adds more code to maintain than it should. In this case, it's easier to remove the behavior altogether. Also: it may work better when you resize your console than the previous fix (as the question & input text may or may not rewrap, making things hard to compute reliably). But, you're right, the "redraw onEnd" is still buggy with this one-line fix. However, the amount of code required to fix that one bug would be much smaller than to fix both issues. Also, I don't care much about that remaining issue: what's important to me is that I can type more than one line without being disturbed ;-) |
Oh, by the way, this fixes another bug on Windows(cmder): the input cursor is now properly located at the insertion point, and not at the end of the input (#229). It was really annoying to edit your text because you had to remember in your head where the insertion point was, and how many times you had to press LEFT or RIGHT to move to the right location. When you don't rewrite the text while Windows isn't looking, you don't have this problem. |
What happens when you submit the input and the validation fail? |
I just wanted to highlight the fact that there is also a problem if the message of the question wraps. It gets really ugly with |
Also getting the same problem if a value in a |
Fixed on master. Please test and let me know how it goes. |
@SBoudrias The repeating issue is fixed however:
|
@jviotti please open new issues for new issues :) |
This problem happen when i npm install inquirer,anyone can help me? |
I'm seeing this problem again with long lines in checklist. |
@episodeyang please open a new issues with code and steps to reproduce the issues you're having. |
will do thanks!
…On Mon, Jan 22, 2018 at 11:45 PM, Simon Boudrias ***@***.***> wrote:
@episodeyang <https://github.com/episodeyang> please open a new issues
with code and steps to reproduce the issues you're having.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#214 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAme2mNUbTTt3aJeOUYCgX8HkZQX-qagks5tNXIIgaJpZM4Dbqvb>
.
|
@pauldijou I have the same problem. Did you solve it? The version is |
Sorry for the rubbish title, this is better explained by example.
If the input goes onto the next line, the question repeats for every character over the new line. It's a bit strange.
I'm using zprezto in iTerm2. Let me know if you need to know anything else.
The text was updated successfully, but these errors were encountered: