Make TERM recognition a bit more flexible

This commit is contained in:
Peter J. Holzer 2017-09-27 09:40:53 +02:00
parent 5e59c96b35
commit 520ed4b064
1 changed files with 6 additions and 4 deletions

View File

@ -28,8 +28,8 @@ then
TERM=xterm TERM=xterm
fi fi
if [[ $TERM = xterm || $TERM = xterm-256color || $TERM = screen ]] case "$TERM" in
then xterm*|screen)
# 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"
prompt="%{]0;%m(%l)%n %~%}%B%m:%~ %T $smiley %h%# %b" prompt="%{]0;%m(%l)%n %~%}%B%m:%~ %T $smiley %h%# %b"
@ -39,9 +39,11 @@ 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" prompt="%B%m:%~ %T %h%# %b"
fi ;;
esac
if [[ $TERM = xterm || $TERM = xterm-256color ]] if [[ $TERM = xterm || $TERM = xterm-256color ]]
then then