You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In IRB's test code, TERM=dumb triggers Reline's test mode io Reline::GeneralIO (unlike the name, this is not a general io)
In practice, TERM=dumb seems to be used in real world. (example: pry/pry#2303)
It will unintentionally enables Reline's test mode and cause problems.
I think Reline should not use TERM=dumb to enable test mode. We need another way to enable it, or remove this test mode after fixing IRB's test not to depend on this.
I haven't looked much into the issue yet, but we need to be very cautious about this change because many projects, like Rails and debug, use TERM=dumb to turn on the Reline test mode. If we did decide to implement this change, let's make sure we roll it out gradually (e.g. supporting both TERM=dumb and the alternative for a while) so we have time to help those projects updating their tests.
FWIW, if we're talking about Reline inside Emacs, then removing special handling for TERM=dumb is not enough: if I just change those checks, that brings back the ▽ problem.
like Rails and debug, use TERM=dumb to turn on the Reline test mode.
I'm surprised by this, does anyone using Rails or the debug gem really want the Reline test mode?
It outputs a lot of extra output which seems unusable except maybe when debugging Reline itself:
$ echo 'my input' > in
$ TERM=dumb ruby -rreadline -e 'p Readline; p [STDIN,STDOUT,STDERR].map(&:tty?); p Readline.readline("> ", true)' < in |& ruby -e 'p STDIN.read'
"Reline\n[false, false, false]\n> > mmymy my imy inmy inpmy inpumy input> my input\r\n\"my input\"\n"
Would you have an example?
I find it unlikely that some test would check e.g. that my input results in mmymy my imy inmy inpmy inpumy input or so.
I'd expect tests would use TERM=dumb to avoid extra escape sequences from Reline (#886), but then (non-reline-internal) tests would also expect no extra prints like mmymy my imy inmy inpmy inpumy input.
What does that do?
I think it's most people expectation that TERM=dumb means no extra escape sequences, and also that it behaves like a dumb terminal so e.g. echo'es the input as-is or with minimal changes, and without what looks like reline debugging output or so.
IOW, I doubt that disabling the mmymy my imy inmy inpmy inpumy input debugging would break any non-reline-internal test.
And that the original issue seems worth solving and seems not so likely to break anything.
Activity
[-]Enable test mode not by TERM=dumb[/-][+]Don't enable test mode by TERM=dumb[/+]st0012 commentedon Mar 23, 2024
I haven't looked much into the issue yet, but we need to be very cautious about this change because many projects, like Rails and debug, use
TERM=dumbto turn on the Reline test mode. If we did decide to implement this change, let's make sure we roll it out gradually (e.g. supporting bothTERM=dumband the alternative for a while) so we have time to help those projects updating their tests.dgutov commentedon Mar 23, 2024
FWIW, if we're talking about Reline inside Emacs, then removing special handling for
TERM=dumbis not enough: if I just change those checks, that brings back the▽problem.tompng commentedon Mar 24, 2024
If we're doing this, we also need to disable ▽ and "\e[6n" (Query Cursor Position) if TERM=dumb.
eregon commentedon Mar 7, 2026
I'm surprised by this, does anyone using Rails or the debug gem really want the Reline test mode?
It outputs a lot of extra output which seems unusable except maybe when debugging Reline itself:
(context: #886)
st0012 commentedon Mar 9, 2026
It's used in those projects to run integration tests that can verify the console's outupt. Not by their users.
eregon commentedon Mar 9, 2026
Would you have an example?
I find it unlikely that some test would check e.g. that
my inputresults inmmymy my imy inmy inpmy inpumy inputor so.I'd expect tests would use
TERM=dumbto avoid extra escape sequences from Reline (#886), but then (non-reline-internal) tests would also expect no extra prints likemmymy my imy inmy inpmy inpumy input.eregon commentedon Mar 9, 2026
What does that do?
I think it's most people expectation that
TERM=dumbmeans no extra escape sequences, and also that it behaves like a dumb terminal so e.g. echo'es the input as-is or with minimal changes, and without what looks like reline debugging output or so.IOW, I doubt that disabling the
mmymy my imy inmy inpmy inpumy inputdebugging would break any non-reline-internal test.And that the original issue seems worth solving and seems not so likely to break anything.
st0012 commentedon Mar 9, 2026
https://github.com/rails/rails/blob/7ff005d9416388f0fa6d89895c4c560c13717164/railties/test/engine/commands_test.rb#L40
The goal is to just capture
inputfor testing. But unfortunately we have to print every character too.