Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve detection of terminals over SSH
A recurring issue with terminals over SSH is that while TERM is passed in, COLORTERM is not by default. This means that programs running on the server only have access to TERM. If TERM is something like `xterm-256color` or `konsole-direct` this works fine, but if it is something like `wezterm` or `alacritty` it doesn't, so auto detection falls back to assuming colors aren't supported at all. This creates a pretty bad experience. I had a look at what some other crates do and it looks like anstyle (which is used by Cargo itself) just checks that the terminal isn't `dumb` (or `cygwin` on Windows). However I believe the latest version of anstyle also has a bug, that it thinks that if TERM isn't set on Windows then ANSI colors aren't supported. (That is fine for anstream, I believe, since that knows how to fall back to Windows console calls.)
- Loading branch information