-
Notifications
You must be signed in to change notification settings - Fork 86
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
Reline behaves oddly with redirect (nontty output) #616
Comments
I think it is Reline's bug. Reline's output should make the terminal screen to show:
My understanding is that Reline does not aim to output exactly the same byte sequence as Readline. Reline's output can contain escape sequences or control characters like Note that Readline's output sometimes contains different escape sequence depending on version or environment. printf "ruby\x01\x04R\n" | ruby -rreadline -e 'puts Readline.readline(">")'
# output(readline 8.2): ">ruby\r\e[C\e[1Puby\r\e[CRuby\b\b\b\nRuby\n"
# output(readline 8.1): ">ruby\r>\e[1P\e[1@R\nRuby\n"
# terminal screen: ">Ruby\nRuby\n" |
In ruby 3.3, readline falls back to reline by default. This creates odd output when the terminal is not a real TTY. See ruby/reline#616.
In ruby 3.3, requiring readline does not load the real readline library but falls back to reline by default. This creates odd output when the terminal is not a real TTY, making the interactive debugging scenario fail. See #910 for details. Also, see ruby/reline#616 for the resulting reline issue. As a workaround, add the readline-ext gem which tries to use the real readline as was the default in Ruby 3.2 and earlier.
In Ruby 3.3, requiring readline does not load the real readline library but falls back to reline by default. This creates odd output when the terminal is not a real TTY and a prompt is used when getting input. Because pry uses a prompt, this makes the interactive debugging scenario fail. This change works around this issue by switching to irb. Irb will not use a prompt, possibly because the output is not a TTY. See #910. Also, see ruby/reline#616 for the resulting reline issue.
This works around Reline's misbehavior on low-capability terminals, such as when IRB is launched inside Emacs (ruby/reline#616). It should also resolve ruby#68 and resolve ruby#113 which were filed out of similar need.
* Switch to StdioInputMethod when TERM is 'dumb' This works around Reline's misbehavior on low-capability terminals, such as when IRB is launched inside Emacs (ruby/reline#616). It should also resolve #68 and resolve #113 which were filed out of similar need. * Add special env for testing See discussion in #907. --------- Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
Forwarded from cucumber/aruba testsute issue cucumber/aruba#910 , then from https://bugs.ruby-lang.org/issues/20052
Looks line reline behaves oddly with redirect (non tty)
With
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
andReadline
(version 8.2):With
ruby 3.3.0dev (2023-12-09 master 1cbe114d1c) [x86_64-linux]
andReline
(version 4.1): (Reline
installed fromgem install
)The text was updated successfully, but these errors were encountered: