Vim in tmux display wrong colorsGnome-Terminal reports $TERM to be `xterm`Vim does not load colorscheme from...

Can we "borrow" our answers to populate our own websites?

Why is the size of a directory either 0 or 4096?

Does a paladin have to announce that they're using Divine Smite before attacking?

Is there a way to not have to poll the UART of an AVR?

Why is a temp table a more efficient solution to the Halloween Problem than an eager spool?

Boss asked me to sign a resignation paper without a date on it along with my new contract

How is it possible that the folder is there yet isnt in the same time?

How do you funnel food off a cutting board?

Which RAF squadrons and aircraft types took part in the bombing of Berlin on the 25th of August 1940?

What can I do to encourage my players to use their consumables?

Does an Eldritch Knight's Weapon Bond protect him from losing his weapon to a Telekinesis spell?

After checking in online, how do I know whether I need to go show my passport at airport check-in?

How do you get out of your own psychology to write characters?

Current across a wire with zero potential difference

Potential client has a problematic employee I can't work with

Subsurf on a crown. How can I smooth some edges and keep others sharp?

Does it take energy to move something in a circle?

What game did these black and yellow dice come from?

Does diversity provide anything that meritocracy does not?

The No-Straight Maze

If angels and devils are the same species, why would their mortal offspring appear physically different?

How do I prevent a homebrew Grappling Hook feature from trivializing Tomb of Annihilation?

How vim overwrites readonly mode?

What is the industry term for house wiring diagrams?



Vim in tmux display wrong colors


Gnome-Terminal reports $TERM to be `xterm`Vim does not load colorscheme from .vimrc when started from tmuxunicode characters do not appear in gnome terminal for vim airlineVIM in gnome-terminal keeps printing weird 001B characterCan't copy from vim to clipboard inside tmuxvim theme showing up strange in tmuxVim shortcuts won't work in tmuxvim `set nocompatible` not work in tmuxvim combine with tmuxTmux Colors Not WorkingTerminal in Tmux is 256 color but Vim isn't













51















I installed Ubuntu 11.10. Then downloaded Solarized theme for Gnome Terminal. From terminal my vim looks good: plugin vim-powerline displays correctly and syntax is highlighted with proper colors. But when I run tmux and there run vim - syntax highlight uses only one basic color and vim-powerline displays no colors. I looked at the FAQ on vim-powerline and solution should be this line in .tmux-config:



set -g default-terminal "screen-256color"


But it doesn't work. I looked at TERM and it's return 'xterm' so I tried:



set -g default-terminal "xterm-256color"


But this also dosen't help.



This is the only line in .tmux.config. In .vimrc I have following lines:



call pathogen#infect()
set nocompatible
set encoding=utf-8
set laststatus=2
let g:Powerline_symbols = 'fancy'
set t_Co=256
syntax enable
set background=dark
colorsheme solarized









share|improve this question























  • No idea why you got no upvotes, not even from those who must have benefited by getting upvotes from their own answers. +1 from me. The question is sound and it helped me solve my own problem, too, by finding it.

    – 0xC0000022L
    Jan 21 '13 at 16:09
















51















I installed Ubuntu 11.10. Then downloaded Solarized theme for Gnome Terminal. From terminal my vim looks good: plugin vim-powerline displays correctly and syntax is highlighted with proper colors. But when I run tmux and there run vim - syntax highlight uses only one basic color and vim-powerline displays no colors. I looked at the FAQ on vim-powerline and solution should be this line in .tmux-config:



set -g default-terminal "screen-256color"


But it doesn't work. I looked at TERM and it's return 'xterm' so I tried:



set -g default-terminal "xterm-256color"


But this also dosen't help.



This is the only line in .tmux.config. In .vimrc I have following lines:



call pathogen#infect()
set nocompatible
set encoding=utf-8
set laststatus=2
let g:Powerline_symbols = 'fancy'
set t_Co=256
syntax enable
set background=dark
colorsheme solarized









share|improve this question























  • No idea why you got no upvotes, not even from those who must have benefited by getting upvotes from their own answers. +1 from me. The question is sound and it helped me solve my own problem, too, by finding it.

    – 0xC0000022L
    Jan 21 '13 at 16:09














51












51








51


15






I installed Ubuntu 11.10. Then downloaded Solarized theme for Gnome Terminal. From terminal my vim looks good: plugin vim-powerline displays correctly and syntax is highlighted with proper colors. But when I run tmux and there run vim - syntax highlight uses only one basic color and vim-powerline displays no colors. I looked at the FAQ on vim-powerline and solution should be this line in .tmux-config:



set -g default-terminal "screen-256color"


But it doesn't work. I looked at TERM and it's return 'xterm' so I tried:



set -g default-terminal "xterm-256color"


But this also dosen't help.



This is the only line in .tmux.config. In .vimrc I have following lines:



call pathogen#infect()
set nocompatible
set encoding=utf-8
set laststatus=2
let g:Powerline_symbols = 'fancy'
set t_Co=256
syntax enable
set background=dark
colorsheme solarized









share|improve this question














I installed Ubuntu 11.10. Then downloaded Solarized theme for Gnome Terminal. From terminal my vim looks good: plugin vim-powerline displays correctly and syntax is highlighted with proper colors. But when I run tmux and there run vim - syntax highlight uses only one basic color and vim-powerline displays no colors. I looked at the FAQ on vim-powerline and solution should be this line in .tmux-config:



set -g default-terminal "screen-256color"


But it doesn't work. I looked at TERM and it's return 'xterm' so I tried:



set -g default-terminal "xterm-256color"


But this also dosen't help.



This is the only line in .tmux.config. In .vimrc I have following lines:



call pathogen#infect()
set nocompatible
set encoding=utf-8
set laststatus=2
let g:Powerline_symbols = 'fancy'
set t_Co=256
syntax enable
set background=dark
colorsheme solarized






vim tmux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Apr 26 '12 at 18:36









dhuCerbindhuCerbin

356133




356133













  • No idea why you got no upvotes, not even from those who must have benefited by getting upvotes from their own answers. +1 from me. The question is sound and it helped me solve my own problem, too, by finding it.

    – 0xC0000022L
    Jan 21 '13 at 16:09



















  • No idea why you got no upvotes, not even from those who must have benefited by getting upvotes from their own answers. +1 from me. The question is sound and it helped me solve my own problem, too, by finding it.

    – 0xC0000022L
    Jan 21 '13 at 16:09

















No idea why you got no upvotes, not even from those who must have benefited by getting upvotes from their own answers. +1 from me. The question is sound and it helped me solve my own problem, too, by finding it.

– 0xC0000022L
Jan 21 '13 at 16:09





No idea why you got no upvotes, not even from those who must have benefited by getting upvotes from their own answers. +1 from me. The question is sound and it helped me solve my own problem, too, by finding it.

– 0xC0000022L
Jan 21 '13 at 16:09










11 Answers
11






active

oldest

votes


















51














Starting tmux with the following flag fixes this for me:



tmux -2


from tmux man page:



-2 Force tmux to assume the terminal supports 256 colours.






share|improve this answer
























  • Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

    – grantbow
    Jun 20 '15 at 3:56











  • FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

    – Plasty Grove
    Apr 24 '17 at 5:20



















27














I am having the same problem on Ubuntu 10.04 LTS using Byobu 5.17 & tmux 1.5 using the latest Solarized from the GitHub repo.



I was able to partially fix this by specifying $TERM in the .bashrc file:



export TERM="xterm-256color"



It seems, also, that there is a bug filed on launchpad, but it is not yet resolved:
byobu not displaying dircolors properly






share|improve this answer





















  • 2





    This is the only thing that worked for me!

    – Tranquille
    Jan 28 '16 at 23:37











  • Also worked on Ubuntu 14.04 with tmux 2.0

    – dukedave
    Mar 16 '16 at 23:14











  • This is the solution on OS X as well haha

    – Jay
    Jun 21 '16 at 23:49



















22














this worked for me



in .tmux.conf



set -g default-terminal "screen-256color"


in .vimrc



set term=screen-256color


remove old term value for .vimrc,
believe me this will work






share|improve this answer





















  • 1





    Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

    – fstang
    Sep 12 '16 at 3:10






  • 1





    It worked for me without .vimrc settings, only .tmux.conf.

    – Geison Santos
    Dec 24 '16 at 20:31













  • the vim one did the trick, thanks!

    – Julio Marins
    Feb 1 '18 at 5:17











  • The .tmux.conf setting did the trick for me!

    – hesselbom
    Nov 7 '18 at 13:43



















4














Terminal type should be set to screen-256color in ~/.tmux.conf. It tells tmux what to set the TERM evironment variable, so it won't work for the current session - start a new one and test then.



If it still doesn't work, you can run Vim using:



TERM=screen-256color vi


This sets the environment variable just for a one-off vi execution.



If that doesn't make vim display all the colours, test if your terminal (I'm not sure if you're testing with just one terminal emulator) is compiled to support the 256 colour palette - download and run the below Perl script from the terminal emulator in question.



http://scie.nti.st/dist/256colors2.pl



PS. I assume you've already corrected the typo jordanbrock noticed.






share|improve this answer

































    2














    As explained by Marcin Kaminski, if TERM=screen-256color vim works for you then just add following to your .bashrc

    TERM=screen-256color
    and following in your .tmux.conf
    set -g default-terminal "screen-256color"



    I had the same problemd, this works for me.






    share|improve this answer
























    • This was the only one that worked for me (tmux 1.8).

      – Yamaneko
      Sep 13 '16 at 23:04











    • Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

      – Yamaneko
      Sep 13 '16 at 23:18



















    1














    There's a typo in the last line of your .vimrc.



    It should be colorscheme solarized



    Not sure if that helps :)






    share|improve this answer

































      0














      You may be having the same problem documented in this answer.



      Basically, .tmux.conf setting works, and TERM is set to screen-256color, but then tmux opens bash and calls your .bashrc, which sets TERM to something else (perhaps xterm-256color).



      The solution is to set TERM in your terminal settings rather than in .bashrc. If that's not an option, you can check TERMinside .bashrc and not change it if it's already screen-256color.






      share|improve this answer

































        0














        In the shell starting tmux, check that $TERM is either xterm-256color or screen-256color. See how to change $TERM:




        • Usually change ~/.Xresources is the best way (if supported)

        • For gnome-terminal see https://askubuntu.com/a/379472


        As an alternative, as Holy Mackerel said, you can force tmux to 256color via:



        $ tmux -2





        share|improve this answer

































          0














          [Solucion][1]
          that may disturb your vision and make Vim unpleasant to use for an extended period of time.



          You can fix this by running :set term=screen-256color in Vim or by relaunching Vim under the TERM=screen-256color environment, as some experts recommend: http://sunaku.github.io/vim-256color-bce.html






          share|improve this answer



















          • 2





            What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

            – Eliah Kagan
            Aug 11 '14 at 15:32



















          0














          In your .bashrc or .zshrc just add



          if [[ $TERM == xterm ]]; then
          TERM=xterm-256color
          fi


          and also start with the tmux -2






          share|improve this answer

































            0














            For those, who is consuming time on colors, and if solarized vim doesn’t work on tmux,
            or tired of finding colors of vim,
            this should work in a minute, also it is from the official repository.



            yum vim-jellybeans


            or



            mkdir -p ~/.vim/colors
            cd ~/.vim/colors
            curl -O https://raw.githubusercontent.com/nanotech/jellybeans.vim/master/colors/jellybeans.vim
            sed -i '/colorscheme/d' ~/.vimrc
            echo colorscheme jellybeans >> ~/.vimrc


            I’m not sure if you must use solarized, or you are having an issue with invisible characters in vim, then this will fix it with the beautiful color set and patterns are so focused and useful, if you are also tried to set those highlight, search words, this is it. everything has already set to use.






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f125526%2fvim-in-tmux-display-wrong-colors%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              11 Answers
              11






              active

              oldest

              votes








              11 Answers
              11






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              51














              Starting tmux with the following flag fixes this for me:



              tmux -2


              from tmux man page:



              -2 Force tmux to assume the terminal supports 256 colours.






              share|improve this answer
























              • Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

                – grantbow
                Jun 20 '15 at 3:56











              • FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

                – Plasty Grove
                Apr 24 '17 at 5:20
















              51














              Starting tmux with the following flag fixes this for me:



              tmux -2


              from tmux man page:



              -2 Force tmux to assume the terminal supports 256 colours.






              share|improve this answer
























              • Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

                – grantbow
                Jun 20 '15 at 3:56











              • FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

                – Plasty Grove
                Apr 24 '17 at 5:20














              51












              51








              51







              Starting tmux with the following flag fixes this for me:



              tmux -2


              from tmux man page:



              -2 Force tmux to assume the terminal supports 256 colours.






              share|improve this answer













              Starting tmux with the following flag fixes this for me:



              tmux -2


              from tmux man page:



              -2 Force tmux to assume the terminal supports 256 colours.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 27 '13 at 3:49









              Holy MackerelHoly Mackerel

              75567




              75567













              • Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

                – grantbow
                Jun 20 '15 at 3:56











              • FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

                – Plasty Grove
                Apr 24 '17 at 5:20



















              • Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

                – grantbow
                Jun 20 '15 at 3:56











              • FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

                – Plasty Grove
                Apr 24 '17 at 5:20

















              Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

              – grantbow
              Jun 20 '15 at 3:56





              Good hint. When the Cygwin version of screen started to crash vim I switched back to tmux again very quickly. Love it.

              – grantbow
              Jun 20 '15 at 3:56













              FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

              – Plasty Grove
              Apr 24 '17 at 5:20





              FYI - This was the only thing that worked for me with tmux 2.3 and the latest powerline. Colors in vim and tmux status bar were really weird.

              – Plasty Grove
              Apr 24 '17 at 5:20













              27














              I am having the same problem on Ubuntu 10.04 LTS using Byobu 5.17 & tmux 1.5 using the latest Solarized from the GitHub repo.



              I was able to partially fix this by specifying $TERM in the .bashrc file:



              export TERM="xterm-256color"



              It seems, also, that there is a bug filed on launchpad, but it is not yet resolved:
              byobu not displaying dircolors properly






              share|improve this answer





















              • 2





                This is the only thing that worked for me!

                – Tranquille
                Jan 28 '16 at 23:37











              • Also worked on Ubuntu 14.04 with tmux 2.0

                – dukedave
                Mar 16 '16 at 23:14











              • This is the solution on OS X as well haha

                – Jay
                Jun 21 '16 at 23:49
















              27














              I am having the same problem on Ubuntu 10.04 LTS using Byobu 5.17 & tmux 1.5 using the latest Solarized from the GitHub repo.



              I was able to partially fix this by specifying $TERM in the .bashrc file:



              export TERM="xterm-256color"



              It seems, also, that there is a bug filed on launchpad, but it is not yet resolved:
              byobu not displaying dircolors properly






              share|improve this answer





















              • 2





                This is the only thing that worked for me!

                – Tranquille
                Jan 28 '16 at 23:37











              • Also worked on Ubuntu 14.04 with tmux 2.0

                – dukedave
                Mar 16 '16 at 23:14











              • This is the solution on OS X as well haha

                – Jay
                Jun 21 '16 at 23:49














              27












              27








              27







              I am having the same problem on Ubuntu 10.04 LTS using Byobu 5.17 & tmux 1.5 using the latest Solarized from the GitHub repo.



              I was able to partially fix this by specifying $TERM in the .bashrc file:



              export TERM="xterm-256color"



              It seems, also, that there is a bug filed on launchpad, but it is not yet resolved:
              byobu not displaying dircolors properly






              share|improve this answer















              I am having the same problem on Ubuntu 10.04 LTS using Byobu 5.17 & tmux 1.5 using the latest Solarized from the GitHub repo.



              I was able to partially fix this by specifying $TERM in the .bashrc file:



              export TERM="xterm-256color"



              It seems, also, that there is a bug filed on launchpad, but it is not yet resolved:
              byobu not displaying dircolors properly







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited May 8 '12 at 8:43

























              answered May 8 '12 at 5:35









              RaminoidRaminoid

              41836




              41836








              • 2





                This is the only thing that worked for me!

                – Tranquille
                Jan 28 '16 at 23:37











              • Also worked on Ubuntu 14.04 with tmux 2.0

                – dukedave
                Mar 16 '16 at 23:14











              • This is the solution on OS X as well haha

                – Jay
                Jun 21 '16 at 23:49














              • 2





                This is the only thing that worked for me!

                – Tranquille
                Jan 28 '16 at 23:37











              • Also worked on Ubuntu 14.04 with tmux 2.0

                – dukedave
                Mar 16 '16 at 23:14











              • This is the solution on OS X as well haha

                – Jay
                Jun 21 '16 at 23:49








              2




              2





              This is the only thing that worked for me!

              – Tranquille
              Jan 28 '16 at 23:37





              This is the only thing that worked for me!

              – Tranquille
              Jan 28 '16 at 23:37













              Also worked on Ubuntu 14.04 with tmux 2.0

              – dukedave
              Mar 16 '16 at 23:14





              Also worked on Ubuntu 14.04 with tmux 2.0

              – dukedave
              Mar 16 '16 at 23:14













              This is the solution on OS X as well haha

              – Jay
              Jun 21 '16 at 23:49





              This is the solution on OS X as well haha

              – Jay
              Jun 21 '16 at 23:49











              22














              this worked for me



              in .tmux.conf



              set -g default-terminal "screen-256color"


              in .vimrc



              set term=screen-256color


              remove old term value for .vimrc,
              believe me this will work






              share|improve this answer





















              • 1





                Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

                – fstang
                Sep 12 '16 at 3:10






              • 1





                It worked for me without .vimrc settings, only .tmux.conf.

                – Geison Santos
                Dec 24 '16 at 20:31













              • the vim one did the trick, thanks!

                – Julio Marins
                Feb 1 '18 at 5:17











              • The .tmux.conf setting did the trick for me!

                – hesselbom
                Nov 7 '18 at 13:43
















              22














              this worked for me



              in .tmux.conf



              set -g default-terminal "screen-256color"


              in .vimrc



              set term=screen-256color


              remove old term value for .vimrc,
              believe me this will work






              share|improve this answer





















              • 1





                Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

                – fstang
                Sep 12 '16 at 3:10






              • 1





                It worked for me without .vimrc settings, only .tmux.conf.

                – Geison Santos
                Dec 24 '16 at 20:31













              • the vim one did the trick, thanks!

                – Julio Marins
                Feb 1 '18 at 5:17











              • The .tmux.conf setting did the trick for me!

                – hesselbom
                Nov 7 '18 at 13:43














              22












              22








              22







              this worked for me



              in .tmux.conf



              set -g default-terminal "screen-256color"


              in .vimrc



              set term=screen-256color


              remove old term value for .vimrc,
              believe me this will work






              share|improve this answer















              this worked for me



              in .tmux.conf



              set -g default-terminal "screen-256color"


              in .vimrc



              set term=screen-256color


              remove old term value for .vimrc,
              believe me this will work







              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Dec 7 '14 at 20:18









              guntbert

              9,291133170




              9,291133170










              answered Dec 7 '14 at 7:03









              kiran pskiran ps

              22122




              22122








              • 1





                Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

                – fstang
                Sep 12 '16 at 3:10






              • 1





                It worked for me without .vimrc settings, only .tmux.conf.

                – Geison Santos
                Dec 24 '16 at 20:31













              • the vim one did the trick, thanks!

                – Julio Marins
                Feb 1 '18 at 5:17











              • The .tmux.conf setting did the trick for me!

                – hesselbom
                Nov 7 '18 at 13:43














              • 1





                Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

                – fstang
                Sep 12 '16 at 3:10






              • 1





                It worked for me without .vimrc settings, only .tmux.conf.

                – Geison Santos
                Dec 24 '16 at 20:31













              • the vim one did the trick, thanks!

                – Julio Marins
                Feb 1 '18 at 5:17











              • The .tmux.conf setting did the trick for me!

                – hesselbom
                Nov 7 '18 at 13:43








              1




              1





              Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

              – fstang
              Sep 12 '16 at 3:10





              Doesn't work for me. tmux 1.8, vim 7.4.1816, ubuntu x86_64 with kernel 3.13.0-92-generic. FYI.

              – fstang
              Sep 12 '16 at 3:10




              1




              1





              It worked for me without .vimrc settings, only .tmux.conf.

              – Geison Santos
              Dec 24 '16 at 20:31







              It worked for me without .vimrc settings, only .tmux.conf.

              – Geison Santos
              Dec 24 '16 at 20:31















              the vim one did the trick, thanks!

              – Julio Marins
              Feb 1 '18 at 5:17





              the vim one did the trick, thanks!

              – Julio Marins
              Feb 1 '18 at 5:17













              The .tmux.conf setting did the trick for me!

              – hesselbom
              Nov 7 '18 at 13:43





              The .tmux.conf setting did the trick for me!

              – hesselbom
              Nov 7 '18 at 13:43











              4














              Terminal type should be set to screen-256color in ~/.tmux.conf. It tells tmux what to set the TERM evironment variable, so it won't work for the current session - start a new one and test then.



              If it still doesn't work, you can run Vim using:



              TERM=screen-256color vi


              This sets the environment variable just for a one-off vi execution.



              If that doesn't make vim display all the colours, test if your terminal (I'm not sure if you're testing with just one terminal emulator) is compiled to support the 256 colour palette - download and run the below Perl script from the terminal emulator in question.



              http://scie.nti.st/dist/256colors2.pl



              PS. I assume you've already corrected the typo jordanbrock noticed.






              share|improve this answer






























                4














                Terminal type should be set to screen-256color in ~/.tmux.conf. It tells tmux what to set the TERM evironment variable, so it won't work for the current session - start a new one and test then.



                If it still doesn't work, you can run Vim using:



                TERM=screen-256color vi


                This sets the environment variable just for a one-off vi execution.



                If that doesn't make vim display all the colours, test if your terminal (I'm not sure if you're testing with just one terminal emulator) is compiled to support the 256 colour palette - download and run the below Perl script from the terminal emulator in question.



                http://scie.nti.st/dist/256colors2.pl



                PS. I assume you've already corrected the typo jordanbrock noticed.






                share|improve this answer




























                  4












                  4








                  4







                  Terminal type should be set to screen-256color in ~/.tmux.conf. It tells tmux what to set the TERM evironment variable, so it won't work for the current session - start a new one and test then.



                  If it still doesn't work, you can run Vim using:



                  TERM=screen-256color vi


                  This sets the environment variable just for a one-off vi execution.



                  If that doesn't make vim display all the colours, test if your terminal (I'm not sure if you're testing with just one terminal emulator) is compiled to support the 256 colour palette - download and run the below Perl script from the terminal emulator in question.



                  http://scie.nti.st/dist/256colors2.pl



                  PS. I assume you've already corrected the typo jordanbrock noticed.






                  share|improve this answer















                  Terminal type should be set to screen-256color in ~/.tmux.conf. It tells tmux what to set the TERM evironment variable, so it won't work for the current session - start a new one and test then.



                  If it still doesn't work, you can run Vim using:



                  TERM=screen-256color vi


                  This sets the environment variable just for a one-off vi execution.



                  If that doesn't make vim display all the colours, test if your terminal (I'm not sure if you're testing with just one terminal emulator) is compiled to support the 256 colour palette - download and run the below Perl script from the terminal emulator in question.



                  http://scie.nti.st/dist/256colors2.pl



                  PS. I assume you've already corrected the typo jordanbrock noticed.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Oct 10 '16 at 14:37









                  nowox

                  1287




                  1287










                  answered Oct 16 '12 at 20:01









                  Marcin KaminskiMarcin Kaminski

                  4,3661634




                  4,3661634























                      2














                      As explained by Marcin Kaminski, if TERM=screen-256color vim works for you then just add following to your .bashrc

                      TERM=screen-256color
                      and following in your .tmux.conf
                      set -g default-terminal "screen-256color"



                      I had the same problemd, this works for me.






                      share|improve this answer
























                      • This was the only one that worked for me (tmux 1.8).

                        – Yamaneko
                        Sep 13 '16 at 23:04











                      • Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

                        – Yamaneko
                        Sep 13 '16 at 23:18
















                      2














                      As explained by Marcin Kaminski, if TERM=screen-256color vim works for you then just add following to your .bashrc

                      TERM=screen-256color
                      and following in your .tmux.conf
                      set -g default-terminal "screen-256color"



                      I had the same problemd, this works for me.






                      share|improve this answer
























                      • This was the only one that worked for me (tmux 1.8).

                        – Yamaneko
                        Sep 13 '16 at 23:04











                      • Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

                        – Yamaneko
                        Sep 13 '16 at 23:18














                      2












                      2








                      2







                      As explained by Marcin Kaminski, if TERM=screen-256color vim works for you then just add following to your .bashrc

                      TERM=screen-256color
                      and following in your .tmux.conf
                      set -g default-terminal "screen-256color"



                      I had the same problemd, this works for me.






                      share|improve this answer













                      As explained by Marcin Kaminski, if TERM=screen-256color vim works for you then just add following to your .bashrc

                      TERM=screen-256color
                      and following in your .tmux.conf
                      set -g default-terminal "screen-256color"



                      I had the same problemd, this works for me.







                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Mar 27 '15 at 3:16









                      user3908054user3908054

                      211




                      211













                      • This was the only one that worked for me (tmux 1.8).

                        – Yamaneko
                        Sep 13 '16 at 23:04











                      • Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

                        – Yamaneko
                        Sep 13 '16 at 23:18



















                      • This was the only one that worked for me (tmux 1.8).

                        – Yamaneko
                        Sep 13 '16 at 23:04











                      • Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

                        – Yamaneko
                        Sep 13 '16 at 23:18

















                      This was the only one that worked for me (tmux 1.8).

                      – Yamaneko
                      Sep 13 '16 at 23:04





                      This was the only one that worked for me (tmux 1.8).

                      – Yamaneko
                      Sep 13 '16 at 23:04













                      Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

                      – Yamaneko
                      Sep 13 '16 at 23:18





                      Actually, I just tested, and only changing TERM=screen-256color was enough for me, independently of setting tmux to screen-256color or to xterm-256color. Thank you!

                      – Yamaneko
                      Sep 13 '16 at 23:18











                      1














                      There's a typo in the last line of your .vimrc.



                      It should be colorscheme solarized



                      Not sure if that helps :)






                      share|improve this answer






























                        1














                        There's a typo in the last line of your .vimrc.



                        It should be colorscheme solarized



                        Not sure if that helps :)






                        share|improve this answer




























                          1












                          1








                          1







                          There's a typo in the last line of your .vimrc.



                          It should be colorscheme solarized



                          Not sure if that helps :)






                          share|improve this answer















                          There's a typo in the last line of your .vimrc.



                          It should be colorscheme solarized



                          Not sure if that helps :)







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Aug 22 '12 at 10:23









                          Eliah Kagan

                          82.4k22227368




                          82.4k22227368










                          answered Apr 29 '12 at 1:43









                          jordanbrockjordanbrock

                          111




                          111























                              0














                              You may be having the same problem documented in this answer.



                              Basically, .tmux.conf setting works, and TERM is set to screen-256color, but then tmux opens bash and calls your .bashrc, which sets TERM to something else (perhaps xterm-256color).



                              The solution is to set TERM in your terminal settings rather than in .bashrc. If that's not an option, you can check TERMinside .bashrc and not change it if it's already screen-256color.






                              share|improve this answer






























                                0














                                You may be having the same problem documented in this answer.



                                Basically, .tmux.conf setting works, and TERM is set to screen-256color, but then tmux opens bash and calls your .bashrc, which sets TERM to something else (perhaps xterm-256color).



                                The solution is to set TERM in your terminal settings rather than in .bashrc. If that's not an option, you can check TERMinside .bashrc and not change it if it's already screen-256color.






                                share|improve this answer




























                                  0












                                  0








                                  0







                                  You may be having the same problem documented in this answer.



                                  Basically, .tmux.conf setting works, and TERM is set to screen-256color, but then tmux opens bash and calls your .bashrc, which sets TERM to something else (perhaps xterm-256color).



                                  The solution is to set TERM in your terminal settings rather than in .bashrc. If that's not an option, you can check TERMinside .bashrc and not change it if it's already screen-256color.






                                  share|improve this answer















                                  You may be having the same problem documented in this answer.



                                  Basically, .tmux.conf setting works, and TERM is set to screen-256color, but then tmux opens bash and calls your .bashrc, which sets TERM to something else (perhaps xterm-256color).



                                  The solution is to set TERM in your terminal settings rather than in .bashrc. If that's not an option, you can check TERMinside .bashrc and not change it if it's already screen-256color.







                                  share|improve this answer














                                  share|improve this answer



                                  share|improve this answer








                                  edited Mar 20 '17 at 10:18









                                  Community

                                  1




                                  1










                                  answered Feb 27 '14 at 1:16









                                  jtpereydajtpereyda

                                  9382917




                                  9382917























                                      0














                                      In the shell starting tmux, check that $TERM is either xterm-256color or screen-256color. See how to change $TERM:




                                      • Usually change ~/.Xresources is the best way (if supported)

                                      • For gnome-terminal see https://askubuntu.com/a/379472


                                      As an alternative, as Holy Mackerel said, you can force tmux to 256color via:



                                      $ tmux -2





                                      share|improve this answer






























                                        0














                                        In the shell starting tmux, check that $TERM is either xterm-256color or screen-256color. See how to change $TERM:




                                        • Usually change ~/.Xresources is the best way (if supported)

                                        • For gnome-terminal see https://askubuntu.com/a/379472


                                        As an alternative, as Holy Mackerel said, you can force tmux to 256color via:



                                        $ tmux -2





                                        share|improve this answer




























                                          0












                                          0








                                          0







                                          In the shell starting tmux, check that $TERM is either xterm-256color or screen-256color. See how to change $TERM:




                                          • Usually change ~/.Xresources is the best way (if supported)

                                          • For gnome-terminal see https://askubuntu.com/a/379472


                                          As an alternative, as Holy Mackerel said, you can force tmux to 256color via:



                                          $ tmux -2





                                          share|improve this answer















                                          In the shell starting tmux, check that $TERM is either xterm-256color or screen-256color. See how to change $TERM:




                                          • Usually change ~/.Xresources is the best way (if supported)

                                          • For gnome-terminal see https://askubuntu.com/a/379472


                                          As an alternative, as Holy Mackerel said, you can force tmux to 256color via:



                                          $ tmux -2






                                          share|improve this answer














                                          share|improve this answer



                                          share|improve this answer








                                          edited Apr 13 '17 at 12:23









                                          Community

                                          1




                                          1










                                          answered Apr 1 '14 at 14:11









                                          WernightWernight

                                          90588




                                          90588























                                              0














                                              [Solucion][1]
                                              that may disturb your vision and make Vim unpleasant to use for an extended period of time.



                                              You can fix this by running :set term=screen-256color in Vim or by relaunching Vim under the TERM=screen-256color environment, as some experts recommend: http://sunaku.github.io/vim-256color-bce.html






                                              share|improve this answer



















                                              • 2





                                                What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

                                                – Eliah Kagan
                                                Aug 11 '14 at 15:32
















                                              0














                                              [Solucion][1]
                                              that may disturb your vision and make Vim unpleasant to use for an extended period of time.



                                              You can fix this by running :set term=screen-256color in Vim or by relaunching Vim under the TERM=screen-256color environment, as some experts recommend: http://sunaku.github.io/vim-256color-bce.html






                                              share|improve this answer



















                                              • 2





                                                What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

                                                – Eliah Kagan
                                                Aug 11 '14 at 15:32














                                              0












                                              0








                                              0







                                              [Solucion][1]
                                              that may disturb your vision and make Vim unpleasant to use for an extended period of time.



                                              You can fix this by running :set term=screen-256color in Vim or by relaunching Vim under the TERM=screen-256color environment, as some experts recommend: http://sunaku.github.io/vim-256color-bce.html






                                              share|improve this answer













                                              [Solucion][1]
                                              that may disturb your vision and make Vim unpleasant to use for an extended period of time.



                                              You can fix this by running :set term=screen-256color in Vim or by relaunching Vim under the TERM=screen-256color environment, as some experts recommend: http://sunaku.github.io/vim-256color-bce.html







                                              share|improve this answer












                                              share|improve this answer



                                              share|improve this answer










                                              answered Aug 11 '14 at 14:56









                                              JEnriquePsJEnriquePs

                                              1




                                              1








                                              • 2





                                                What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

                                                – Eliah Kagan
                                                Aug 11 '14 at 15:32














                                              • 2





                                                What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

                                                – Eliah Kagan
                                                Aug 11 '14 at 15:32








                                              2




                                              2





                                              What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

                                              – Eliah Kagan
                                              Aug 11 '14 at 15:32





                                              What do you mean by [Solucion][1]? Were you trying to refer or link to another answer? Answers don't always appear in the same order. I recommend expanding this to clarify what you're saying may "disturb your vision and make Vim unpleasant to use for an extended period of time."

                                              – Eliah Kagan
                                              Aug 11 '14 at 15:32











                                              0














                                              In your .bashrc or .zshrc just add



                                              if [[ $TERM == xterm ]]; then
                                              TERM=xterm-256color
                                              fi


                                              and also start with the tmux -2






                                              share|improve this answer






























                                                0














                                                In your .bashrc or .zshrc just add



                                                if [[ $TERM == xterm ]]; then
                                                TERM=xterm-256color
                                                fi


                                                and also start with the tmux -2






                                                share|improve this answer




























                                                  0












                                                  0








                                                  0







                                                  In your .bashrc or .zshrc just add



                                                  if [[ $TERM == xterm ]]; then
                                                  TERM=xterm-256color
                                                  fi


                                                  and also start with the tmux -2






                                                  share|improve this answer















                                                  In your .bashrc or .zshrc just add



                                                  if [[ $TERM == xterm ]]; then
                                                  TERM=xterm-256color
                                                  fi


                                                  and also start with the tmux -2







                                                  share|improve this answer














                                                  share|improve this answer



                                                  share|improve this answer








                                                  edited Jun 20 '15 at 22:47

























                                                  answered Jun 15 '15 at 20:58









                                                  TalalTalal

                                                  56958




                                                  56958























                                                      0














                                                      For those, who is consuming time on colors, and if solarized vim doesn’t work on tmux,
                                                      or tired of finding colors of vim,
                                                      this should work in a minute, also it is from the official repository.



                                                      yum vim-jellybeans


                                                      or



                                                      mkdir -p ~/.vim/colors
                                                      cd ~/.vim/colors
                                                      curl -O https://raw.githubusercontent.com/nanotech/jellybeans.vim/master/colors/jellybeans.vim
                                                      sed -i '/colorscheme/d' ~/.vimrc
                                                      echo colorscheme jellybeans >> ~/.vimrc


                                                      I’m not sure if you must use solarized, or you are having an issue with invisible characters in vim, then this will fix it with the beautiful color set and patterns are so focused and useful, if you are also tried to set those highlight, search words, this is it. everything has already set to use.






                                                      share|improve this answer




























                                                        0














                                                        For those, who is consuming time on colors, and if solarized vim doesn’t work on tmux,
                                                        or tired of finding colors of vim,
                                                        this should work in a minute, also it is from the official repository.



                                                        yum vim-jellybeans


                                                        or



                                                        mkdir -p ~/.vim/colors
                                                        cd ~/.vim/colors
                                                        curl -O https://raw.githubusercontent.com/nanotech/jellybeans.vim/master/colors/jellybeans.vim
                                                        sed -i '/colorscheme/d' ~/.vimrc
                                                        echo colorscheme jellybeans >> ~/.vimrc


                                                        I’m not sure if you must use solarized, or you are having an issue with invisible characters in vim, then this will fix it with the beautiful color set and patterns are so focused and useful, if you are also tried to set those highlight, search words, this is it. everything has already set to use.






                                                        share|improve this answer


























                                                          0












                                                          0








                                                          0







                                                          For those, who is consuming time on colors, and if solarized vim doesn’t work on tmux,
                                                          or tired of finding colors of vim,
                                                          this should work in a minute, also it is from the official repository.



                                                          yum vim-jellybeans


                                                          or



                                                          mkdir -p ~/.vim/colors
                                                          cd ~/.vim/colors
                                                          curl -O https://raw.githubusercontent.com/nanotech/jellybeans.vim/master/colors/jellybeans.vim
                                                          sed -i '/colorscheme/d' ~/.vimrc
                                                          echo colorscheme jellybeans >> ~/.vimrc


                                                          I’m not sure if you must use solarized, or you are having an issue with invisible characters in vim, then this will fix it with the beautiful color set and patterns are so focused and useful, if you are also tried to set those highlight, search words, this is it. everything has already set to use.






                                                          share|improve this answer













                                                          For those, who is consuming time on colors, and if solarized vim doesn’t work on tmux,
                                                          or tired of finding colors of vim,
                                                          this should work in a minute, also it is from the official repository.



                                                          yum vim-jellybeans


                                                          or



                                                          mkdir -p ~/.vim/colors
                                                          cd ~/.vim/colors
                                                          curl -O https://raw.githubusercontent.com/nanotech/jellybeans.vim/master/colors/jellybeans.vim
                                                          sed -i '/colorscheme/d' ~/.vimrc
                                                          echo colorscheme jellybeans >> ~/.vimrc


                                                          I’m not sure if you must use solarized, or you are having an issue with invisible characters in vim, then this will fix it with the beautiful color set and patterns are so focused and useful, if you are also tried to set those highlight, search words, this is it. everything has already set to use.







                                                          share|improve this answer












                                                          share|improve this answer



                                                          share|improve this answer










                                                          answered 17 mins ago









                                                          SeandexSeandex

                                                          211




                                                          211






























                                                              draft saved

                                                              draft discarded




















































                                                              Thanks for contributing an answer to Ask Ubuntu!


                                                              • Please be sure to answer the question. Provide details and share your research!

                                                              But avoid



                                                              • Asking for help, clarification, or responding to other answers.

                                                              • Making statements based on opinion; back them up with references or personal experience.


                                                              To learn more, see our tips on writing great answers.




                                                              draft saved


                                                              draft discarded














                                                              StackExchange.ready(
                                                              function () {
                                                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f125526%2fvim-in-tmux-display-wrong-colors%23new-answer', 'question_page');
                                                              }
                                                              );

                                                              Post as a guest















                                                              Required, but never shown





















































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown

































                                                              Required, but never shown














                                                              Required, but never shown












                                                              Required, but never shown







                                                              Required, but never shown







                                                              Popular posts from this blog

                                                              Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                                                              Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                                                              Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...