Support non-stdin pty/pts devices: Assign the correct IO to the stty calls #158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The current
stty size
calls implicitly assume the device to read from is stdin, which is not overridden when@rl_instream
is manually set to a pts device that isn't mapped to$stdin
. As such, when$stdin
is a pipe or other device where$stdin.tty? == false
, the prompt and history editing is not visible. Further, if$stdin
is sized differently than@rl_instream
, the size will be erroneously for$stdin
and not@rl_instream
.This PR:
io_exec
that correctly callsIO.popen
with@rl_instream
as stdinio_exec
@rl_instream
in the search-exit logic instead of hardcoding$stdin
I have successfully tested this on JRuby 9.2, MRI 2.2.0, MRI 2.5.1, MRI 2.6.2 on RHEL 7.6 & Debian 9.
I have not tested this on Windows or macOS, and would appreciate anyone with such a machine testing this change, as I have limited access to such boxes.