From 143d7d6eb2c97d1b59dfebf599744bcb60ae8aeb Mon Sep 17 00:00:00 2001 From: jon Date: Tue, 1 Jan 2019 19:05:11 -0600 Subject: [PATCH] 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. --- bash/.bashrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bash/.bashrc b/bash/.bashrc index ca3aa52..37b517d 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -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