Improve interactive shell performance for pasted user input #15684
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.
Improves the interactive shell performance when reading user input.
Note that this functionality is behind a feature flag, enabled with:
Before
When a user pastes the following input into their interactive
shell -it
:The input is read a character at a time, and the user has to wait for the buffer to be read:
![before](https://user-images.githubusercontent.com/60357436/133770396-418469ed-683f-4f90-b8d9-471563b59788.gif)
After
The user input is read 1024 characters at a time, and there's no longer any noticeable lag:
![after](https://user-images.githubusercontent.com/60357436/133770406-ad13d141-27fc-423e-9097-a52514557181.gif)
Verification
shell -it