# $Id$
-# $MirOS: src/bin/mksh/dot.mkshrc,v 1.100 2015/07/10 19:36:33 tg Exp $
+# $MirOS: src/bin/mksh/dot.mkshrc,v 1.104 2015/12/31 21:00:12 tg Exp $
#-
# Copyright (c) 2002, 2003, 2004, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012, 2013, 2014, 2015
-# Thorsten Glaser <tg@mirbsd.org>
+# mirabilos <m@mirbsd.org>
#
# Provided that these terms and disclaimer and all copyright notices
# are retained or reproduced in an accompanying document, permission
(( e )) && REPLY+="$e|"
REPLY+=${USER}@${HOSTNAME%%.*}:
- \typeset d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || d=${d/#$p/~}
+ \typeset d=${PWD:-?} p=~; [[ $p = ?(*/) ]] || d=${d/#$p/\~}
\typeset m=${%d} n p=...; (( m > 0 )) || m=${#d}
(( m > (n = (COLUMNS/3 < 7 ? 7 : COLUMNS/3)) )) && d=${d:(-n)} || p=
REPLY+=$p$d
DIRSTACK[0]=$(\builtin realpath . 2>/dev/null || \
\builtin print -r -- "$PWD")
[[ $DIRSTACKBASE = ?(*/) ]] || \
- DIRSTACK[0]=${DIRSTACK[0]/#$DIRSTACKBASE/~}
+ DIRSTACK[0]=${DIRSTACK[0]/#$DIRSTACKBASE/\~}
\:
}
\chpwd .
\chpwd "$@"
}
function cd_csh {
- \typeset d t=${1/#~/$DIRSTACKBASE}
+ \typeset d t=${1/#\~/$DIRSTACKBASE}
if ! d=$(\builtin cd "$t" 2>&1); then
\builtin print -u2 "${1}: ${d##*cd: $t: }."
fv=0
while (( fv < ${#DIRSTACK[*]} )); do
d=${DIRSTACK[fv]}
- (( fl )) && d=${d/#~/$DIRSTACKBASE}
+ (( fl )) && d=${d/#\~/$DIRSTACKBASE}
\builtin print -r -- "$fv $d"
\builtin let fv++
done
fv=0
while (( fv < ${#DIRSTACK[*]} )); do
d=${DIRSTACK[fv]}
- (( fl )) && d=${d/#~/$DIRSTACKBASE}
+ (( fl )) && d=${d/#\~/$DIRSTACKBASE}
(( dwidth = (${%d} > 0 ? ${%d} : ${#d}) ))
if (( fn && (cpos += dwidth + 1) >= 79 && \
dwidth < 80 )); then
# give MidnightBSD's laffer1 a bit of csh feeling
function setenv {
- \eval "'export' \"$1\""'="$2"'
+ if (( $# )); then
+ \eval '\export "$1"="${2:-}"'
+ else
+ \typeset -x
+ fi
}
# toggle built-in aliases and utilities, and aliases and functions from mkshrc
i_alias[nalias]=nameref; b_alias[nalias++]='\typeset -n'
i_alias[nalias]=nohup; b_alias[nalias++]='nohup '
i_alias[nalias]=r; b_alias[nalias++]='\builtin fc -e -'
- #XXX OS/2
- i_alias[nalias]=source; b_alias[nalias++]='PATH=$PATH:. \command .'
- i_alias[nalias]=stop; b_alias[nalias++]='\kill -STOP'
i_alias[nalias]=type; b_alias[nalias++]='\builtin whence -v'
# accumulate mksh built-in utilities, in definition order, even ifndef
i_func[nfunc++]=return
i_func[nfunc++]=set
i_func[nfunc++]=shift
+ i_func[nfunc++]=source
i_func[nfunc++]=suspend
i_func[nfunc++]=test
i_func[nfunc++]=times
i_func[nfunc++]=printf
i_func[nfunc++]=sleep
i_func[nfunc++]=domainname
+ i_func[nfunc++]=extproc
# accumulate aliases from dot.mkshrc, in definition order
i_alias[nalias]=l; b_alias[nalias++]='ls -F'
#\unset LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_IDENTIFICATION LC_MONETARY \
# LC_NAME LC_NUMERIC LC_TELEPHONE LC_TIME
#p=en_GB.UTF-8
-#\set -U
#\export LANG=C LC_CTYPE=$p LC_MEASUREMENT=$p LC_MESSAGES=$p LC_PAPER=$p
+#\set -U
\unset p