Skip to content

Instantly share code, notes, and snippets.

@limingjie
Last active April 24, 2024 22:15
Show Gist options
  • Star 66 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save limingjie/4975c36d13d0927613e6 to your computer and use it in GitHub Desktop.
Save limingjie/4975c36d13d0927613e6 to your computer and use it in GitHub Desktop.
256 colors in putty, tmux/screen and vim

#256 colors in putty, tmux/screen and vim There is a detailed answer on stackoverflow. If you are looking for a short one, here it is.

  • putty

    Set Connection -> Data -> Terminal-type string to xterm-256color

  • tmux

    Add this line to ~/.tmux.conf

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

    Add this line to ~/.screenrc

    term "screen-256color"
    
  • vim

    Add these lines to ~/.vimrc

    if &term == "screen"
      set t_Co=256
    endif
    

View actural 256 colors by this script.

@rob4226
Copy link

rob4226 commented May 29, 2023

Thank you for this! It really helped!

@sspaeti
Copy link

sspaeti commented Jul 13, 2023

That helped me as well!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment