geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
921 stars 94 forks source link

Plugin jobs check does not have correct functionality #253

Closed Konsonanz closed 5 years ago

Konsonanz commented 5 years ago

geometry_prompt_jobs_check function uses the following code do determine if it's running or not:

[[ $(print -P '%j') == "0" ]]

But this checks the success value and not the stdout of the operation and always succeeds, with numerous jobs and zero running. If you now load another plugin before jobs there will be a plugin spacer, empty space since jobs is not actually printing anything and another plugin spacer.

jedahan commented 5 years ago

Thanks for reporting! I think this is fixed in the mnml branch, would you mind testing http://github.com/geometry-zsh/geometry/tree/mnml ?

Konsonanz commented 5 years ago

Thanks for responding! The issue still persists: 2019-06-02 21-19-20 As you can see, there still is an unwanted space inserted, as well as incositend behaviour if just hitting enter (spacer gone).

jedahan commented 5 years ago

So the space is a problem with geometry_exec_time, checking that now.

a() { echo a }
b() { echo b }
GEOMETRY_RPROMPT=(a geometry_exec_time b)
jedahan commented 5 years ago

Okay I think I pushed a fix, can you try now?

jedahan commented 5 years ago

I also fixed a bug where different shells could clobber the exec time :)

Konsonanz commented 5 years ago

Appreciate the fix for exec_time. But unfortunately, still a space from geometry_jobs with no jobs running: 2019-06-02 22-21-55

jedahan commented 5 years ago

Thanks for being patient, I think I squashed it this time.

jedahan commented 5 years ago

jerbs

Konsonanz commented 5 years ago

That did it :) Thank you very much!