1
0
Fork 0

bashrc: move call for $nixos_needsreboot into `PS0` to prevent setting `$?` to `0`

This commit is contained in:
Pratham Patel 2024-03-19 16:59:27 +05:30
parent 5f34a07801
commit 9aa74c53f1
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
1 changed files with 5 additions and 2 deletions

View File

@ -219,8 +219,11 @@ function nixos_needsreboot() {
}
# PS1 setup
PS0="\t\n" # display time in HH:MM:SS format
PS1='$(nixos_needsreboot)'"\n[\u@\h:\$PWD \$?]\$ "
PS0="\t" # display time in HH:MM:SS format
# the function needs to be called **everytime** and is in single quotes
# shellcheck disable=SC2016
PS0+='$(nixos_needsreboot)'"\n"
PS1="\n[\u@\h:\$PWD \$?]\$ "
export PS0 PS1
# zoxide setup