fix(tui): drop NUL characters before clipboard writes - #44230
Open
aniruddhaadak80 wants to merge 1 commit into
Open
fix(tui): drop NUL characters before clipboard writes#44230aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential duplicate found:
The current PR (#44230) and PR #44197 both target the TUI clipboard functionality and likely address overlapping concerns. You may want to review PR #44197 to ensure there's no duplication of work. |
Author
|
The unit test and typecheck workflows are in action_required state - could a maintainer approve the workflow runs for this first-time contribution? Local verification: packages/tui tests pass and typecheck is clean. |
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.
Issue for this PR
Closes #44198
Type of change
What does this PR do?
Shell output can contain NUL characters, and clipboard backends reject text that contains them (e.g. spawn refuses argv with NUL bytes on macOS), so
/copyfails and the clipboard is left unchanged. This drops NUL characters from the text inwrite()before it reaches any backend (OSC52 included), matching the behavior requested in the issue.How did you verify your code works?
withoutNulcovering NUL-containing and clean input (bun test test/clipboard.test.tsinpackages/tui, all pass).bun run typecheckinpackages/tuisuccessfully.Screenshots / recordings
Not a UI change.
Checklist