charmbracelet/bubbletea

Bubble tea doesn't render colors on tmux over ssh

idvorkin opened this issue · 7 comments

Describe the bug
When using bubble tea on tmux over ssh, there are no colors being rendered. It works fine on ssh without tmux.

Setup
Please complete the following information along with version numbers, if applicable.

  • OS: Linux
  • Shell: Zsh
  • Terminal Emulator: iTerm and Blink
  • Terminal Multiplexer: Tmux over ssh and over mosh

To Reproduce
Steps to reproduce the behavior:

  1. Go to examples/alt-screen (I suspect issues always reproduce here)
  2. See the red text not rendered in color.

TL;DR to resolve

export   COLORTERM=truecolor

Hi! I'm not able to reproduce this, both with and without tmux running locally in addition to remotely. To make sure I'm understanding correctly, can you confirm you're doing the following:

  1. SSH'ing into a Linux server
  2. Running tmuxon the remote server
  3. Running the examples/alt-screen

Additionally, what is the $TERM value in your environment in tmux on the server?

That's correct:

On SSH
image

On SSH+TMUX
image

SSH+TMUX in

@meowgorithm - Happy to run any diagnostics you'd like. true color works fine in other apps (not based on bubble tea)

edit your ~/.tmux.conf
add
set -g default-terminal "screen-256color"
save file.
restart your tmux.

Oh that fixed it! Hooray. Now I wonder if that messed up something else? This stuff is super fragile :( True Color still works at least!

Can we treat the xterm-256color the same as screen-256color for others?

Hi! I'd file an issue upstream in termenv where this detection takes place. Also note that Bubble Tea actually doesn't manage color, style and layout; would file future issues around this in Lip Gloss.

Sigh, if you screen-256color, that breaks italics. BUT, turns out setting COLORTERM is what iTerm does, and that gives truecolor support.

COLORTERM=truecolor