-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.znewterm
57 lines (49 loc) · 1.29 KB
/
.znewterm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Initializations to be done on a new terminal. This is
# called both from .zlogin and .zshrc
# default initialization
if [ -r /usr/local/lib/profile-parts/term ]
then
. /usr/local/lib/profile-parts/term
fi
# 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
if [[ $TERM == xterm-256color && ! -f /usr/share/terminfo/x/xterm-256color ]]
then
TERM=xterm
fi
if [[ $TERM = xterm || $TERM = xterm-256color || $TERM = screen ]]
then
# 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
# force backspace key to send BS:
# warning: This works with real xterm and rxvt
# it doesn't work with konsole or gnome-terminal.
echo -n '[?67h'
stty erase
else
prompt="%B%m:%~ %T %h%# %b"
fi
if [[ $TERM = xterm || $TERM = xterm-256color ]]
then
if [ -f ~/.zxtermcolors ]
then
. ~/.zxtermcolors
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
fi
fi
export PROMPT
znewtermexecuted=true