You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just wanted to share this with the team; please feel free to close this issue. My work computer is kinda slow thanks to a corporate virus scanner. In particular, posh-git's Write-VCSStatus slows down my prompt, so I wanted to see if I could run it in a background thread. The result is messy, but it works!
It starts a worker thread in the background within which it loads posh-git. The prompt function sends a message to the worker thread asking it to run Write-VCSStatus. Powershell.OnIdle events are used to wait for the response and re-render the prompt via a call to PSReadline's API. Re-rendering doesn't affect text you've entered, so effectively you can keep working at the prompt and/or wait a second for git status to appear.
This has been tried before (#51, #52, #104), but I'm not opposed to trying it again with newer APIs. Why don't you open a PR with your code enabled by something like $GitPromptSettings.AsyncPrompt = $true so folks can test it out more easily?
I just wanted to share this with the team; please feel free to close this issue. My work computer is kinda slow thanks to a corporate virus scanner. In particular, posh-git's Write-VCSStatus slows down my prompt, so I wanted to see if I could run it in a background thread. The result is messy, but it works!
It starts a worker thread in the background within which it loads posh-git. The prompt function sends a message to the worker thread asking it to run Write-VCSStatus. Powershell.OnIdle events are used to wait for the response and re-render the prompt via a call to PSReadline's API. Re-rendering doesn't affect text you've entered, so effectively you can keep working at the prompt and/or wait a second for git status to appear.
https://gist.github.com/cspotcode/f45c9d92412becbe9201c8de63e4ff98
System Details
The text was updated successfully, but these errors were encountered: