Blame SOURCES/kshrc.rhs

ff22b9
#
ff22b9
# /etc/kshrc is sourced in interactive shells.  It
ff22b9
# should contain commands to set up aliases, functions,
ff22b9
# options, key bindings, etc.
ff22b9
#
ff22b9
ff22b9
# Set prompts
ff22b9
#PROMPT='[%n@%m]%~%# '    # default prompt
ff22b9
#RPROMPT=' %~'     # prompt for right side of screen
ff22b9
ff22b9
_src_etc_profile_d()
ff22b9
{
ff22b9
    # from zshrc, with ksh fixes
ff22b9
    if [[ ! -o login ]]; then # We're not a login shell
ff22b9
        for i in /etc/profile.d/*.sh; do
ff22b9
	    if [ -r "$i" ]; then
ff22b9
	        . $i
ff22b9
	    fi
ff22b9
        done
ff22b9
        unset i
ff22b9
    fi
ff22b9
}
ff22b9
ff22b9
pathmunge () {
ff22b9
case ":${PATH}:" in
ff22b9
*:"$1":*)
ff22b9
    ;;
ff22b9
*)
ff22b9
    if [ "$2" = "after" ]; then
ff22b9
        PATH=$PATH:$1
ff22b9
    else
ff22b9
        PATH=$1:$PATH
ff22b9
    fi
ff22b9
esac
ff22b9
}
ff22b9
ff22b9
_src_etc_profile_d
ff22b9
ff22b9
unset -f _src_etc_profile_d
ff22b9
unset -f pathmunge
ff22b9
ff22b9
# key bindings - make Delete, Home, End,... work
ff22b9
keybd_trap () {
ff22b9
  case ${.sh.edchar} in
ff22b9
    $'\e[1~') .sh.edchar=$'\001';; # Home = beginning-of-line
ff22b9
    $'\e[F')  .sh.edchar=$'\005';; # End = end-of-line
ff22b9
    $'\e[5~') .sh.edchar=$'\e>';; # PgUp = history-previous
ff22b9
    $'\e[6~') .sh.edchar=$'\e<';; # PgDn = history-next
ff22b9
    $'\e[3~') .sh.edchar=$'\004';; # Delete = delete-char
ff22b9
  esac
ff22b9
}
ff22b9
trap keybd_trap KEYBD
ff22b9