Handle TERM=screen for prompt and colors.

This commit is contained in:
Peter J. Holzer 2015-06-01 13:41:53 +02:00
parent 19b31fbde6
commit 8f8d15505b
1 changed files with 7 additions and 3 deletions

View File

@ -28,7 +28,7 @@ then
TERM=xterm TERM=xterm
fi fi
if [[ $TERM = xterm || $TERM = xterm-256color ]] if [[ $TERM = xterm || $TERM = xterm-256color || $TERM = screen ]]
then then
# indicated exit status by smiley (suggested by Stig Sandbeck Mathisen) # indicated exit status by smiley (suggested by Stig Sandbeck Mathisen)
smiley="%b%(0?,%{%}:-),%{%}:-()%{%}%B" smiley="%b%(0?,%{%}:-),%{%}:-()%{%}%B"
@ -39,14 +39,18 @@ then
# it doesn't work with konsole or gnome-terminal. # it doesn't work with konsole or gnome-terminal.
echo -n '[?67h' echo -n '[?67h'
stty erase  stty erase 
else
prompt="%B%m:%~ %T %h%# %b"
fi
if [[ $TERM = xterm || $TERM = xterm-256color ]]
then
if [ -f ~/.zxtermcolors ] if [ -f ~/.zxtermcolors ]
then then
. ~/.zxtermcolors . ~/.zxtermcolors
else else
perl -e 'printf(qq{if whence xtermcontrol >/dev/null\nthen\nxtermcontrol --bg "#%02X%02X%02X"\nfi\n}, map { rand(128)+128 } qw(1 1 1))' > ~/.zxtermcolors perl -e 'printf(qq{if whence xtermcontrol >/dev/null\nthen\nxtermcontrol --bg "#%02X%02X%02X"\nfi\n}, map { rand(128)+128 } qw(1 1 1))' > ~/.zxtermcolors
fi fi
else
prompt="%B%m:%~ %T %h%# %b"
fi fi
export PROMPT export PROMPT