Fix exit code of last command in bash prompt
This commit is contained in:
parent
ea58023c79
commit
3b3e080335
1 changed files with 2 additions and 1 deletions
|
@ -116,7 +116,8 @@ PS1="\$ "
|
|||
PROMPT_COMMAND=__ps1_set
|
||||
|
||||
__ps1_set() {
|
||||
if [ $? -ne 0 ]; then
|
||||
local exit_code=$?
|
||||
if [ $exit_code -ne 0 ]; then
|
||||
local status="$PS1_STATUS$exit_code$PS1_RESET "
|
||||
else
|
||||
local status=""
|
||||
|
|
Loading…
Add table
Reference in a new issue