Merge "Default to xterm, remove some cruft."

This commit is contained in:
Elliott Hughes 2014-12-12 01:21:59 +00:00 committed by Gerrit Code Review
commit 508b57470e

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"'
}