deivid-rodriguez / byebug

Debugging in Ruby 2
BSD 2-Clause "Simplified" License
3.34k stars 328 forks source link

Readline options? #510

Open MSP-Greg opened 5 years ago

MSP-Greg commented 5 years ago

JFYI,

It was mentioned in Ruby core, another ruby implementation: https://github.com/aycabta/reline

I did test it with the Ruby Core readline tests, and it did fail some tests (missing methods, etc).

I'd help with it, but given that I'm a Windows type, I don't really have a 'baseline' for how readline should work...

deivid-rodriguez commented 5 years ago

Your fork is good for Windows until some progress is made on the official libraries :+1:

MSP-Greg commented 5 years ago

Sometime soon, I'll try it with byebug and see how the tests do...

MSP-Greg commented 5 years ago

Off topic - JFYI https://bugs.ruby-lang.org/issues/15313

MSP-Greg commented 4 years ago

Yesterday morning I ran tests with reline & ruby-head, some issues. Haven't torn thru your code, how do I get typical --verbose test output?

From my perspective, reline should work with byebug...

deivid-rodriguez commented 4 years ago

I think with TESTOPTS=--verbose?

Yeah, I think it should work too, but when I tried tests wouldn't run. I think it's some problem when shelling out with Open3 and passing user input to the subprocess.

MSP-Greg commented 4 years ago

First thing I tried. Dots...

IO.popen, Open3, etc. I've worked plenty with STDOUT & STDERR, but STDIN, no.

I've tried tests from time to time also. Also, I said 'reline should work with byebug'. I really think that reline can only be considered a replacement for readline when it works with byebug...

deivid-rodriguez commented 4 years ago

First thing I tried. Dots...

Try bin/minitest --verbose (not sure why the other option is not working).

It'd be great to get this working, indeed.

MSP-Greg commented 4 years ago

Duh. Looked at the code a bit

rake test --verbose

Back to frozen tests...

MSP-Greg commented 4 years ago

I worked a bit with reline using ruby-head, which I think is equivalent to reline master. Tests were intermittent, but sometimes all did pass. Used the following code for reline, most of which came from its test setup:

require 'reline'
Reline.send(:remove_const, :IOGate) if Reline.const_defined?(:IOGate)
Reline.const_set :IOGate, Reline::GeneralIO
Reline.core.config.instance_variable_set :@test_mode, true
Reline.core.config.reset
Reline.core.input = STDIN
MSP-Greg commented 4 years ago

Using something similar to the above, CI is passing on Windows using reline. I'm considering this to be on hold until a determination is made as to reline's UI compatibility with Windows.