-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
REPL: Query libuv
for virtual terminal support
#57132
Conversation
7e36b17
to
468be4f
Compare
468be4f
to
44a6644
Compare
ConsoleMode
flags on Windowslibuv
for virtual terminal support
5ef9f00
to
37e0f88
Compare
37e0f88
to
eaee38c
Compare
eaee38c
to
3468c0e
Compare
The query-and-restore logic here was pretty flawed: - it had no way to guarantee when the "default" mode is available to query, so it could easily save a "bad" mode - it did not ensure / check whether the "default" mode is compatible with the output generated by REPL (esp. ASCII escape codes / color) - it persisted the "default" mode from pre-compilation to runtime, causing JuliaLang#56073 `ENABLE_VIRTUAL_TERMINAL_PROCESSING` is the only flag that we're agnostic about. It was added relatively recently (Windows 10 version 1511), and `libuv` has support to emulate its behavior when it's not available natively. Otherwise this PR resets ENABLE_PROCESSED_OUTPUT and ENABLE_WRAP_AT_EOL_OUTPUT always, since we output ASCII control sequences unconditionally. Resolves JuliaLang#56073.
3468c0e
to
12e6584
Compare
This might technically be a minor abuse of the libuv API, which was apparently intended for the opposite case, where the terminal does not appear to support The alternative would be to do what libuv does and try to see if the feature flag "sticks" after a |
@vtjnash any concerns here before I merge? |
Removing label since this was merged before branching. |
The query-and-restore logic here was pretty flawed:
With this PR,
ENABLE_VIRTUAL_TERMINAL_PROCESSING
is the only flag that we're agnostic about. It was added relatively recently (Windows 10 version 1511), andlibuv
has support to emulate its behavior when it's not available natively. We querylibuv
directly to ask whether it is expecting to emulate, rather than measuring the console mode at some random point in time.Otherwise this PR resets ENABLE_PROCESSED_OUTPUT and ENABLE_WRAP_AT_EOL_OUTPUT always, since we output ASCII control sequences unconditionally.
Resolves #56073.