spaceship-prompt: Async section are not rendering
Is there an existing issue for this?
- Yes, I have searched the existing issues
- Yes, I have checked troubleshooting page
The problem
The rendering of async sections such as Git is not reliable and frequently fails to render:

It seems to be random with no discernible pattern. The async indicator (…) also never disappears, it is always there, and the async count is always 23 when enabled.
Relevant Zsh configuration
(Loaded with Antibody)
source $dotfilesZsh/zsh_plugins.sh
SPACESHIP_PROMPT_ADD_NEWLINE="false" # disable newline before prompt
Contents of zsh_plugins.sh:
source /home/james/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-spaceship-prompt-SLASH-spaceship-prompt/async.zsh
source /home/james/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-spaceship-prompt-SLASH-spaceship-prompt/spaceship.zsh
fpath+=( /home/james/.cache/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-spaceship-prompt-SLASH-spaceship-pro
What is version of Spaceship are you using?
v4.2.5
What is version of Zsh are you using?
5.8.1
What operation system are you running?
Fedora Linux 36 (Cinnamon)
Do you use any Zsh framework or plugin manager?
Antibody
Which terminal emulator do you use?
Gnome Terminal (v3.44.1)
Additional information
No response
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 17
- Comments: 55 (22 by maintainers)
Commits related to this issue
- refactor(async): Add a wrapper around zsh-async Ref #1193 #1190 — committed to spaceship-prompt/spaceship-prompt by denysdovhan 4 years ago
- hack(zsh): disable async rendering for now https://github.com/spaceship-prompt/spaceship-prompt/issues/1193 — committed to KyleOndy/dotfiles by KyleOndy 4 years ago
- hack(zsh): disable async rendering for now https://github.com/spaceship-prompt/spaceship-prompt/issues/1193 — committed to KyleOndy/dotfiles by KyleOndy 4 years ago
- 'Fix' on spaceship's rendering issue https://github.com/spaceship-prompt/spaceship-prompt/issues/1193 — committed to hposca/dotfiles by hposca 3 years ago
- Set spaceship sections to use async Modified async.zsh in spaceship submodule as suggested in https://github.com/spaceship-prompt/spaceship-prompt/issues/1193, which seems to have fixed issues with s... — committed to serpro69/notfiles by serpro69 2 years ago
Interesting. I guess maybe async worker fails sometimes. Maybe we can fix that be restarting it.
If you’re struggling with the async rendering, you can try disabling it for now, by:
@dmint789 unfortunately I can’t give exact ETA for the fix of this problem. I understand that you really want this to be fixed, but try to understand that I’m maintaining this project in my free time, besides my daytime job, missile strikes and electricity outages during the war.
Any help with this issue is highly appreciated. Thanks for understanding!
Hey all, I spent some hours on this today because I find it quite annoying.
I think I was able to pinpoint the issue to
zpty: it seems that if the command is too quick, it doesn’t properly return it.This also explains because in this issue we have seen many different prompts having the issue: at the end of the day, it is up to how long a command takes, and there are so many variables…
On my PC, I noticed that the threshold is around 50ms: if any command takes less than that, then it is not properly returned by
zpty.As a temporary workaround, I set a
sleep 0.05in the_async_job()function.This addresses the problem for me, although now the prompt is way slower (0.05s of delay for each section).
I wonder if the root cause is a bug in zpty, or the problem is that
spaceshipis using one worker for everything, and results are so quick that begin arriving before all the inputs have been inserted, mangling the results… Probably, something to try would be using a different worker for each section.Hope it can be useful!
I found a solution for this, I hope it works for you also
in .zshrc add this which you can find in the docs here
and then delete everything you don’t need. for me it became like this
And also don’t forget to remove all plugins in
pluginsvariable in.zshrcthat you don’t need for me I made it like thisplugins=(git zsh-autosuggestions zsh-syntax-highlighting)and don’t forget also to source~/.zshrcWhen should we expect async loading to be fixed?
Dude, seriously… be careful out there. We completely understand.
Okay, I’ve finally run into the similar problem. I got
asyncsection stuck always displaying…. For me, it was resolved by removingdotnetsection.UPD: Though, removing only
dotnetsection doesn’t help. Seems like the problem is with something else, still digging.still getting this issue in WSL2. i think at this point we should consider maintaining our own fix since the activity on zsh-async is low
Issue still persist for me
Hey everyone, check v4.6.0 version. It resolved the issue with always displaying
...for me. Let me know if that helps.This fixed it for me as well! I was setting async=false for everything I use, but it’s far from an ideal solution, so I started digging for better options and found this issue. Thanks a lot for spending time on this and for sharing the solution.
Can’t this be pushed to main until a better solution is found? I have spaceship-prompt as a git submodule in my config, and modifying it by hand is extremely annoying.
FTR Fedora still has this problem. I was showing the theme to a newbie on a clean F38 install with omz and all we ever saw was
...I guess that’s because Spaceship doesn’t handle worker failure properly. We have a todo-task for it here:
https://github.com/spaceship-prompt/spaceship-prompt/blob/master/lib/core.zsh#L61-L67
We should implement worker error handling, something like pure prompt has:
https://github.com/sindresorhus/pure/blob/main/pure.zsh#L507-L530
I also have the issue as @jamerst. I have the same setup, Fedora Workstation, Gnome Termnial, ZSH version.
I have disabled async untill the main issue is found.
@KyleOndy if you have old
async.zsh.zwccache file, it needs to be removed, otherwise it may not work.Setting the
$SPACESHIP_DIR_TRUNC_REPOvar tofalsewas enough for me to bypass the issue.spaceship v4.10.0 - zsh 5.8.1
The same issue still exists in v4.6.0 for me. Several sections are always blocked by
dir, while others don’t. Guess it is related to the running speed.My workaround is to disable
asyncfor those slow sections, such as:it’s still the same for me:
dir,venvandpythonare “blocking” theterrraformsection 😢Linux mint 20.3 una alacritty 0.10.1 tmux 3.3a zsh 5.9 (x86_64-pc-linux-gnu)
Hopefully this PR #1246 will help to partly resolve this problem.
This issue can cause printing of the prompt (or part of it) twice. In my case, having
gitin theSPACESHIP_PROMPT_ORDERlist will print part of my prompt, a line separator, then the entire prompt. There is a brief moment, less than a 10th of a second perhaps, where an async warning is displayed. I do not have to be in a git repository to experience this bug. AddingSPACESHIP_PROMPT_ASYNC=falsefixes the issue.Same issue as @anoduck here.
Not sure if this is related, but it sounds like they might be akin to one another. I just updated via antigen, and received something like
async worker not found: spaceship.Disabling async via the above command, stopped the error. It was extremely annoying there for a moment.