Skip to content

Commit

Permalink
Added fast PS1 example
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Bouch committed Jan 5, 2018
1 parent 99a0e73 commit c7beecd
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions bashrc_sample
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi

# ssh-agent configuration for WSL
# ssh-agent configuration for WSL. Will only ask for passphrase once per session.
if [ -z "$(pgrep ssh-agent)" ]; then
rm -rf /tmp/ssh-*
eval $(ssh-agent -s) > /dev/null
Expand All @@ -151,7 +151,7 @@ else
fi

# This is only required if you want to load the default, or single
# ssh key on bash session start. In my case there are different
# ssh key on bash session start. In my case there are different
# keys per application so no point in loading any here yet.
#if [ "$(ssh-add -l)" == "The agent has no identities." ]; then
# ssh-add
Expand All @@ -160,13 +160,25 @@ fi
# Informative git prompt for bash and fish
# https://github.com/magicmonty/bash-git-prompt
# GIT_PROMPT_ONLY_IN_REPO=1
GIT_PROMPT_THEME=Custom # use custom .git-prompt-colors.sh
source ~/.bash-git-prompt/gitprompt.sh
# GIT_PROMPT_THEME=Custom # use custom .git-prompt-colors.sh
# source ~/.bash-git-prompt/gitprompt.sh

# Own rolled super fast prompt if not using .bash-git-prompt.sh above.
# Own rolled super fast prompt if not using .bash-git-prompt.sh above
# and in particular under WSL, or slower machines.
# http://ezprompt.net/
# export PS1="\[\e[32m\]\u\[\e[m\]@\[\e[36m\]\H\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[33m\]\w\[\e[m\] \n∴ "

# https://unix.stackexchange.com/questions/245548/git-ps1-current-branch-in-bash-prompt-is-always-out-of-date-somehow
update_PS1 () {
# my default symbol below needs a unicode font - DejaVu Sans Mono
# (for Powerline) seems to work best across all platforms.
# See ./dotfiles/fonts for both Windows and *nix installers
prompt=∴
GIT_PS1_SHOWDIRTYSTATE=true
PS1="\[\e[32m\]\u\[\e[m\]@\[\e[36m\]\H\[\e[m\]\[\e[33m\]:\[\e[m\]\[\e[33m\]\w\[\e[m\]$(__git_ps1) \n$prompt "
}
shopt -u promptvars
PROMPT_COMMAND=update_PS1

# load any local settings
if [ -f ~/.localrc ]; then
. ~/.localrc
fi

0 comments on commit c7beecd

Please sign in to comment.