Detect support for OSC 52 using the device attributes report#4539
Closed
j4james wants to merge 1 commit intotmux:masterfrom
j4james:osc52-detection
Closed
Detect support for OSC 52 using the device attributes report#4539j4james wants to merge 1 commit intotmux:masterfrom j4james:osc52-detection
j4james wants to merge 1 commit intotmux:masterfrom
j4james:osc52-detection
Conversation
This is an extension agreed upon by modern terminals to indicate that they support copying to the clipboard with XTerm's OSC 52 sequence. On terminals that can disable clipboard access, this extension is only reported when writing to the clipboard is actually allowed, so this is a more reliable indicator than the Ms terminfo capability.
Author
|
@nicm I'm not sure if this is what you had in mind, but I've tested on Windows Terminal by setting my |
craigbarnes
added a commit
to craigbarnes/dte
that referenced
this pull request
Jun 23, 2025
Indicating support for `OSC 52` like this is quite a recent initiative, but terminal-side support has already been merged in foot, WezTerm, Contour and Windows Terminal. To me, it seems like a much more sensible interface than the existing `XTGETTCAP` and `XTQALLOWED` methods (although dte does already support the former). See also: * contour-terminal/contour#1761 (comment) * https://github.com/contour-terminal/vt-extensions/blob/master/clipboard-extension.md#feature-detection * https://codeberg.org/dnkl/foot/pulls/2130 * https://github.com/wezterm/wezterm/pull/7046/files * microsoft/terminal#19034 * tmux/tmux#4532 * tmux/tmux#4539 Additional context for why I consider `XTGETTCAP` flawed: * https://codeberg.org/dnkl/foot/issues/1701 * ghostty-org/ghostty#1699
Member
|
Applied to OpenBSD now, will be in GitHub later. Thanks! |
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Detect support for OSC 52 using the device attributes report
This is an extension agreed upon by modern terminals to indicate that
they support copying to the clipboard with XTerm's OSC 52 sequence.
On terminals that can disable clipboard access, this extension is only
reported when writing to the clipboard is actually allowed, so this is
a more reliable indicator than the Ms terminfo capability.
Fixes #4532