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

IRB: arrow keys to move along cmd line and up/down in history not working on Windows #4141

Closed
sfrieske opened this issue Sep 7, 2016 · 25 comments

Comments

@sfrieske
Copy link

@sfrieske sfrieske commented Sep 7, 2016

Environment

Provide at least:

  • JRuby from 9.1.3 on, including .4 and .5
  • Windows

Expected Behavior

  • in IRB, arrow keys move the cursor along the cmd line or get previous/next line in history

Actual Behavior

  • while working on Linux, this has ceased working on Windows
  • there is just no action when one of the arrow keys is pressed
@headius
Copy link
Member

@headius headius commented Sep 7, 2016

This must be due to the ^C fix we did in 9.1.3 for #3721.

I don't know why it would cause this, though :-(

@headius headius added this to the JRuby 9.1.6.0 milestone Sep 7, 2016
@headius
Copy link
Member

@headius headius commented Sep 7, 2016

A workaround for you: I believe if you install the 1.0 jruby-readline gem from here you'll restore the old behavior.

@mkristian Perhaps it's time we made jruby-readline a real rubygems.org gem, so it's easier for folks to up/downgrade it as we make fixes.

@headius
Copy link
Member

@headius headius commented Sep 7, 2016

Drat...installing the 1.0 gem does not seem to fix the problem. I'll look into this today.

@headius
Copy link
Member

@headius headius commented Sep 7, 2016

Ok, here's a working workaround:

  1. gem install that 1.0 jruby-readline gem
  2. delete readline.jar from /lib/ruby/stdlib
@cmichon
Copy link

@cmichon cmichon commented Sep 8, 2016

The jar replacement fixes the issue. I agree the jruby-readline should become a real gem as otherwise this will remain a dirty fix.

@tobymurray-nanometrics
Copy link

@tobymurray-nanometrics tobymurray-nanometrics commented Sep 16, 2016

Would this also impact pasting content? I'm seeing some extremely weird behavior there, although I haven't tried to isolate JRuby from all the other tools which might be impacting it.

@headius
Copy link
Member

@headius headius commented Sep 21, 2016

@tobymurray-nanometrics On Windows? It certainly could.

@headius
Copy link
Member

@headius headius commented Sep 21, 2016

@mkristian I tried to release a 1.1.1 gem with the regression reverted, but I'm not sure it's building the gem appropriately for rubygems.org. I can install the gem, but attempting to activate it produces the following error:

[] ~/projects/jruby-readline $ gem install jruby-readline
Successfully installed jruby-readline-1.1.1-java
1 gem installed

[] ~/projects/jruby-readline $ jruby -v -e 'gem "readline"; require "readline"'
jruby 9.1.4.0 (2.3.1) 2016-09-01 2e1327f Java HotSpot(TM) 64-Bit Server VM 25.92-b14 on 1.8.0_92-b14 +jit [darwin-x86_64]
Gem::MissingSpecError: Gem::MissingSpecError
  to_specs at /Users/headius/.rvm/rubies/jruby-9.1.4.0/lib/ruby/stdlib/rubygems/dependency.rb:308
   to_spec at /Users/headius/.rvm/rubies/jruby-9.1.4.0/lib/ruby/stdlib/rubygems/dependency.rb:320
       gem at /Users/headius/.rvm/rubies/jruby-9.1.4.0/lib/ruby/stdlib/rubygems/core_ext/kernel_gem.rb:65
    <main> at -e:1

I believe it should be possible to put out a release of the gem, and get existing JRuby versions to load it by using gem install --default jruby-readline combined with gem install jruby-readline in some order, but this indicates it's simply not loading right.

@headius
Copy link
Member

@headius headius commented Sep 21, 2016

jruby-readline 1.1.1 released to rubygems and maven. The current workaround is

  1. gem install jruby-readline
  2. delete readline.jar from /lib/ruby/stdlib
@headius
Copy link
Member

@headius headius commented Nov 8, 2016

This is still outstanding. @enebo: Should we revert the change to jruby-readline and release 9.1.6.0 with the reverted version?

@enebo
Copy link
Member

@enebo enebo commented Nov 8, 2016

@headius I feel this is more annoying than what happened in #3721 so yeah reverting feels like the lesser of two evils. I also hate second-classing windows users so perhaps this is a nice gesture :)

@headius
Copy link
Member

@headius headius commented Nov 8, 2016

This is fixed with the release of jruby-readline-1.1.1, and jruby-9.1.6.0 release today will ship that.

@headius headius closed this Nov 8, 2016
@headius headius modified the milestones: JRuby 9.1.6.0, JRuby 9.2.0.0 Nov 8, 2016
@hathawad
Copy link

@hathawad hathawad commented Nov 11, 2016

I can confirm this is fixed on Windows w/ jruby-9.1.6.0

@hathawad
Copy link

@hathawad hathawad commented Mar 22, 2018

This issue seems to be back w/ jruby-9.1.16.0

@hathawad
Copy link

@hathawad hathawad commented Apr 5, 2018

This is broken again on Windows w/ jruby-9.1.16.0
@headius do we need new issue, or should we reopen this one?

@hathawad
Copy link

@hathawad hathawad commented Apr 9, 2018

FYI this work around seems to be working (taken in part from above in this thread):

  1. gem install jruby-readline
  2. copy readline.jar from gem installation to lib\ruby\stdlib
@mkristian
Copy link
Member

@mkristian mkristian commented Apr 10, 2018

@hathawad may I ask which version of jruby-readline you are using ? as the version from jruby-9.1.16 should be the same (binary compatible) as jruby-readline-1.1.1

@rob99
Copy link

@rob99 rob99 commented May 25, 2018

@hathawad may I ask which version of jruby-readline you are using ?

I had the same problem as @hathawad - it's the jruby-9.1.16.0\lib\ruby\stdlib\readline.jar "version" i.e. the standard lib not the gem. Replacing this jar with the one from the gem install fixes it.

@cmichon
Copy link

@cmichon cmichon commented May 25, 2018

@mkristian
Copy link
Member

@mkristian mkristian commented Jun 2, 2018

@headius what is the take on this one here. are we going back to version 1.1.1 or wit until we get a reimplementation of readline ? can not remember the problems we resurrect with downgrading to 1.1.1

@headius
Copy link
Member

@headius headius commented Jun 2, 2018

@hathawad Could you open a new issue please? We want to keep the lineage of what was "fixed" when, even if it regresses.

@hathawad
Copy link

@hathawad hathawad commented Jun 2, 2018

Sure

@toliman7
Copy link

@toliman7 toliman7 commented Apr 10, 2019

Opened #5687 for 9.2.x

@cmichon
Copy link

@cmichon cmichon commented Apr 16, 2019

@F2Andy
Copy link

@F2Andy F2Andy commented May 29, 2019

Just to note that I am using JRuby 9.2.5.0, and also have this problem. The trick of using the jruby-readline, and copying either the one file or all the files failed to solve it; I just got an error:

no such file to load -- jline/jline/2.11/jline-2.11 (LoadError)
do_require at C:/jruby-9.2.5.0/lib/ruby/stdlib/jar_dependencies.rb:356
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
10 participants
You can’t perform that action at this time.