OSC52 does not handle UTF-8 correctly ("copying content using tmux copy mode doesn't paste properly") #10882

Closed
opened 2026-01-31 02:32:42 +00:00 by claunia · 4 comments
Owner

Originally created by @Axedyson on GitHub (Oct 3, 2020).

Environment

Windows build number: Microsoft Windows [Version 10.0.19041.508]
Windows Terminal version: 1.3.2651.0

Other software:

Tmux version: tmux 3.0a
Running Ubuntu 20.04.1 LTS inside of WSL2

Steps to reproduce

All the steps to reproduce this issue are stated in this issue that I created.
Please read that issue as it contains some more information about my environment and some relevant comments.

It seems like this issue doesn't relate to a problem with tmux but rather a problem with the Windows Terminal or the windows clipboard.

Expected behavior

When I copy content using tmux copy mode I would like to have the ability to paste it outside of tmux containing the exact same characters which can be seen here in a browser search bar:
image

Actual behavior

The content is not pasted properly as this character shows up as cryptic characters:
image

Originally created by @Axedyson on GitHub (Oct 3, 2020). # Environment Windows build number: `Microsoft Windows [Version 10.0.19041.508]` Windows Terminal version: 1.3.2651.0 Other software: Tmux version: `tmux 3.0a` Running Ubuntu 20.04.1 LTS inside of WSL2 # Steps to reproduce All the steps to reproduce this issue are stated in this [issue](https://github.com/tmux/tmux/issues/2407) that I created. Please read that issue as it contains some more information about my environment and some relevant comments. It seems like this issue doesn't relate to a problem with tmux but rather a problem with the Windows Terminal or the windows clipboard. # Expected behavior When I copy content using tmux copy mode I would like to have the ability to paste it outside of tmux containing the exact same characters which can be seen here in a browser search bar: ![image](https://user-images.githubusercontent.com/28491857/94988784-14e59b80-0570-11eb-98d6-faba599bc93f.png) # Actual behavior The content is not pasted properly as [this character](https://www.fileformat.info/info/unicode/char/2019/index.htm) shows up as cryptic characters: ![image](https://user-images.githubusercontent.com/28491857/94988868-b1a83900-0570-11eb-9fd9-0704382046a7.png)
Author
Owner

@DHowett commented on GitHub (Oct 5, 2020):

/cc @uzxmx
It looks like s_Decode in base64 is transforming the raw bytes that come out of the base64 encoded clipboard data directly into UCS-2 codepoints instead of running them through UTF-8->UTF-16 conversion.

@DHowett commented on GitHub (Oct 5, 2020): /cc @uzxmx It looks like `s_Decode` in base64 is transforming the raw bytes that come out of the base64 encoded clipboard data _directly into UCS-2 codepoints_ instead of running them through UTF-8->UTF-16 conversion.
Author
Owner

@PetterS commented on GitHub (Oct 13, 2020):

In the meantime, you can execute tmux show-buffer | clip.exe which will put the correct string on the Windows clipboard.

@PetterS commented on GitHub (Oct 13, 2020): In the meantime, you can execute `tmux show-buffer | clip.exe` which will put the correct string on the Windows clipboard.
Author
Owner

@ghost commented on GitHub (Nov 11, 2020):

:tada:This issue was addressed in #7870, which has now been successfully released as Windows Terminal v1.4.3141.0.🎉

Handy links:

@ghost commented on GitHub (Nov 11, 2020): :tada:This issue was addressed in #7870, which has now been successfully released as `Windows Terminal v1.4.3141.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.4.3141.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Nov 11, 2020):

:tada:This issue was addressed in #7870, which has now been successfully released as Windows Terminal Preview v1.5.3142.0.🎉

Handy links:

@ghost commented on GitHub (Nov 11, 2020): :tada:This issue was addressed in #7870, which has now been successfully released as `Windows Terminal Preview v1.5.3142.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.5.3142.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10882