Skip to content

Commit

Permalink
🐛 256/truecolor detection fix
Browse files Browse the repository at this point in the history
  • Loading branch information
haliphax committed Mar 27, 2024
1 parent deb082b commit 6d3f2cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions xthulu/ssh/console/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@ def __init__(
**kwargs,
):
self.encoding = encoding
color_term = _environ.get("COLORTERM") if _environ else None
term_type = (_environ.get("TERM") if _environ else None) or ""
color_system = (
"truecolor"
if color_term == "truecolor" or term_type.find("truecolor") >= 0
else "256"
if term_type.find("256") >= 0
else "standard"
)
super().__init__(
**kwargs,
color_system=color_system,
file=FileWrapper(ssh_writer, encoding),
force_interactive=True,
force_terminal=True,
Expand Down

0 comments on commit 6d3f2cc

Please sign in to comment.