[PR #7870] Fix garbling when copying multibyte text via OSC 52 #27013

Closed
opened 2026-01-31 09:19:28 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/7870

State: closed
Merged: Yes


This commit adds a missing conversion utf8 to utf16 in decoding base64
for handling multibyte text in copying via OSC 52.

Validation Steps Performed

  • automatically
    • Tests w/ multibyte characters
  • manually
    • case1
      • Executed printf "\x1b]52;;%s\x1b\\" "$(printf '👍👍🏻👍🏼👍🏽👍🏾👍🏿' | base64)"
      • Verified 👍👍🏻👍🏼👍🏽👍🏾👍🏿 in my clipboard
    • case2
      • Copied 👍👍🏻👍🏼👍🏽👍🏾👍🏿 by tmux 2.6 default copy function (OSC 52)
      • Verified 👍👍🏻👍🏼👍🏽👍🏾👍🏿 in my clipboard

Closes #7819

**Original Pull Request:** https://github.com/microsoft/terminal/pull/7870 **State:** closed **Merged:** Yes --- This commit adds a missing conversion utf8 to utf16 in decoding base64 for handling multibyte text in copying via OSC 52. ## Validation Steps Performed * automatically * Tests w/ multibyte characters * manually * case1 * Executed `printf "\x1b]52;;%s\x1b\\" "$(printf '👍👍🏻👍🏼👍🏽👍🏾👍🏿' | base64)"` * Verified `👍👍🏻👍🏼👍🏽👍🏾👍🏿` in my clipboard * case2 * Copied `👍👍🏻👍🏼👍🏽👍🏾👍🏿` by tmux 2.6 default copy function (OSC 52) * Verified `👍👍🏻👍🏼👍🏽👍🏾👍🏿` in my clipboard Closes #7819
claunia added the pull-request label 2026-01-31 09:19:28 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27013