Repository navigation
Increase stdin chunksize from 16 to 1024 chars - #771
Merged
Tess Gauthier (tgauth) merged 1 commit intoJan 13, 2025
Merged
Conversation
Leonard Hecker (lhecker)
force-pushed
the
stdin-chunk-size
branch
from
December 20, 2024 15:37
c410dd6 to
82b00b5
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Dustin L. Howett (DHowett)
approved these changes
Dec 20, 2024
Tess Gauthier (tgauth)
approved these changes
Jan 13, 2025
Tess Gauthier (tgauth)
left a comment
Collaborator
There was a problem hiding this comment.
Thanks Leonard Hecker (@lhecker)!
|
I believe the issue addressed herein is the cause of my troubles when pasting from the clipboard into a file being edited with the nano editor on a linux computer, which uses "bracketed pastes". Sometimes the "end of pasted text" ESCAPE sequence is being broken up. PuTTY works fine, but the windows ssh client has issues. I started a discussion here a few days ago. |
3 tasks done
Hazel Duvall (hazelduvall)
pushed a commit
to hazelduvall/openssh-portable
that referenced
this pull request
May 6, 2026
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.
PR Summary
This bumps the chunk size for
stdinfrom 16 to 1024 chars.PR Context
It would be very unusual to
read()from a file with a 16-byte buffer.The same is true for
stdin, but counter-intuitively it's actuallya lot "more true" for
stdinthan it would be for any file:Since the
stdinpipe is unbuffered and synchronous, the round-tripoverhead for reading from it is exorbitantly high. To put it into
perspective, on Windows the call overhead alone is roughly the same
as subsequentially reading in the order of 100K characters.
The increased buffer size has an immediately noticeable effect on
the interactive shells I've tested. Pasting content into a prompt now
appears immediately and atomically, while previously it would only
progressively arrive and get syntax highlighted repeatedly (= flicker).
Another nice benefit is that some shells have trouble determining
whether an escape character is a sequence inducer or a lone escape
character. Increasing the buffer size reduces the chance for hitting
this edge case from 1/16th (6%) to 1/1024th (0.1%) and makes it
very unlikely to occur at all for inputs <1024 characters.
This issue is what prompted me to make this modification.