Closed mikaelstaldal closed 1 year ago
I need more information to be able to help. Mordant mostly uses environment variables for ansi detection. You TERM
envvar is probably set to something like xterm
, try setting it to xterm-256
or xterm-24bit
.
Yes, I realized that setting TERM=xterm-256color
solved the problem, and now it gets properly detected as ANSI256
.
However, XTerm has the silly behavior of setting TERM=xterm
by default, even though it supports 256 colors.
Maybe it would make sense for Mordant to try to detect XTerm and deduce ANSI256
regardless of TERM
setting? It has this env var that could help:
XTERM_VERSION=XTerm(372)
("372" is the version)
So something like if (env("XTERM_VERSION").startsWith("XTerm"))
maybe?
That's a useful envvar. I can add a check for it, but I'd want to look at the actual version number so that we don't use new ansi codes on old versions that don't support it.
It looks like 256 color support was working in version 122 and truecolor in 331.
That's a useful envvar. I can add a check for it, but I'd want to look at the actual version number so that we don't use new ansi codes on old versions that don't support it.
It looks like 256 color support was working in version 122 and truecolor in 331.
Yes.
@mikaelstaldal I added the xterm version check, give the latest snapshot a try and if it works I'll make a release.
It detects TRUECOLOR
as expected. And I get color output in XTerm, so it looks good.
XTerm on Linux gets detected as
ANSI16
, even though it supports more colors than that.