diff options
author | Bill Nottingham <notting@redhat.com> | 2013-01-03 14:20:07 -0500 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2013-01-03 14:20:07 -0500 |
commit | 9a0f402caa2dd711d9f24ee9e28e90682d904795 (patch) | |
tree | f5c5e31a6c63868f42f368f3c7d93f9f1ed7d4c2 /256term.sh | |
parent | a3d8303fff48dc133e1b4bb148e89ccc9db142b8 (diff) | |
download | initscripts-9a0f402caa2dd711d9f24ee9e28e90682d904795.tar initscripts-9a0f402caa2dd711d9f24ee9e28e90682d904795.tar.gz initscripts-9a0f402caa2dd711d9f24ee9e28e90682d904795.tar.bz2 initscripts-9a0f402caa2dd711d9f24ee9e28e90682d904795.tar.xz initscripts-9a0f402caa2dd711d9f24ee9e28e90682d904795.zip |
Rename term256 to 256term (glob sort) (#849429)
Diffstat (limited to '256term.sh')
-rw-r--r-- | 256term.sh | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/256term.sh b/256term.sh new file mode 100644 index 00000000..546f67bc --- /dev/null +++ b/256term.sh @@ -0,0 +1,26 @@ +# Enable 256 color capabilities for appropriate terminals + +# Set this variable in your local shell config (such as ~/.bashrc) +# if you want remote xterms connecting to this system, to be sent 256 colors. +# This must be set before reading global initialization such as /etc/bashrc. +# SEND_256_COLORS_TO_REMOTE=1 + +# Terminals with any of the following set, support 256 colors (and are local) +local256="$COLORTERM$XTERM_VERSION$ROXTERM_ID$KONSOLE_DBUS_SESSION" + +if [ -n "$local256" ] || [ -n "$SEND_256_COLORS_TO_REMOTE" ]; then + + case "$TERM" in + 'xterm') TERM=xterm-256color;; + 'screen') TERM=screen-256color;; + 'Eterm') TERM=Eterm-256color;; + esac + export TERM + + if [ -n "$TERMCAP" ] && [ "$TERM" = "screen-256color" ]; then + TERMCAP=$(echo "$TERMCAP" | sed -e 's/Co#8/Co#256/g') + export TERMCAP + fi +fi + +unset local256 |