From 553ff601b7e3cf0595ba801894493e556aaf98f3 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 13 Dec 2008 17:09:45 +0000 Subject: [PATCH] optimise: embed ^A and ^M inside the default PS1 string --- dot.mkshrc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dot.mkshrc b/dot.mkshrc index a3d4729..c9b5059 100644 --- a/dot.mkshrc +++ b/dot.mkshrc @@ -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