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

Use stdio directly on "dumb" terminals #2304

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

dgutov
Copy link
Contributor

@dgutov dgutov commented Mar 14, 2024

Resolves #2303

@dgutov
Copy link
Contributor Author

dgutov commented Mar 14, 2024

I've tried to add an integration test of sorts, but the "No live threads left" error got the better of me.

@dgutov
Copy link
Contributor Author

dgutov commented Mar 14, 2024

@andrehjr Check this out.

@andrehjr
Copy link
Member

Hi @dgutov I've made some additional changes on your PR. Can you try it?

Investigating a bit more, it seems this issue only happens when Reline is used in Pry as input (Ruby 3.3+). When I've tried emacs on the shell with older versions of ruby there was no issue.

I think this code might be removed if ruby/reline#660 changes how Reline treats TERM=dumb, but for now, it solves the echoing issue.

@dgutov
Copy link
Contributor Author

dgutov commented Mar 23, 2024

@andrehjr This works for me, thank you. This particular issue indeed seems Reline-specific (there were other bugs before, also related to Reline, but in the context of Pry IIUC they were triggered only with Rubies compiled without libreadline, so those should be covered as well).

Thanks for the link, I guess ruby/irb#907 also helped with that.

Speaking of the difference in solution, I think switching to SimpleStdio whenever the terminal is dumb and the user didn't choose any other input explicitly, makes a bit more sense conceptually, since it also covers unknown unknowns. But I don't mind the difference that much, and maybe we'll have a working Reline inside Emacs not too far off in the future.

@dgutov
Copy link
Contributor Author

dgutov commented May 1, 2024

@andrehjr Ping.

@andrehjr
Copy link
Member

andrehjr commented May 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When used inside Emacs with Reline, input is echoed
2 participants