2 # Configuration for the `minimal-shell' function of grml's zsh setup.
3 # That function spawns a `mksh' shell with this file as its configuration.
5 # skip this setup for non-interactive shells
6 [[ -o interactive && -t 0 ]] || return
8 export PATH="/bin:/sbin/:/usr/bin/:/usr/sbin:/usr/local/bin:/usr/local/sbin:${HOME}/bin:/opt/bin"
11 if [[ -x $(which vim) ]] ; then
16 if [[ -x $(which less) ]] ; then
31 # aliases for various command shortcuts
32 alias ls='command ls --color=auto' # we're on grml, so we do have GNU ls.
33 alias ll='command ls -l --color=auto'
34 alias la='command ls -la --color=auto'
35 alias pu='ps -fu $USER'
38 bind '^L=clear-screen'
39 if [[ -x $(which infocmp) ]] && [[ -x $(which sed) ]] ; then
40 # Reading some special keys from terminfo database. If `infocmp'
41 # cannot be found, we rely on mksh to do the right thing.
42 infocmp -x1L | sed '/^\t[^k]/d;/^[^\t]/d;s/\t//;s/,$//' | \
43 while read -r line ; do
45 [[ "${key}" != k* ]] && continue
46 seq="$(print -r -- "${line#*=}" | sed -e 's,\\\([1-7][0-7]*\),\\0\1,g')"
47 seq="$(print "${seq}")"
49 key_left) bind "${seq}"='backward-char' ;;
50 key_right) bind "${seq}"='forward-char' ;;
51 key_up) bind "${seq}"='up-history' ;;
52 key_down) bind "${seq}"='down-history' ;;
53 key_ppage) bind "${seq}"='search-history-up' ;;
54 key_npage) bind "${seq}"='search-history-down' ;;
55 key_home) bind "${seq}"='beginning-of-line' ;;
56 key_end) bind "${seq}"='end-of-line' ;;
57 key_backspace) bind "${seq}"='delete-char-backward' ;;
58 key_dc) bind "${seq}"='delete-char-forward' ;;
65 if [[ "${rv}" != 0 ]]; then
70 # put the current directory and history number in the prompt.
71 # use a wrapper for 'cd' to get '~' instead of /home/foo/.
74 [[ $PWD = $HOME* && $HOME != / ]] && _pwd=\~"${PWD#$HOME}" && return
79 PS1='$(_lrv)(!)-$_pwd'
80 if (( USER_ID )); then
88 # This is the default in mksh, but we make sure in case people tempered
89 # with it in their environment.