0

I'm currently having the problem that the colors are not forwarded correctly from nvim through tmux to wezterm. I think tmux is to blame since the colors work like expected when I invoke nvim from wezterm directly. Compare this:

  • This is wezterm -> tmux -> nvim:

    enter image description here

  • And these are the colors when I invoke wezterm -> nvim directly:

    enter image description here

    Here the colors are displayed correctly.

I read on reddit about users having a similar problem, however the solution doesn't work for me. Briefly, the solution suggests adding those two attributes to the .tmux.conf file:

  • .tmux.conf
    # Fix Colors
    set -g default-terminal "screen-256color"
    set -as terminal-features ",xterm-256color:RGB"
    

But when I do that nothing changes. Strangely, also tmux doesn't seem to detect wezterm correctly, I needed to add export TERM=xterm to my .bashrc (I believe TERM should be set by all terminal emulators to inform subshells about their capabilities?). Maybe the issue is related to this.

OS is Ubuntu 20.04/GNOME

2
  • Out of curiosity - what do you need tmux for? I just recently switched to wezterm, and it's completely replaced my (local) need for tmux Commented Jul 18, 2024 at 11:09
  • @Panki exactly, I still need it for my non-local tmux needs :) Commented Jul 18, 2024 at 12:03

1 Answer 1

0

I fixed the issue. The problem was apparently tmux itself.

So when I set TERM=xterm within my .bashrc, this was obviously the wrong thing to do. TERM needs to be set by the terminal-emulator itself. wezterm had already set it to TERM=xterm-256color which would be the right choice. However, when I removed it tmux stopped working and complained with:

open terminal failed: missing or unsuitable terminal: xterm-256color

When I tried tmux -V it showed me tmux master which is odd (because no version number) and I checked with which tmux that I had tmux installed via snapcraft. I then uninstalled it and reinstalled it via apt-get:

sudo snap remove tmux
sudo apt-get install tmux

Now it works flawlessly. I still kept the entries in .tmux.conf though.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.