Updated bash to fix some errors

Setting PS1 without checking to see if $TERM was set meant trying to set
a terminal prompt in incorrect places (eg via scp) and throwing an
error.

Also I was sourcing my fzf config without checking whether or not it
exists.  So it was spitting out errors on hosts that didnt have fzf
installed.
This commit is contained in:
jon
2019-01-01 19:05:11 -06:00
parent 2b92652b1f
commit 143d7d6eb2

View File

@@ -16,7 +16,7 @@ fi
#-j 5 show X lines above search for context
#-R fix ansi esc sequences
## 4 - right/left four chars
export LESS='-C -F -M -I -j 5 -R -# 4'
export LESS='-C -M -j 3 -R -# 4'
# User specific aliases and functions
alias l.='ls -lh --time-style=long-iso --color' 2>/dev/null
@@ -50,9 +50,13 @@ export HISTSIZE=1000
export HISTFILESIZE=2000
# Prompt
export PS1="\[$(tput bold)\]\[$(tput setaf 2)\][\u@\h \W]\\$ \[$(tput sgr0)\]"
if [ -z $TERM ]; then
export PS1="\[$(tput bold)\]\[$(tput setaf 2)\][\u@\h \W]\\$ \[$(tput sgr0)\]"
fi
# fedoras stupid command-not-found shit
unset command_not_found_handle
source /usr/share/fzf/shell/key-bindings.bash
if [ -f /usr/share/fzf/shell/key-bindings.bash ]; then
source /usr/share/fzf/shell/key-bindings.bash
fi