Use simpler bash prompt

master
Hektor Misplon 2021-03-28 10:39:14 +02:00
parent f8f15baa4a
commit fc095d371c
1 changed files with 4 additions and 4 deletions

View File

@ -8,8 +8,6 @@
export PATH=~/.bin:$PATH export PATH=~/.bin:$PATH
# Prompt # Prompt
bold=$(tput bold)
reset=$(tput sgr0)
get_branch_name() { get_branch_name() {
git symbolic-ref --quiet --short HEAD 2>/dev/null \ git symbolic-ref --quiet --short HEAD 2>/dev/null \
|| git rev-parse --short HEAD 2>/dev/null \ || git rev-parse --short HEAD 2>/dev/null \
@ -17,9 +15,11 @@ get_branch_name() {
} }
get_git_info() { get_git_info() {
git rev-parse --is-inside-work-tree &>/dev/null || return git rev-parse --is-inside-work-tree &>/dev/null || return
echo -e "${1}$(get_branch_name)" echo -e "$(get_branch_name)"
} }
PS1='\[\033[38;5;244m\]\[${bold}\]$(get_git_info && echo "\n")\[${reset}\]\u \W ❭ '
export PS1="\u \w ❭\[$(tput sgr0)\] "
# History # History
export HISTCONTROL=ignoreboth export HISTCONTROL=ignoreboth