mobile-shell / mobile-shell/mosh
Use TERM=xterm-256color (or better) when truecolor is supported.
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 14.5k
- Forks
- 865
- PR merge metrics
- No merged PRs in 30d
Description
The current situation is that mosh will manually test for color support using terminfo, which makes sense, but then it only checks to see if the value is 256 or not. If it's 256, it sets xterm-256color and if not, it sets xterm:
This is a problem when terminals support truecolor and correctly advertise that they support 16M colors via terminfo, e.g.
$ tput -T alacritty-direct colors
16777216
In this scenario, mosh says, "Well.. it's not 256 so I guess it's 8," and then sets TERM=xterm. Then everything that is run inside the session, including tmux, thinks that not even 256 colors are supported, let alone 16M colors. It would be great if COLORTERM=truecolor were sufficient, but unfortunately it's not. There are too many applications that only look at $TERM (via terminfo) and are thus broken :(.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/frontend/mosh-server.cc lines 572-578 and compare its terminfo color-count handling with the truecolor example using tput -T alacritty-direct colors. Done means terminals advertising truecolor no longer fall back to TERM=xterm, while existing 256-color behavior remains correct.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100