zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.95k stars 1.17k forks source link

Tmux Colour Schemes Don't Work Properly (Background in particular) #3162

Open ghost opened 7 months ago

ghost commented 7 months ago

Description of the problem or steps to reproduce

Color scheme don't work properly in tmux. An example is the "one-dark" theme. In alacritty without tmux, the background will be the correct bluish grey color. In tmux, it's just a default grey.

I've tried all the fixes I can find online, most of which involve adding a line like: set -g default-terminal "screen-256color" to tmux.conf, with various different values. Non of them seemed to work. The MICRO_TRUECOLOR value is set to 1 in both alacritty and tmux. The issue also occurs in Xfce4-terminal.

The only fix I have found is to set alacritty (not tmux) to TERM="xterm-kitty" (the issue doesn't occur on kitty).

Specifications

Version: 2.0.13 Commit hash: 68d88b57 OS: Arch Compiled on October 22, 2023 Terminal: Alacritty with tmux

ghost commented 6 months ago

For now, I am using this alias in my .bashrc to get around the issue. It sets TERM back to the old value after tmux exits, so it shouldn't interfere with programs ran outside tmux.

alias tmux='oldterm="$TERM"; TERM="xterm-kitty"; tmux; TERM="$oldterm"'