mobile-shell / mobile-shell/mosh

Advertise support for OSC 52 in DA1 response

Open
#1,399 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
14.5k
Forks
865
PR merge metrics
No merged PRs in 30d

Description

It's becoming an informal standard to advertise support for OSC 52 (copy to clipboard) in the DA1 (primary device attributes) response. See https://github.com/contour-terminal/vt-extensions/blob/master/clipboard-extension.md for some details and emulators/applications that support it (includes mainline emacs and neovim!). As for the requirements set forth in the linked document:

  • "Conforming terminals MUST at least support an empty Pc value, and a Pc value of c. Other values are optional." Mosh supports Pc being c. It does not support it being empty yet, but there are a couple open PRs to fix this (#1054 and #1104).

    In practice, it could make sense to start advertising support even before supporting empty Pc because many applications that look for this OSC 52 support advertisement (eg Emacs) still primarily use Pc=c

  • "Conforming terminals MUST support a Pd value that is a base64 encoded representation of the content that will be copied to the clipboard." -- already supported

As it stands right now, Emacs under Mosh will autodetect that copy to clipboard is not supported and simply will not attempt it, even though there is enough support there.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the code that generates Mosh's DA1 (primary device attributes) response and read the linked OSC 52 clipboard extension details. Advertise OSC 52 support with the supported Pc=c value while preserving the existing Pd clipboard behavior; verify the resulting DA1 response and clipboard interoperability with an application such as Emacs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
66/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.