From 3b177d8c95f70db8e27fd046711f480e81ea3fa7 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 16 Apr 2023 17:06:22 -0500 Subject: uhhhh --- bash/prompt.bash | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'bash/prompt.bash') diff --git a/bash/prompt.bash b/bash/prompt.bash index f09d3ab..bee5223 100644 --- a/bash/prompt.bash +++ b/bash/prompt.bash @@ -26,13 +26,7 @@ __prompt_exit_code() { # __prompt_exit_code CODES... printf '%s\n' "$ec" } -two_line_prompt() { - PS1= - - # user, host, and cwd - PROMPT_DIRTRIM=3 # how many dirs above current to print (rest are '...') - PS1+='\[\e[0;46m\]\u@\h \w' - +git_prompt_integration() { # git bit # see https://unix.stackexchange.com/questions/278206 possible_git_prompt_locations=( @@ -45,10 +39,18 @@ two_line_prompt() { for file in "${possible_git_prompt_locations[@]}"; do if [[ -f "$file" ]]; then source "$file" && - PS1+='\[\e[0m\]\[\e[35m\]$(__git_ps1)' + PS1+='\[\e[35m\]$(__git_ps1) \[\e[0m\]' break fi done +} + +two_line_prompt() { + PS1= + + # user, host, and cwd + PROMPT_DIRTRIM=3 # how many dirs above current to print (rest are '...') + PS1+='\[\e[0;46m\]\u@\h \w' # newline PS1+='\[\e[0m\]\n' @@ -62,7 +64,12 @@ two_line_prompt() { smiley_prompt() { __prompt_ec() { case $? in 0) echo '^_^' ;; *) echo ';_;' ;; esac } - PS1='\[\e[1m\]$(__prompt_exit_code "ok=^_^" "fail=;_;") \w\[\e[0m\] ' + + PS1='\[\e[33m\]$(__prompt_exit_code "ok=^_^" "fail=;_;")' + PS1+=' \w\[\e[0m\]' + + git_prompt_integration + PS1+='\[$(__prompt_term_title "$USER@$(hostname): $PWD")\]' PS1+='\$ ' } -- cgit 1.4.1-21-gabe81