Replace null bytes with spaces in session read output#45
Open
d3dave wants to merge 1 commit into
Open
Conversation
Replace null bytes in screen contents with spaces.
Owner
|
@d3dave Thanks for the contribution and for the clear reproduction. After digging into this a bit more, I think this is probably an iTerm2-side issue rather than an From the iTerm2 side:
Because of that, I’m hesitant to merge a blanket My main concern is that this changes the raw output semantics in a way that could become a regression. If there are cases where a caller actually wants to observe the current I’m going to spend a bit more time looking into the iTerm2 side when I get a chance before deciding what the right fix is here. |
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.
Terminal cells that have never been written to are represented as
\0in the string returned byasync_get_screen_contents()(see [ScreenChar.h](https://github.com/gnachman/iTerm2/blob/9d71745f738f0e44b14160ae2ad08ea3fc441889/sources/ScreenChar.h#L254)). iTerm2 paints them as blank, but consumers that strip or normalize control characters collapse words together.Before:

After:
