Skip to content

Commit 589a9a1

Browse files
authored
Merge pull request #322 from geometry-zsh/clear-prompt-before-exec
Clear the right prompt before we evaluate it, this fixes first terminal startup RPROMPT
2 parents 96d779b + 639b64d commit 589a9a1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

geometry.zsh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,17 +129,18 @@ geometry::rprompt::set() {
129129

130130
geometry::rprompt() {
131131
typeset -g GEOMETRY_ASYNC_FD=
132+
RPROMPT=
132133
exec {GEOMETRY_ASYNC_FD}< <(geometry::wrap $PWD $GEOMETRY_RPROMPT)
133134
zle -F "$GEOMETRY_ASYNC_FD" geometry::rprompt::set
134135
}
135136

136137
geometry::prompt() {
137138
GEOMETRY[LAST_STATUS]="$status"
138139
PROMPT=" $(geometry::wrap $PWD $GEOMETRY_PROMPT) "
139-
geometry::rprompt
140140
}
141141

142142
add-zsh-hook precmd geometry::prompt
143+
add-zsh-hook precmd geometry::rprompt
143144

144145
geometry::info() { # draw info if no command is given
145146
[[ -n "$BUFFER" ]] && { zle accept-line && return; }

0 commit comments

Comments
 (0)