Asyncronous prompt updates#1117
Open
philocalyst wants to merge 4 commits into
Open
Conversation
experimented with using the flag directly and found it hard to read
2 tasks
There was a problem hiding this comment.
Pull request overview
Adds an asynchronous repaint mechanism to Reedline so the prompt can be re-evaluated and redrawn in-place while read_line() is active, enabling non-blocking prompt updates (e.g., async git status).
Changes:
- Introduces a new public
RepaintSignalhandle for requesting a prompt repaint from another thread. - Updates the input loop to periodically poll for repaint requests (and repaint when requested).
- Adds unit tests validating repaint request consumption, handle sharing behavior, and polling activation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Author
|
Resolved comments |
…ting logic think that the refactor makes it overall more readable, and for me, isolates concerns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
So this fixes my own issue #1045. It's meant to be composed with an upcoming Nushell PR, which I will link here when I have it up. My biggest motivation is that I'm working on changes to starship that should bring these different kinds of prompts to users, and nushell is my daily driver. Wanted it here too, of course :0
Before
Before this, there existed no way to repaint the prompt after the first pass.
After
After this, the mechanism exists for repainting, opening use-cases for things like:
Additional notes