Skip to content
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

Update Reline::IOGate dynamically when it is needed #560

Merged
merged 1 commit into from Jul 5, 2023

Conversation

tompng
Copy link
Member

@tompng tompng commented Jun 29, 2023

Workaround for #559
$stdout.tty? sometimes change from false to true in a normal Rails application's rails console with combination of gem spring.

If it changed to true, Reline should use Reline::ANSI instead of Reline::GeneralIO.
This pull request will make Reline re-initialize Reline::IOGate in readline and readmultiline if needed.

Is there any idea writing test for this?

@hsbt hsbt changed the title Update Relin::IOGate dinamically when it is needed Update Reline::IOGate dinamically when it is needed Jun 29, 2023
@st0012 st0012 changed the title Update Reline::IOGate dinamically when it is needed Update Reline::IOGate dynamically when it is needed Jul 3, 2023
@st0012
Copy link
Member

st0012 commented Jul 5, 2023

Is there any idea writing test for this?

Since we can't control $stdout.tty? from another process, it's probably not possible?

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested in the application that I initially found the problem, and it fixes the issue 🎉
Thank you so much 👍

@st0012 st0012 added the bug Something isn't working label Jul 5, 2023
@st0012 st0012 merged commit 4680d1c into ruby:master Jul 5, 2023
30 checks passed
@tompng tompng deleted the iogate_switch branch July 6, 2023 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

None yet

2 participants