Skip to content

Instantly share code, notes, and snippets.

@damc-dev
Created December 7, 2016 17:18
Show Gist options
  • Save damc-dev/fcb8e816da898cc94e37227f461eb3c0 to your computer and use it in GitHub Desktop.
Save damc-dev/fcb8e816da898cc94e37227f461eb3c0 to your computer and use it in GitHub Desktop.
Check if host supports 256-color
#!/bin/sh
# 256-color mode not supported on this host
if echo $TERM | grep -q -- '-256color'; then
echo -e '\n\n256-color mode not supported on this host. Reverting TERM...\n'
export TERM=`echo -n $TERM | sed 's/-256color//'`
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment