much simplify and shorten default $PS1 (uses even more magick now)
This commit is contained in:
parent
2697deb55c
commit
5206ddcc65
17
dot.mkshrc
17
dot.mkshrc
@ -1,4 +1,4 @@
|
||||
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.37 2008/05/17 18:27:55 tg Exp $
|
||||
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.38 2008/11/07 20:07:10 tg Stab $
|
||||
#-
|
||||
# ~/.mkshrc: mksh initialisation file for interactive shells
|
||||
|
||||
@ -11,18 +11,9 @@ function precmd {
|
||||
(( e )) && print -n "$e|"
|
||||
}
|
||||
PS1='$(precmd)${USER:=$(ulimit -c 0;id -un 2>&-||print \?)}@${HOSTNAME%%.*}:$(
|
||||
typeset pfx=~ wd=${PWD:-?}
|
||||
typeset -i n=${COLUMNS:-80}/3; (( n = n < 7 ? 7 : n ))
|
||||
[[ $pfx = ?(*/) ]] || wd=${wd/#$pfx/~}
|
||||
pfx=; while (( (${#pfx} + ${#wd}) > n )); do
|
||||
if [[ $wd = */* ]]; then
|
||||
pfx=.../
|
||||
wd=${wd#*/}
|
||||
else
|
||||
pfx=...
|
||||
wd=${wd#?????}
|
||||
fi
|
||||
done; print -nr -- "$pfx$wd") '"$PS1 "
|
||||
typeset p=~ d=${PWD:-?}; typeset -i n=${COLUMNS:-80}/3
|
||||
[[ $p = ?(*/) ]] || d=${d/#$p/~}; (( n=n<7?7:n )); (( ${#d}>n )) && {
|
||||
p=...; d=${d:(-n)}; } || p=; print -nr -- "$p$d") '"$PS1 "
|
||||
PS1="$(print -n '\x1\r')$PS1" # allow colour codes, framed with ^A
|
||||
export EDITOR HOSTNAME LESSHISTFILE=- MKSH=$(whence -p mksh) PS1 TERM USER
|
||||
alias ls=ls
|
||||
|
Loading…
Reference in New Issue
Block a user