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

Send prompt to stdout even if stdin is not a tty or check TERM also on Windows #832

Closed
jasagredo opened this issue Dec 11, 2024 · 4 comments · Fixed by #834
Closed

Send prompt to stdout even if stdin is not a tty or check TERM also on Windows #832

jasagredo opened this issue Dec 11, 2024 · 4 comments · Fixed by #834

Comments

@jasagredo
Copy link

This issue arises from the investigation in mthom/scryer-prolog#2694. There is a comment at the end explaining my conclusions but I will re-word it here below.

I was having issues calling Scryer Prolog from emacs. Scryer Prolog uses rustyline for the repl, and it will print a prompt on the repl (?- ). The emacs package ediprolog expects that prompt for running.

On Linux, the emacs shell eshell is identified by rustyline as an unsupported terminal, as it sets TERM=dumb. There rustyline flushes the prompt to stdout.

On Windows, the emacs shell eshell also sets TERM=dumb but this is not checked (it is said that checking TERM on Windows is a no-op, not sure why) so it falls into the third case of readline_with which does not flush the prompt.

I think at least with MSYS2 and others it is becoming more common for Windows applications to use things like TERM=dumb so I guess the check for "unsupported terminals" could be run also on Windows?

@gwenn
Copy link
Collaborator

gwenn commented Dec 11, 2024

For is_unsupported, we need to check the behavior of other similar libraries but your proposal seems right.
For MSYS2, see #401.

@gwenn
Copy link
Collaborator

gwenn commented Dec 11, 2024

Both replxx and isocline seem to behave like you suggested: no distinction between unix and windows.

@gwenn
Copy link
Collaborator

gwenn commented Dec 14, 2024

Could you please give a try to PR #834 ?
Thanks.

@jasagredo
Copy link
Author

Thanks @gwenn !

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 a pull request may close this issue.

2 participants