enable `--ansi` by default on Windows
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
- I have searched the documentation and believe that my question is not covered.
Feature Request
The --ansi
option should be default on Windows.
On a fresh install of Windows 10 with a fresh install of the Windows version of Python 3.9.0 Install Poetry via:
py -m pip install --user pipx
py -m pipx ensurepath
# need to get a new console now for pipx to be on PATH
pipx install poetry
Now in both PowerShell and in cmd.exe running pipx --ansi
produces nice colors.
Is there a reason not to default --ansi
on Windows?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Use ANSI colors in the terminal - Windows CMD - SS64.com
To use ANSI colours in the Windows terminal requires setting VirtualTerminalLevel. VirtualTerminalLevel = 1 is now set by default for the terminal and...
Read more >How to make win32 console recognize ANSI/VT100 escape ...
FYI, in latest Windows 10, you can enable ANSI in conhost via the following reghack -- in HKCU\Console create a DWORD named VirtualTerminalLevel ......
Read more >Windows 10 1903) How to change Default Encoding UTF-8 to ...
In Regedit go to Computer\HKEY_CURRENT_USER\Software\Microsoft\Notepad. - in the menu select edit/new/DWORD.
Read more >Enable ANSI escape sequence within Windows 10 console
The registry key at HKEY_CURRENT_USER\Console\VirtualTerminalLevel sets the global default behavior for processing ANSI escape sequences. Create ...
Read more >Enable ANSI colors in Windows command prompt - Liferay
Windows command prompt by default does not have this feature. But do you remeber ANSI.SYS driver for DOS that enables this? I hope...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I also see Poetry 1.2.0a2 failing to auto-detect ANSI support:
The
ANSICON
env-var workaround still successfully enables ANSI.(Ignore the warning about Poetry already existing, that’s noticing my Poetry 1.1.7 installation)
I also checked
pipx run --spec poetry==1.2.0a1 poetry
just in case it was working in a1 but broken in a2, but the result was the same.I just checked, and the faulty code that was in clickit (see https://github.com/sdispater/clikit/issues/35#issuecomment-751977044) is still unchanged in cleo 1.0.0a4, so the bug is still in the underlying library: Cleo only auto-detects ANSI for Windows if it can turn on
ENABLE_VIRTUAL_TERMINAL_PROCESSING
, but not if it is already turned on, as is the case for Windows Terminal or other ConPTY-supporting terminal emulators.I raised a new issue at https://github.com/sdispater/cleo/issues/104
I could reproduce it from my Windows Terminal + git bash and poetry 1.1.6 (while it worked flawlessly with the same git bash and cmder)
With poetry version 1.2.0a1, it seems all fixed (thanks to #3618 I guess):
poetry
topoetry --ansi
, but it is non necessary anyway 😉 )