Default to xterm, remove some cruft.

gtest won't color its output unless TERM is an xterm, and that seems as
reasonable a default as vt100. More reasonable, in fact. This only fixes
things for login shells, so we still need to fix adb to pass $TERM
through to make yabinc happy...

We can get a better more(1) from toybox, and the aliases seem inappropriate.

Change-Id: Id73035d69ab421b179b9beb575d4e1607fbcce62
This commit is contained in:
Elliott Hughes 2014-12-11 17:13:19 -08:00
parent a1c1f910f5
commit 11ed7f9d7c

26
mkshrc
View file

@ -6,7 +6,7 @@
#
# Support: https://launchpad.net/mksh
: ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=$(getprop ro.product.device)}
: ${TERM:=xterm} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=$(getprop ro.product.device)}
: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})} ${HOSTNAME:=android}
if (( USER_ID )); then PS1='$'; else PS1='#'; fi
PS4='[$EPOCHREALTIME] '; PS1='${|
@ -17,10 +17,6 @@ PS4='[$EPOCHREALTIME] '; PS1='${|
return $e
}$USER@$HOSTNAME:${PWD:-?} '"$PS1 "
export HOME HOSTNAME MKSH SHELL TERM USER
alias l='ls'
alias la='l -a'
alias ll='l -l'
alias lo='l -a -l'
function hd {
local -Uui16 -Z11 pos=0
@ -53,26 +49,6 @@ function hd {
fi; }
}
function more {
(
set +m
cat "$@" |&
trap "rv=\$?; kill $! >/dev/null 2>&1; exit \$rv" EXIT
while IFS= read -pr line; do
llen=${%line}
(( llen == -1 )) && llen=${#line}
(( llen = llen ? (llen + COLUMNS - 1) / COLUMNS : 1 ))
if (( (curlin += llen) >= LINES )); then
print -n -- '\033[7m--more--\033[0m'
read -u1 || exit $?
[[ $REPLY = [Qq]* ]] && exit 0
curlin=$llen
fi
print -r -- "$line"
done
)
}
function setenv {
eval export "\"$1\""'="$2"'
}