Blame SOURCES/kshrc.rhs

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