From ad02049329fb8f56a7195d9f3c7949fbd3ae1d5c Mon Sep 17 00:00:00 2001 From: Quinn Date: Wed, 19 Nov 2025 09:32:19 +0100 Subject: [PATCH] fix: rework error code writing / simplify it --- .bashrc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.bashrc b/.bashrc index 127a74c..ff76596 100644 --- a/.bashrc +++ b/.bashrc @@ -51,16 +51,16 @@ __regenprompt() { local git=$(__lazy_git_ps1) if [ $err -ne 0 ]; then - err="\033[s\033[$((COLUMNS - 4))G${err}\033[u" + err="\[\033[$((COLUMNS - 4))G\033[01;31m\]${err}\[\033[0G\]" else unset err; fi - PS1="\[\033[?25h\]" # show cursor - PS1="$PS1\[\033[01;35m\]\u@\h" # user@host - PS1="$PS1\[\033[00m\]:" # separator - PS1="$PS1\[\033[01;34m\]\w" # working directory - PS1="$PS1\[\033[01;93m\]$git" # git branch - PS1="$PS1\[\033[01;31m\]\[$err\]" # error code - PS1="$PS1\[\033[00m\]\$ " # shell sign + PS1="$err" # error code + PS1="$PS1\[\033[?25h\]" # show cursor + PS1="$PS1\[\033[01;35m\]\u@\h" # user@host + PS1="$PS1\[\033[00m\]:" # separator + PS1="$PS1\[\033[01;34m\]\w" # working directory + PS1="$PS1\[\033[01;93m\]${git}" # git branch + PS1="$PS1\[\033[00m\]\$ " # shell sign } PROMPT_COMMAND=__regenprompt