update: slightly WIP update with cool features
This commit is contained in:
24
.bash_prompt
Normal file
24
.bash_prompt
Normal file
@@ -0,0 +1,24 @@
|
||||
# History append
|
||||
shopt -s histappend
|
||||
|
||||
# Prompt
|
||||
set_prompt() {
|
||||
local EXIT_STATUS=$?
|
||||
local SUCCESS="\[\e[32m\]"
|
||||
local ERROR="\[\e[34m\]"
|
||||
local RESET="\[\e[0m\]"
|
||||
|
||||
history -a
|
||||
history -c
|
||||
history -r
|
||||
|
||||
if [ $EXIT_STATUS -eq 0 ]; then
|
||||
local COLOR=$SUCCESS
|
||||
else
|
||||
local COLOR=$ERROR
|
||||
fi
|
||||
|
||||
# PS1="[\u@\h \W]${COLOR}\\\$${RESET} "
|
||||
PS1="[\u@\h \! \W]${COLOR}\\\$${RESET} "
|
||||
}
|
||||
PROMPT_COMMAND=set_prompt
|
||||
Reference in New Issue
Block a user