Skip to content

Instantly share code, notes, and snippets.

@shawnbot
Last active March 22, 2024 16:26
Show Gist options
  • Save shawnbot/3277580 to your computer and use it in GitHub Desktop.
Save shawnbot/3277580 to your computer and use it in GitHub Desktop.
Make OS X Terminal respect 256 colors in screen

1. Ensure that Terminal declares itself as "xterm-256color"

Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color.

2. Build a version of screen that supports 256 colors

This is easy with homebrew:

brew install screen

When this finishes you'll have a new binary in /usr/local/bin/screen.

3. Add the new screen binary to your path

Add /usr/local/bin to the front of your $PATH so that your shell uses this binary, and not the one in /usr/bin (you can confirm that it's using the correct one with which screen). If you're using the bash, this goes into your .bash_profile:

PATH="/usr/local/bin:$PATH"

If you're using another shell, then you probably already know where this goes. :)

Copy link

ghost commented Apr 2, 2018

"Error: homebrew/dupes was deprecated. This tap is now empty as all its formulae were migrated." :(

@shawnbot
Copy link
Author

Thanks, @mattietea. I've updated the instructions to suggest brew install screen now that homebrew/dupes is gone.

@buncis
Copy link

buncis commented Dec 20, 2020

is it still need to be done on big sur?

I have following it but it still not showing 256 colors on my terminal vim

@DryLabRebel
Copy link

@buncis I also had to ensure screen ran an interactive login shell. Put this in my.screenrc:

shell -$SHELL

Also $TERM may still be run as screen. So I put export TERM="xterm-256color" in my .bash_profile, so that when screen (or any login shell) is run, it explicitly sets 256 colors.

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