Skip to content

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

Closed
DartBot opened this issue Oct 15, 2014 · 7 comments
Closed

Support ansi escape code conversion for windows #21337

DartBot opened this issue Oct 15, 2014 · 7 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-not-planned Closed as we don't intend to take action on the reported issue os-windows type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Oct 15, 2014

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.

@lrhn
Copy link
Member

lrhn commented Oct 17, 2014

I'm not sure I understand what you want.
ANSI escape sequences are usually interpreted by the terminal, so what would you want Dart to do?
Is this an MS Windows only request?


Added NeedsInfo label.

@lrhn
Copy link
Member

lrhn commented Oct 17, 2014

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.

@DartBot
Copy link
Author

DartBot commented Oct 17, 2014

This comment was originally written by @seaneagan


Re ansicon: The way to distribute CLI apps in dart is pub global activate cli_app and the binstubs that that generates cannot be customized at all, much less per operating system, so as a CLI author, using ansicon as a wrapper is not an option. It would also be an extra dependency for a CLI user to have to install.

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:

http://msysgit.github.io/

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.

@iposva-google
Copy link
Contributor

This really should go into a package which controls the TTY.


cc @turnidge.
Added NotPlanned label.

@DartBot
Copy link
Author

DartBot commented Jan 9, 2015

This comment was originally written by @seaneagan


Is it possible to write packages that call C APIs? And only do so on Windows?

@DartBot
Copy link
Author

DartBot commented Jan 16, 2015

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.

@DartBot DartBot added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. os-windows closed-not-planned Closed as we don't intend to take action on the reported issue labels Jan 16, 2015
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed priority-unassigned labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-not-planned Closed as we don't intend to take action on the reported issue os-windows type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants