-
Notifications
You must be signed in to change notification settings - Fork 362
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
VT100 escape sequences appearing on Windows 10 Console #3897
Conversation
Will be this a part of 2.0.6? Seems a reasonable user experience bug fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Closing stdin might cause problems with some commands on Linux, but I think here it will be OK; and anyway we will have time to check those.
This isn’t ready to go - the CI failures are relevant |
I don't intend merging 890c297 (the stdin change) in 2.1. |
Subprocesses which gain access to the Console may reset it while running in the background.
Good to go with CI! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
�[32mThank you!�[0m 😊 |
During
opam init
, things proceed nicely until a second or so after the repository tarball is downloaded when the "Processing" message suddenly appears as:The problem is that processes invoked by
opam
gainstdin
and therefore the Console and clear the Console mode (in particular, Cygwin processes seem to do this). They're running in the background, so it doesn't matter whether they behave nicely and restore the console mode on termination, because the message may well be displayed while they're running.This PR offers two "fixes":
OpamConsole
mode is altered to force-set the mode on every print (this is ugly, but not much more ugly than what was there before)allow_stdin
is declaredfalse
on Windows, and a couple of places whereallow_stdin
should clearly befalse
(cygpath
invocation and the download command) are setEither of these on their own is sufficient to fix the Windows problem.