Repository navigation
Decode OSC 52 clipboard text as UTF-8 - #768
Merged
Merged
Conversation
ghostel--osc52-handle put the result of base64-decode-string on the kill ring as is. That is a unibyte string of the UTF-8 bytes the program sent, so non-ASCII text copied from a program in the terminal, such as tmux copy mode with set-clipboard, yanked into Emacs as octal escapes like \355\225\234. Pasting into other applications still worked, since the clipboard received the same bytes. Decode the bytes with utf-8-unix before putting them on the kill ring and the clipboard, so line endings stay as the program sent them.
Owner
|
Merged. Thanks. |
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.
When a program inside ghostel copies non-ASCII text over OSC 52 (tmux copy mode with
set-clipboard onin my case), yanking it in Emacs gives octal escapes:é,한글and👍yank as\303\251,\355\225\234\352\270\200and\360\237\221\215. Pasting into other apps is fine.ghostel--osc52-handleputs the output ofbase64-decode-stringon the kill ring directly, so it's a unibyte string of UTF-8 bytes. This decodes it first.Added a non-native test covering non-ASCII text and both line ending styles.
make testandmake lintpass.