Open FaisalBudiono opened 9 months ago
@mafredri I will glad to hear the follow up from you
Hi, it's a bit unclear to me in what situations this can help, could you give an example? Delaying the async job here won't change the environment since async jobs are started in a sub shell, so I'm thinking the issue must be something else.
Hi, it's a bit unclear to me in what situations this can help, could you give an example? Delaying the async job here won't change the environment since async jobs are started in a sub shell, so I'm thinking the issue must be something else.
Here is a better explanation for this https://github.com/spaceship-prompt/spaceship-prompt/issues/1193#issuecomment-1722579999 I'm not adept in shell scripting, so I'm just suggesting his fix
Hey @mafredri, I am a @spaceship-prompt maintainer. I've described the problem over here: https://github.com/mafredri/zsh-async/issues/58
We dug down to the bottom of this issue, and it seems like this can resolve the issue.
I tested these changes on my server machine. Seems like the delay of sleep 0.5
is enough for me to kick async job in. Now it works as expected.
This sleep duration will be used to give a leeway time for some terminals that haven't loaded all the necessary scripts when the async job is being dispatched. In some cases, it will make the async job not working properly or even not running at all.
We set the default sleep duration as
0
to keep backward compatibility with the previous version and it can be changed through ENV.This is also a follow up to #58