Vim colors not showing correctly in tmux terminal running in rxvt-unicode terminal


Susam Pal

I am using Debian (Jessie).

My ~/.vimrc file contains the following statement.

colorscheme murphy

My ~/.Xresources file contains the following properties.

URxvt.background: #000000
URxvt.foreground: #e0e0e0
URxvt.scrollBar: false
URxvt.borderless: true
URxvt.font:xft:Bitstream Vera Sans Mono:pixelsize=16

When launched in the vimrxvt-unicode terminal ( urxvt) , the expected output is obtained.

Vim running in rxvt-unicode

However, when I start tmuxinside the tmux terminal urxvtand then inside vimthe tmux terminal , the colors are too bright.

Vim running in tmux running in rxvt-unicode

How can I fix this problem?

Susam Pal

The problem occurs because the rxvt-unicode (urxvt) terminal only supports 88 colors, while the tmux terminal supports 256 colors.

Output of urxvt:

susam@nifty:~$ tput colors
88

As a result, when tmux starts, it only uses 8 colors

susam@nifty:~$ tput colors
8

Adding the following tmux commands to ~/.tmux.conf did not help.

set -g default-terminal screen-256color

In that line in ~/.tmux.conf, when tmux starts, it seems that 256 colors are being used.

susam@nifty:~$ tput colors
256

However, this doesn't help because although tmux seems to use 256 colors, the underlying rxvt-unicode (urxvt) terminal doesn't display them correctly since it only supports 88 colors. As a result, Vim still displays colors that are too bright.

Solution: Install the rxvt-unicode-256color package.

A rxvt-unicode-256color package is available in Debian with a urxvt terminal that supports 256 colors. Installing rxvt-unicode-256color solved the problem.

Command I use:

aptitude update
aptitude purge rxvt-unicode
aptitude install rxvt-unicode-256color

The colors look a little different now.

enter image description here

But the experience is consistent with tmux.

enter image description here

Related


Vim colors not showing in tmux

Jordan I have been unable to use vim in tmux for about a week. I keep all my dotfiles in Github (here https://github.com/jordanjones98/dotfiles ), when I have a computer I think it will be a simple git pull, and some other simple setting. When I pull and insta

Vim colors not showing in tmux

Jordan I have been unable to use vim in tmux for about a week. I keep all my dot files in Github (here https://github.com/jordanjones98/dotfiles ), when I have a computer I think it will be a simple git pull, and some other simple setting. When I pull and inst

Vim colors not showing in tmux

Jordan I have been unable to use vim in tmux for about a week. I keep all my dotfiles in Github (here https://github.com/jordanjones98/dotfiles ), when I have a computer I think it will be a simple git pull, and some other simple setting. When I pull and insta

Italics in Emacs on text terminal (rxvt-unicode)

Igor I'm using Emacs running in urxvt and I can't get italics to work in Emacs despite terminal support. Here is my current setup: I haven't set it yet $TERM, so it's the default rxvt-unicode-256color. Mine is ~/.Xdefaultsdefined URxvt.font: xft:Inconsolata:si

Italics in Emacs on text terminal (rxvt-unicode)

Igor I'm using Emacs running in urxvt and I can't get italics to work in Emacs despite terminal support. Here is my current setup: I haven't set it yet $TERM, so it's the default rxvt-unicode-256color. Mine is ~/.Xdefaultsdefined URxvt.font: xft:Inconsolata:si

Vim colors not working properly in terminal

Assis I'm using gnome-terminal and I'm using vim with a solarized color theme. When I open vim in terminal, it's illegible. However, when I open the file in gvim, the color scheme works fine. The Gnome Terminal's color scheme has also been tanned. One thing to

Vim colors not working properly in terminal

Assis I'm using gnome-terminal and I'm using vim with a solarized color theme. When I open vim in terminal, it's illegible. However, when I open the file in gvim, the color scheme works fine. The Gnome Terminal's color scheme has also been tanned. One thing to

Tmux and dimmed colors in Terminal.app on MacOS

Atcold question On my Mac (10.11) Tmux doesn't display -ed colors dimcorrectly , which is causing trouble. In the image below, the name of the author of the submission should be indicated with dim white. This works fine in Terminal.app but not in Tmux . Does a

TMUX and terminal colors are not the same locally and on ssh

alpha1554 I have a bunch of dotfiles that allow me to have a nice theme on terminal and tmux on localhost. I use cat, fish and tamarisk. In order to define the colors correctly and have global consistency, I use the following files: .Xresoures kitty.conf fish_

Tmux and dimmed colors in Terminal.app on MacOS

Atcold question On my Mac (10.11) Tmux doesn't display -ed colors dimcorrectly , which is causing trouble. In the image below, the name of the author of the submission should be indicated with dim white. This works fine in Terminal.app but not in Tmux . Does a

PHP session not showing correctly in terminal

Zoric I'm currently building a small script for a cron job, I'm testing everything in the terminal (Linux), but I can't figure out why the session isn't working. session_start() $_SESSION['cron'] = 'test'; echo $_SESSION['cron']; Zoric Here is my solution pri

Scroll to terminal while Vim is running

Mehdi Nellen When I open vim in some terminal (like on a Mac) and scroll with the mouse, I am able to see the terminal output again. If my terminal window looks like this: user@pc$ "I'm gonna start vim" user@pc$ "after this line" user@pc$ vim If I scroll up

Scroll to terminal while Vim is running

Mehdi Nellen When I open vim in some terminal (like on a Mac) and scroll with the mouse, I am able to see the terminal output again. If my terminal window looks like this: user@pc$ "I'm gonna start vim" user@pc$ "after this line" user@pc$ vim If I scroll up

In vim, terminal and iterm have different syntax colors

Yura I am new to vim setting T__T. On the left is the terminal display. On the right is the iterm2 display. How to change color in terminal like in iterm2 Thanks in advance. Paul Pei Some vim color schemes (including defaults) will use the terminal's palette a

Make Vim use terminal colors again

justice I use Xfce4 and its terminal seems to have been upgraded and now supports 256 colors or true color (I'm not sure). These seem to be the relevant variables it exports: COLORTERM=truecolor TERM=xterm-256color One of the unexpected changes it caused was

In vim, terminal and iterm have different syntax colors

Yura I am new to vim setting T__T. On the left is the terminal display. On the right is the iterm2 display. How to change color in terminal like in iterm2 Thanks in advance. Paul Pei Some vim color schemes (including defaults) will use the terminal's palette a

ls system command not showing terminal colors

username I just fiddled with some code in C, an example of a really basic program is shown below, which apparently uses the ls system command to list the directories. #include <stdio.h> int main (void) { system("ls -l -d */"); printf("I've just listed

ls system command not showing terminal colors

username I just fiddled with some code in C, an example of a really basic program is shown below, which apparently uses the ls system command to list the directories. #include <stdio.h> int main (void) { system("ls -l -d */"); printf("I've just listed

Running a tmux session in a tilix terminal emulator

Grandmaster Background : I use Tilix as my main terminal emulator. In the Tilix preferences (screenshot attached), I set it up so that when I start Tilix it will run the following command: /usr/bin/zsh -c "if [[ $(tmux ls 2>/dev/null | grep -q -E '^main.*attac

Mouse not working correctly when running vim in tmux

daisy I am running vim in tmux, When I try to select a text range in VIM, the mouse keeps resetting its position so I can only select one line (the last line where the mouse happens). Does anyone know how to solve this problem? Jason Voyan You need to configur

Mouse not working correctly when running vim in tmux

daisy I am running vim in tmux, When I try to select a text range in VIM, the mouse keeps resetting its position so I can only select one line (the last line where the mouse happens). Does anyone know how to solve this problem? Jason Voyan You need to configur

Mouse not working correctly when running vim in tmux

daisy I am running vim in tmux, When I try to select a text range in VIM, the mouse keeps resetting its position so I can only select one line (the last line where the mouse happens). Does anyone know how to solve this problem? Jason Voyan You need to configur

Unicode characters not printing correctly in terminal python

Gulib 94 I wrote a very simple program that tells me the unicode value of certain characters. Here is the program: #!/usr/bin/env python3 # -*- coding: utf-8 -*- characters = [u'T', u'ב', u'€', u'木', u'♥'] for character in characters: print(character +

Unicode characters not printing correctly in terminal python

Gulib 94 I wrote a very simple program that tells me the unicode value of certain characters. Here is the program: #!/usr/bin/env python3 # -*- coding: utf-8 -*- characters = [u'T', u'ב', u'€', u'木', u'♥'] for character in characters: print(character +

Unicode characters not printing correctly in terminal python

Gulib 94 I wrote a very simple program that tells me the unicode value of certain characters. Here is the program: #!/usr/bin/env python3 # -*- coding: utf-8 -*- characters = [u'T', u'ב', u'€', u'木', u'♥'] for character in characters: print(character +

Unicode characters not printing correctly in terminal python

Gulib 94 I wrote a very simple program that tells me the unicode value of certain characters. Here is the program: #!/usr/bin/env python3 # -*- coding: utf-8 -*- characters = [u'T', u'ב', u'€', u'木', u'♥'] for character in characters: print(character +