mirror of https://github.com/nirenjan/dotfiles.git
Fix prompt for commands over SSH
When executing commands over SSH, such as SCP, the server (tput) complains that there is no terminal defined. This fix sets the T_* variables only if the TERM variable is not empty.vimbundler
parent
b42371a079
commit
f77b4eeb77
|
@ -7,10 +7,20 @@ add_to_path() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Define the colors used by the prompt
|
# Define the colors used by the prompt
|
||||||
T_B=$(tput setaf 4) # Blue
|
if [[ ! -z $TERM && "$TERM" != "dumb" ]]
|
||||||
T_G=$(tput setaf 2) # Green
|
then
|
||||||
T_Y=$(tput setaf 3) # Yellow
|
T_B=$(tput setaf 4) # Blue
|
||||||
T_S=$(tput sgr0) # Reset
|
T_G=$(tput setaf 2) # Green
|
||||||
|
T_Y=$(tput setaf 3) # Yellow
|
||||||
|
T_S=$(tput sgr0) # Reset
|
||||||
|
else
|
||||||
|
# We've probably been invoked by an SSH command, there's no terminal
|
||||||
|
# to deal with. Don't bother coloring the prompt.
|
||||||
|
T_B=''
|
||||||
|
T_G=''
|
||||||
|
T_Y=''
|
||||||
|
T_S=''
|
||||||
|
fi
|
||||||
|
|
||||||
# Import the Git prompt shell functions. These can be found
|
# Import the Git prompt shell functions. These can be found
|
||||||
# @github:git/git/contrib/completion/git_prompt.sh
|
# @github:git/git/contrib/completion/git_prompt.sh
|
||||||
|
|
Loading…
Reference in New Issue