optimise: embed ^A and ^M inside the default PS1 string
This commit is contained in:
parent
31d1499219
commit
553ff601b7
@ -1,4 +1,4 @@
|
||||
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.38 2008/11/07 20:07:10 tg Stab $
|
||||
# $MirOS: src/bin/mksh/dot.mkshrc,v 1.39 2008/12/13 17:09:45 tg Rel $
|
||||
#-
|
||||
# ~/.mkshrc: mksh initialisation file for interactive shells
|
||||
|
||||
@ -10,11 +10,10 @@ function precmd {
|
||||
|
||||
(( e )) && print -n "$e|"
|
||||
}
|
||||
PS1='$(precmd)${USER:=$(ulimit -c 0;id -un 2>&-||print \?)}@${HOSTNAME%%.*}:$(
|
||||
PS1='
$(precmd)${USER:=$(ulimit -c 0;id -un 2>&-||print \?)}@${HOSTNAME%%.*}:$(
|
||||
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
|
||||
unalias ls
|
||||
|
Loading…
x
Reference in New Issue
Block a user