-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Colors lost after installing v1.18.1 on Windows 10 #14174
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
Comments
This is unexpected on OTP 26 and 27, we will take a look. How are you running it? Console? Powershell? |
A couple additional questions. |
Under Elixir v1.17.3 and OTP 27.1, Interactive Elixir (1.18.1) - press Ctrl+C to exit (type h() ENTER for help) ** (CompileError) cannot compile code (errors have been logged) iex(1)> :prim_tty.isatty(:stdout) |
Can you please run |
Sorry my bad. Actually
In my profile.ps1 file, I have
It seems to exit normally by hitting
In summary, the issue seems to be with Powershell. However it remains that under v1.17.3, |
I compared files between v1.17.3 and v1.18.1 => both
as opposed to only these lines for v1.18.1:
I did not compare yet the |
OK. I just compared the 2 |
Those changes should be ok because we now use this code to enable colors: https://github.com/elixir-lang/elixir/blob/v1.18.1/lib/elixir/src/elixir.erl#L59-L65 And, according to that code, your ansi mode should be enabled because of this I have one last theory though, can you please check the return type of |
OK, I found what causes no colors in v1.18.1 (though I cannot explain why). When I compile my Elixir apps, I use a utility package which runs various commands using |
I just got some "dump output" that may help: in v1.18.1 after hitting Ctrl+C once, I typed =proc:<0.0.0> 0x0000023ba8d4b910 Return addr 0x0000023ba08d2580 () 0x0000023b9eb2cf20 Return addr 0x0000023ba08d2580 () |
Did you get the same ctrl+c issue if running I will comment on the ANSI stuff soon. :) |
The end portion of the above dump may contain additional cues: 0x0000023ba8d61950 Return addr 0x0000023ba08d2580 () 0x0000023ba8d7f458 Return addr 0x0000023ba0eadf9c ('Elixir.IEx.Evaluator':init/5 + 700) 0x0000023ba8d7f4a0 Return addr 0x0000023ba0b18a70 (proc_lib:init_p_do_apply/3 + 208) 0x0000023ba8d7f4c0 Return addr 0x0000023ba08d2580 () An error has occurred that was not properly handled. Additional information is shown below. The PowerShell process will exit. |
When I type |
I just found a way to perform a "clean" exit from |
@RaymondLoranger thank you for all help so far. Can you do one last favor? Can you please open up your iex.ps1 and change this line: Line 23 in f16fb5a
Instead of elixir.ps1, it should say elixir.bat. Does that fix the double Ctrl+C issue? |
You can also try removing the |
Replacing
etc. HOWEVER, removing file |
The color issue is expected. When you invoke something programatically, tools do not typically assume color should be enabled. That's how Elixir behaves on Unix and now it behaves consistent. So you can enable the color manually, to make it easier on your side, I have merged PR #14183, so you can run this command instead:
It will be available in the next 1.18 version. For the double Ctrl+C, there is PR #14182, but I need to evaluate it more carefully. |
With @wojtekmach's help, I was able to reproduce it only with Erlang and I reported it upstream: erlang/otp#9285 |
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]
Interactive Elixir (1.17.3) - press Ctrl+C to exit (type h() ENTER for help)
Operating system
Windows 10
Current behavior
Messages like logger messages are output in colors under v1.17.3. However, I got monochrome messages after installing v1.18.1. As a result, I reverted to v1.17.3 and the colors returned! Under v1.18.1, I had to explicitly specify
config :elixir, ansi_enabled: true
in config.exs to "force" colored output. Also under v1.18.1, I could not exit IEx normally by hitting Ctrl+C. The behavior was completely erratic. Too bad, I would like to use the new JSON app. Note that I performed the following command to enable ANSI escapes in the Windows terminal:reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1
Expected behavior
I want colored output under v1.18.1 when running tests (like green dots) or
mix hex.outdated
like I do under v1.17.3.The text was updated successfully, but these errors were encountered: