ruby / irb

interactive Ruby
BSD 2-Clause "Simplified" License
393 stars 119 forks source link

Change debug test workaround only enabled when output is tty #949

Closed tompng closed 7 months ago

tompng commented 7 months ago

In https://github.com/ruby/irb/pull/943, we add a workaround puts but it caused IRB binding spec failure in https://github.com/ruby/ruby/pull/10712.

To minimize the impact and to avoid test failure in other project, I think it is better to restrict this workaround only to tty environment. For other projects that runs integration test using IO.popen in other projects won't be affected by the workaround. The workaround still works for debug because debug uses PTY.open, not IO.popen.

dgutov commented 2 months ago

@tompng FWIW, that puts workaround added a superfluous newline in Emacs' inf-ruby before every prompt (to remind: StdioInputMethod is used there since #907), and this didn't fix it (@stdout.tty? returns true).

EDIT: Sorry, that's #990.