dotfiles

Obligatory dotfiles repo
git clone git://git.danielmoch.com/dotfiles.git
Log | Files | Refs

commit 8308e5020831bd2b308d8c83b7007011e096b127
parent 1a78896633ed9d459bf9850af164da559f660076
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sat, 12 Dec 2020 15:53:58 -0500

shrc: simplify dumb terminal detection

Diffstat:
Metc/shrc | 23+++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/etc/shrc b/etc/shrc @@ -1,20 +1,23 @@ unset HISTFILE -case $TERM in -st*|rxvt*|xterm*|tmux*) printf "\033]0;$LOGNAME@$HOSTNAME\007" ;; -esac -if [ "$termprog" = "9term" -o "$termprog" = "win" ] +if [ "$TERM" = "dumb" ] then set +o emacs set +o vi set +m - cd() { - [ -z "$1" ] && set -- "$HOME" - command cd "$1" && awd $HOSTNAME - } - awd $HOSTNAME + if [ "$termprog" = "9term" -o "$termprog" = "win" ] + then + cd() { + [ -z "$1" ] && set -- "$HOME" + command cd "$1" && awd $HOSTNAME + } + awd $HOSTNAME + fi else - set -o emacs + set -mbo emacs + case $TERM in + st*|rxvt*|xterm*|tmux*) printf "\033]0;$LOGNAME@$HOSTNAME\007" ;; + esac fi if type gpg-connect-agent > /dev/null 2>&1