Skip to content
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

jruby prompt adding chars? #2503

Open
mooreniemi opened this issue Jan 22, 2015 · 4 comments
Open

jruby prompt adding chars? #2503

mooreniemi opened this issue Jan 22, 2015 · 4 comments

Comments

@mooreniemi
Copy link

in pry (using a custom prompt), i see it add up to 4 chars. for instance, if i type "foodler", hit enter, then up arrow to retype, "food" will be caught in the prompt. if i press enter, it will clear the cursor back to the actual prompt end. i've talked to the pry guys and i'm not 100% sure it isn't an issue there, but i hoped you could help lead me to a fix.

screenshot 2015-01-22 17 38 19

in vanilla irb (no custom config, nothing), i see slightly different (but maybe related?) behavior, when i hit return on an empty line, chars will be added to the subsequent line and however many times i press enter, those extra chars will remain. if i type something in and hit enter, the cursor will return to the proper spacing from the prompt.

screenshot 2015-01-22 17 29 12

@DavidEGrayson
Copy link
Contributor

If the JRuby verison number in your IRB screenshot is accurate, you are using a pretty old version. I think you should try out 9.0.0.0-pre1 to see if the problem was already fixed.

I can't reproduce the IRB problem using JRuby 9.0.0.0-pre1 in Windows.

@mooreniemi
Copy link
Author

the pry prompt is still an issue in 1.7.10 and 1.7.13, fwiw. but the other cursor handling issue (second one) -- youre right, appears to be resolved in 1.7.10 +. i'll bark at the pry guys :)

@headius
Copy link
Member

headius commented Feb 24, 2015

Pry may be expecting more out of the readline Ruby stdlib than we're able to provide, or else that lib under Windows has some issues. I assume this doesn't happen on non-Windows?

Also, if we are working correctly in 9k.pre1 perhaps there's something to backport, but the priority of fixing in 1.7.x is somewhat reduced in my mind.

@kyrylo
Copy link
Contributor

kyrylo commented Mar 4, 2015

I was able to reproduce this bug with Pry 0.10.1 (the latest version) and JRuby 9.0.0.0.pre1 on Linux, using this prompt.

The same version of Pry doesn't feature this bug on CRuby 2.2.0. Perhaps, because CRuby's readline supports RL_PROMPT_START_IGNORE and RL_PROMPT_END_IGNORE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants