1995-06-02 12:48:24 +02:00
|
|
|
|
# Initializations to be done on a new terminal. This is
|
|
|
|
|
# called both from .zlogin and .zshrc
|
|
|
|
|
|
1999-03-12 14:32:06 +01:00
|
|
|
|
# default initialization
|
1999-08-21 23:48:23 +02:00
|
|
|
|
if [ -r /usr/local/lib/profile-parts/term ]
|
1999-05-09 21:03:32 +02:00
|
|
|
|
then
|
1999-08-21 23:48:23 +02:00
|
|
|
|
. /usr/local/lib/profile-parts/term
|
1999-05-09 21:03:32 +02:00
|
|
|
|
fi
|
1995-06-02 12:48:24 +02:00
|
|
|
|
|
|
|
|
|
# terminal customization
|
|
|
|
|
|
|
|
|
|
if [[ .$TERM. = .console. ]]
|
|
|
|
|
then
|
|
|
|
|
# Linux console
|
|
|
|
|
TERM=vt200
|
|
|
|
|
stty rows 25 cols 80
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ .$TERM. = .vt200. ]]
|
|
|
|
|
then
|
|
|
|
|
# vt200 not known here
|
|
|
|
|
TERM=vt100
|
|
|
|
|
stty erase
|
|
|
|
|
fi
|
|
|
|
|
|
2020-02-28 10:49:11 +01:00
|
|
|
|
if [[ $TERM == xterm-256color && ! -f /usr/share/terminfo/x/xterm-256color && ! -f /lib/terminfo/x/xterm-256color ]]
|
2009-10-12 14:56:39 +02:00
|
|
|
|
then
|
|
|
|
|
TERM=xterm
|
|
|
|
|
fi
|
|
|
|
|
|
2019-12-27 20:08:53 +01:00
|
|
|
|
if [[ $TERM == xterm ]]
|
|
|
|
|
then
|
2020-02-28 10:49:11 +01:00
|
|
|
|
for t in xterm-256color
|
2019-12-27 20:08:53 +01:00
|
|
|
|
do
|
2020-02-28 10:49:11 +01:00
|
|
|
|
for dir in /usr/share/terminfo/x /lib/terminfo/x/
|
|
|
|
|
do
|
|
|
|
|
if [[ -f $dir/$t ]]
|
|
|
|
|
then
|
|
|
|
|
TERM=$t
|
|
|
|
|
break 2
|
|
|
|
|
fi
|
|
|
|
|
done
|
2019-12-27 20:08:53 +01:00
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
|
2017-09-27 09:40:53 +02:00
|
|
|
|
case "$TERM" in
|
|
|
|
|
xterm*|screen)
|
2008-08-06 15:47:30 +02:00
|
|
|
|
# indicated exit status by smiley (suggested by Stig Sandbeck Mathisen)
|
|
|
|
|
smiley="%b%(0?,%{[32m%}:-),%{[31m%}:-()%{[30m%}%B"
|
|
|
|
|
prompt="%{]0;%m(%l)%n %~%}%B%m:%~ %T $smiley %h%# %b"
|
|
|
|
|
unsetopt PRINT_EXIT_VALUE
|
2005-02-03 17:13:40 +01:00
|
|
|
|
# force backspace key to send BS:
|
|
|
|
|
# warning: This works with real xterm and rxvt
|
|
|
|
|
# it doesn't work with konsole or gnome-terminal.
|
2005-02-22 12:25:06 +01:00
|
|
|
|
echo -n '[?67h'
|
2005-02-03 17:13:40 +01:00
|
|
|
|
stty erase
|
2017-09-27 09:40:53 +02:00
|
|
|
|
;;
|
|
|
|
|
*)
|
2015-06-01 13:41:53 +02:00
|
|
|
|
prompt="%B%m:%~ %T %h%# %b"
|
2017-09-27 09:40:53 +02:00
|
|
|
|
;;
|
|
|
|
|
esac
|
2015-06-01 13:41:53 +02:00
|
|
|
|
|
2020-02-28 10:49:11 +01:00
|
|
|
|
if [[ $TERM = xterm || $TERM = xterm-256color ]]
|
2015-06-01 13:41:53 +02:00
|
|
|
|
then
|
2009-06-10 21:10:20 +02:00
|
|
|
|
if [ -f ~/.zxtermcolors ]
|
|
|
|
|
then
|
|
|
|
|
. ~/.zxtermcolors
|
|
|
|
|
else
|
2019-05-18 10:28:03 +02:00
|
|
|
|
perl -e 'printf(qq{if whence xtermcontrol >/dev/null\nthen\nxtermcontrol --bg "#%02X%02X%02X"\nexport BG=light\nfi\n}, map { rand(128)+128 } qw(1 1 1))' > ~/.zxtermcolors
|
2009-06-10 21:10:20 +02:00
|
|
|
|
fi
|
1995-06-02 12:48:24 +02:00
|
|
|
|
fi
|
|
|
|
|
|
1996-02-22 14:33:43 +01:00
|
|
|
|
export PROMPT
|
1995-06-02 12:48:24 +02:00
|
|
|
|
znewtermexecuted=true
|