update bash prompt

- bring in sync with taken from https://github.com/kremalicious/dotfiles/blob/master/bash_prompt
This commit is contained in:
Matthias Kretschmann 2016-11-05 00:39:43 +01:00
parent 6dbae7ee11
commit ebb2e4ef5e
Signed by: m
GPG Key ID: BD3C1F3EDD7831FC
1 changed files with 12 additions and 12 deletions

View File

@ -1,5 +1,9 @@
#!/usr/bin/env bash
#
# taken from https://github.com/kremalicious/dotfiles/blob/master/bash_prompt
#
# ----------------------------------------------------------------------
# bash_prompt, from @mathiasbynens
# slightly modified
@ -99,24 +103,20 @@ fi;
if [[ "${USER}" == "root" ]]; then
userStyle="${red}";
else
userStyle="${orange}";
userStyle="${gray}";
fi;
# Highlight the hostname when connected via SSH.
if [[ "${SSH_TTY}" ]]; then
hostStyle="${bold}${cyan}";
PS1="\[\033]0;\W • \h\007\]"; # Set the terminal title
PS1+="\n";
PS1+="\[${userStyle}\]\u "; # username
PS1+="\[${orange}\]\h \[${reset}\]"; # host
else
hostStyle="${cyan}";
PS1="\[\033]0;\W\007\]"; # Set the terminal title
PS1+="\n";
fi;
# Set the terminal title to the current working directory.
PS1="\[\033]0;\W • \h\007\]";
PS1+="\n";
PS1+="\[${userStyle}\]\u"; # username
PS1+="\[${dim}\] at ";
PS1+="\[${hostStyle}\]\h\[${reset}\]"; # host
PS1+="\[${dim}\] in ";
PS1+="\[${blue}\]\w"; # working directory full path
PS1+="\[${cyan}\]\w"; # working directory full path
PS1+="\$(prompt_git \" \[${gray}\]\")"; # Git repository details
PS1+="\n";
PS1+="\[${white}\]→ \[${reset}\]"; # `→` (and reset color)