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 IRB readline issue on linux under a non-forked PTY #5005

Closed
byteit101 opened this issue Jan 24, 2018 · 5 comments
Closed

JRuby IRB readline issue on linux under a non-forked PTY #5005

byteit101 opened this issue Jan 24, 2018 · 5 comments

Comments

@byteit101
Copy link
Member

Environment

  • jruby 9.1.15.0 (2.3.3) 2017-12-07 929fde8 OpenJDK 64-Bit Server VM 25.151-b12 on 1.8.0_151-b12 +jit [linux-x86_64]
  • On several linuxes (RHEL and Debian)
  • rspec and ffi gems installed
  • Might also work on OSX; haven't tried

Test

I wrote this RSpec test that passes 3/3 on MRI, yet only passes 1/3 on JRuby:

https://gist.github.com/byteit101/241c5bb712c0d28930163ff0d88dc878

Note I had to patch PTY.open to avoid #5004

I think that the cases are fairly self explanatory, but in short it seems that IRB in some instances doesn't interactively support the arrow keys, and double echos, though if you press the keysequence blind and then hit enter, it works despite showing the escape characters.

@headius
Copy link
Member

headius commented Jan 24, 2018

IRB is unlikely to work properly within a PTY due to the jline library we normally use. I suspect this would work ok if you run with rb-readline which on JRuby will use true native descriptors and readline-equivalent operations.

@enebo We should talk about whether to make our readline be rb-readline on platforms where we can do native IO.

@headius headius added this to the JRuby 9.2.0.0 milestone Jan 24, 2018
@headius
Copy link
Member

headius commented Jan 24, 2018

Marking for 9.2 since fixing this would likely require moving away from jline.

@enebo
Copy link
Member

enebo commented Jan 24, 2018

@headius is there something @byteit101 could try like replace require 'readline' with some other require which loads that version? I am more thinking about just testing to see if it solves the issue and possibly as a workaround for him.

@enebo enebo modified the milestones: JRuby 9.2.0.0, JRuby 9.2.1.0 May 24, 2018
@headius
Copy link
Member

headius commented Oct 11, 2018

Move readline issues to 9.3.

@headius headius modified the milestones: JRuby 9.2.1.0, JRuby 9.3.0.0 Oct 11, 2018
@headius
Copy link
Member

headius commented May 24, 2021

This issue is only indirectly related to IRB and has been superseded by #6552, which I discovered while fixing issues in our FFI-based io-console, which I was doing to support the new IRB.

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

No branches or pull requests

3 participants