Skip to content

Decode mixed UTF-16 clipboard text - #7466

Merged
dhh merged 3 commits into
quattrofrom
fix/clipboard-mixed-utf16
Aug 19, 2026
Merged

dhh merged 3 commits into
quattrofrom
fix/clipboard-mixed-utf16

Conversation

@dhh

@dhh dhh commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Decode BOM-less UTF-16 clipboard text when most code units have consistent padding.
  • Allow mixed Unicode punctuation, CJK, and emoji without misclassifying sparse NUL-separated UTF-8.
  • Add regression coverage for little- and big-endian payloads and ambiguous fallbacks.

Testing

  • bash test/shell.d/clipboard-test.sh
  • Replayed the affected live-history payload: 185 decoded characters, zero NULs, zero replacements.
  • Visually verified the list row and detail pane in the running clipboard panel.

Copilot AI balanced review requested due to automatic review settings August 19, 2026 09:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves clipboard capture by detecting BOM-less UTF-16 text with mixed Unicode content while preserving ambiguous UTF-8 payloads.

Changes:

  • Adds padding-based UTF-16LE/BE detection.
  • Adds regression coverage for Unicode and NUL-separated UTF-8.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
shell/plugins/clipboard/capture.sh Implements mixed-content UTF-16 detection.
test/shell.d/clipboard-test.sh Covers endian variants and ambiguous fallback behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings August 19, 2026 09:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings August 19, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@dhh
dhh merged commit 238021c into quattro Aug 19, 2026
4 checks passed
@dhh
dhh deleted the fix/clipboard-mixed-utf16 branch August 19, 2026 10:01
torturado pushed a commit to torturado/omarchy that referenced this pull request Aug 19, 2026
* Decode mixed UTF-16 clipboard text

* Harden UTF-16 clipboard detection

* Finish UTF-16 decoder hardening
sgruendel pushed a commit to sgruendel/omarchy that referenced this pull request Aug 22, 2026
* Decode mixed UTF-16 clipboard text

* Harden UTF-16 clipboard detection

* Finish UTF-16 decoder hardening
dhh added a commit that referenced this pull request Aug 23, 2026
* Decode mixed UTF-16 clipboard text

* Harden UTF-16 clipboard detection

* Finish UTF-16 decoder hardening

(cherry picked from commit 238021c)
@dhh dhh mentioned this pull request Aug 23, 2026
nick1udwig pushed a commit to nick1udwig/omarchy that referenced this pull request Sep 9, 2026
* Decode mixed UTF-16 clipboard text

* Harden UTF-16 clipboard detection

* Finish UTF-16 decoder hardening
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants