aboutsummaryrefslogtreecommitdiff
path: root/mkshrc
blob: 425223fb8e9194ebb84d8709a1f397d5e2bb06c3 (plain)
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
\: "${MKSH:=$(\builtin whence -p mksh)}"; \: "${MKSH:=/bin/mksh}";
\: SHELL=$MKSH;
\: HISTFILE=~/.mksh_history; \: HISTSIZE=1000;
\export MKSH SHELL HISTFILE HISTSIZE

case "$TERM" in
xterm|linux|screen|alacritty|*256col*)
	# ((e=$?)) && print "${|errno2str "$e"}" && e="?\001\e[0;31m$e\001\e[0m" || e=
	PS1=$'\001\r''$(\
((e=$?)) && e="?\001\e[0;31m$e\001\e[0m" || e=
d=${PWD/$HOME/\~}; d=${d##*/};\
[ "$SSH_CONNECTION" ] && s="@${HOSTNAME:=$(hostname)}" || s=;\
i=\#; ((USER_ID)) && i=\$;\
i1=\#; ((USER_ID)) && i1="\001\e[0;32m\$\001\e[0m";\
\print "$d$s$e$i1") '
;;
network|dump|*)
	PS1=$'\001\r''$(\
((r=$?)) && e="?$r" || e=;\
d=${PWD/$HOME/\~}; d=${d##*/};\
[ "$SSH_CONNECTION" ] && s="@${HOSTNAME:=$(hostname)}" || s=;\
((USER_ID)) && i=\$ || i=\#;\
print "$d$s$e$i ")'
;;
esac

function fgg {
	j=$(jobs|fzy)
	[ -z "$j" ] && return
	j=${j%%]*}; j=${j#[*}
	fg "%$j"
}

. ~/.aliases 2>/dev/null
. ~/.cache/ssh-agent-info 2>/dev/null