dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.31k stars 1.59k forks source link

`supportsAnsiEscapes` should check terminfo #31606

Open natebosch opened 6 years ago

natebosch commented 6 years ago

Today we assume that anytime $TERM contains "xterm" then it supports ansi escape codes. This means that a default configuration of tmux or screen will not appear to support ansi escapes.

It would be nice to get fuller support for reading terminfo in Dart scripts. In the short term it would be beneficial to treat "screen" the same way we treat "xterm" today

natebosch commented 6 years ago

This also impacts the shell in emacs, as well as the output from Travis CI, which both support at least the common escape codes like colors but are reported not to.

natebosch commented 6 years ago

rxvt-unicode is another one that is fairly common and has incorrect behavior today.

sigurdm commented 3 years ago

Note that @sortie added valuable information in this comment: https://github.com/dart-lang/sdk/issues/41770#issuecomment-624033448

RatakondalaArun commented 2 years ago

On Git Bash echo $TERM returns xterm-256color but stdout.supportsAnsiEscapes returns false.

image