-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Support ansi escape code conversion for windows #21337
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
I'm not sure I understand what you want. Added NeedsInfo label. |
This comment was originally written by @zoechi This is a Windows only-request. The Windows terminal doesn't support ANSI escape sequences.
|
Ok, so the standalone VM on Windows should detect ANSI escape sequences on stdout and convert them to something that the windows terminal does understand. A workaround is to use a non-default console application, or use a wrapper like ansicon. Added Area-VM, OpSys-Windows, Triaged labels. |
This comment was originally written by @seaneagan Re ansicon: The way to distribute CLI apps in dart is Re non-default console application: As a CLI author, it would be very difficult to get your windows users to switch console applications just to be able to use your CLI (or certain functionality of your CLI). cmd.exe and PowerShell are both shipped by default now on Windows, and git bash: is probably the next most popular. NodeJS scripts which use ansi escape codes just work out of the box on all these consoles, and with the popularity of node apps such as npm, bower, yo, grunt, gulp, which all use color output, having to explain to your users that dart doesn't support this might make you think twice about using using dart. |
This really should go into a package which controls the TTY. cc @turnidge. |
This comment was originally written by @seaneagan Is it possible to write packages that call C APIs? And only do so on Windows? |
This comment was originally written by @seaneagan Would need to implement something like this in dart: https://pypi.python.org/pypi/colorama A bit daunting, but it has been done. |
This issue was originally filed by @seaneagan
It's supported by nodeJS, which allows using colors etc. in console output, without making special cases for windows.
It's implemented in:
https://github.com/joyent/libuv/blob/master/src/win/tty.c
and:
https://github.com/adoxa/ansicon
I wonder if it would be possible to pull either of these libraries in as third party deps, or if not, if they would be interested in making that possible.
The text was updated successfully, but these errors were encountered: