Skip to content

Commit

Permalink
Fix a bug in determing the exit status of last shell command (#207)
Browse files Browse the repository at this point in the history
The exit status of last shell command was not determined at the very beginning of the `compile_prompt` function that might have caused wrong code output.
  • Loading branch information
xulongwu4 authored and arcticicestudio committed Jun 29, 2019
1 parent 8173420 commit 6f483af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snowblocks/bash/core/prompt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ GIT_PS1_SHOWCOLORHINTS=true
GIT_PS1_HIDE_IF_PWD_IGNORED=false

compile_prompt () {
local EXIT=$?
local CONNECTBAR_DOWN=$'\u250C\u2500\u257C'
local CONNECTBAR_UP=$'\u2514\u2500\u257C'
local GITSPLITBAR=$'\u2570\u257C'
Expand Down Expand Up @@ -98,7 +99,7 @@ compile_prompt () {
# > Exit Status
# Format:
# (bracket open)(last exit status)(bracket close)(splitbar)
PS1+="[${c_blue}$?${c_gray}]"
PS1+="[${c_blue}${EXIT}${c_gray}]"
PS1+="$SPLITBAR"

# > Time
Expand Down

0 comments on commit 6f483af

Please sign in to comment.