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='ls --color=auto' # we're on grml, so we do have GNU ls.
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 "${line#*=}")"
48 key_left) bind "${seq}"='backward-char' ;;
49 key_right) bind "${seq}"='forward-char' ;;
50 key_up) bind "${seq}"='up-history' ;;
51 key_down) bind "${seq}"='down-history' ;;
52 key_ppage) bind "${seq}"='search-history-up' ;;
53 key_npage) bind "${seq}"='search-history-down' ;;
54 key_home) bind "${seq}"='beginning-of-line' ;;
55 key_end) bind "${seq}"='end-of-line' ;;
56 key_backspace) bind "${seq}"='delete-char-backward' ;;
57 key_dc) bind "${seq}"='delete-char-forward' ;;
64 if [[ "${rv}" != 0 ]]; then
69 # put the current directory and history number in the prompt.
70 # use a wrapper for 'cd' to get '~' instead of /home/foo/.
73 [[ $PWD = $HOME* && $HOME != / ]] && _pwd=\~"${PWD#$HOME}" && return
78 PS1='$(_lrv)(!)-$_pwd'
79 if (( USER_ID )); then
87 # This is the default in mksh, but we make sure in case people tempered
88 # with it in their environment.