mafredri / zsh-async

Because your terminal should be able to perform tasks asynchronously without external tools!
MIT License
756 stars 37 forks source link

Add sleep duration that configurable via ENV #67

Open FaisalBudiono opened 9 months ago

FaisalBudiono commented 9 months ago

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

FaisalBudiono commented 9 months ago

@mafredri I will glad to hear the follow up from you

mafredri commented 9 months ago

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.

FaisalBudiono commented 9 months ago

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

denysdovhan commented 9 months ago

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.

denysdovhan commented 9 months ago

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.