Run prompts asynchronously #482
Closed
Milestone
Comments
This would be very nice, with a couple of considerations:
|
Are there any shells that currently do this right? This would be a pretty nice feature and hugely increase the perceived 'performance' of Elvish for people who use VCS prompts. |
Good news, this has landed in master. To see it in action, try this: edit:prompt = { echo 'slow prompt'; sleep 1 }
edit:-prompts-max-wait = 0.05 Read dd2d36a for a detailed explanation and caveat. |
zzamboni
added a commit
to zzamboni/dot-elvish
that referenced
this issue
Nov 14, 2017
With Elvish now supporting prompt caching (elves/elvish#482), I have removed the whole caching implementation from the prompt, which was messy and unreliable. I have also used the opportunity to write the code in literate programming style, using org-mode. See chain.org for the fully documented source code, from which chain.elv is generated. For an excellent introduction to literate programming using org-mode, see http://www.howardism.org/Technical/Emacs/literate-programming-tutorial.html.
@xiaq this is great! I have vastly simplified my chain theme implementation thanks to this new feature. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes prompts can take a long time and will block the UI. In that case, Elvish can render the prompt as a placeholder (say "?") and update it when the function completes.
The text was updated successfully, but these errors were encountered: