-
Notifications
You must be signed in to change notification settings - Fork 77
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
Passing input through with Open3
to a subprocess using Reline.readline
crashes
#66
Comments
Replacing the bottom code of lib/reline.rb with the following seems to work on Windows, but not sure about other OS's and using tty to determine IO type... Reline::IOGate = begin
t = if Reline::Core::IS_WINDOWS
require 'reline/windows'
Reline::Windows
else
require 'reline/ansi'
Reline::ANSI
end
require 'reline/general_io'
STDOUT.tty? && STDIN.tty? ? t : Reline::GeneralIO
end
Reline.input = $stdin if Reline::IOGate == Reline::GeneralIO FYI, with a few patches, byebug passes on Windows using Reline. |
That sounds like a snippet we could perfectly add to byebug's test helper, right? Would you like to open a PR there? We shouldn't merge it straight away since we'll need to verify that the real user experience is unchanged, but a green CI would be a great starting point. Not sure if there's anything to be changed in |
Is the test helper loaded when Open3 is used? Don't recall...
I'm not sure what the benchmark is for a 'correct' user experience. |
No benchmark, I meant that I'll use
I don't think so, but we can load the snippet when needed, I think we do something similar with a Anyways, this is getting out of topic here, let's move the discussion to deivid-rodriguez/byebug#510. |
Hi guys, your issue is the only one result google gives me about this:
I face this issue in tests that launch my gem bin/ executable. It's the same in Ruby 2.3 .. 3.0 UPD: the same with backticks:
and with |
I tried to reuse the #4796 patch. With no success.
ruby 3.0.1 |
Take the following script named
test.rb
:If I run it with
ruby test.rb
so that it uses the builtin readline, it does what I expect and prints "y or no? y" to the script.However, if I run it through
RELINE=true ruby test.rb
so that it usesreline
, it prints the following:The text was updated successfully, but these errors were encountered: