-
Notifications
You must be signed in to change notification settings - Fork 305
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
Generate OnIdle
event only if the editing buffer is empty
#2934
Conversation
🎉 |
I understand the issue you are trying to address, I'm not sure this is the right fix. For example, without PSReadLine, the experience is still ugly. I think it'd be better to find a better solution than using OnIdle for any sort of UI experience. |
Right, totally agree that using |
Fine, but this change will probably affect people not using |
Yes, that's absolutely possible. But I think the impact should be quite low, as |
I also opened the doc issue MicrosoftDocs/PowerShell-Docs#8270 to have this behavior documented (not now, but I will submit a doc PR after a while if there is no feedback about this change). |
I would also mention it as a low risk breaking change in the release notes for better visibility. |
Done, updated the GitHub release page: https://github.com/PowerShell/PSReadLine/releases/tag/v2.2.0-beta4 |
PR Summary
Generate
OnIdle
event only if the editing buffer is empty. But if there is any other event subscribers, we still run the dummy pipeline to allow potential event handling.OnIdle
event by definition is not an event that need urgent processing, and sometimes it's used by module/script to output a message, e.g.Az.Predictor
uses it to write out a ask-for-survey message. Having this event to fire when the user already input something in the buffer is not a good experience for the user. See the following screenshot as an example.With this PR, we generate the
OnIdle
event only if the editing buffer is empty. But for any other event subscribers, we still run the dummy pipeline to allow potential event processing for them even if the editing buffer is not empty.PR Checklist
OnIdle
event is fired only when the editing buffer is empty MicrosoftDocs/PowerShell-Docs#8270Microsoft Reviewers: Open in CodeFlow