Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sleep duration that configurable via ENV #67

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FaisalBudiono
Copy link

@FaisalBudiono FaisalBudiono commented Oct 1, 2023

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

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.
@FaisalBudiono
Copy link
Author

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

@mafredri
Copy link
Owner

mafredri commented Oct 2, 2023

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
Copy link
Author

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 spaceship-prompt/spaceship-prompt#1193 (comment)
I'm not adept in shell scripting, so I'm just suggesting his fix

@denysdovhan
Copy link

Hey @mafredri, I am a @spaceship-prompt maintainer. I've described the problem over here: #58

We dug down to the bottom of this issue, and it seems like this can resolve the issue.

@denysdovhan
Copy link

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.

@andybarron
Copy link

i can confirm i'm still experiencing the issue with spaceship on WSL2, so this fix would still be appreciated, at least until an underlying cause can be found/fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants