Skip to content

Mosh clipboard issue #1090

@jiaxincao

Description

@jiaxincao

if (f.get_clipboard() != frame.last_frame.get_clipboard()) {

It seems like that mosh is trying to create a clipboard caching to avoid OSC 52 clipboard delivery if the text is the same with the last time. However, this introduces a problem. Think of the following scenario, I'm using emacs in a remote server from my laptop via mosh, and trying to copy texts with OSC 52. I took the following steps.

  1. My remote emacs sends a OSC 52 to deliver abc as the clipboard text. My local laptop clipboard and the mosh clipboard are both abc for now.
  2. I copy something else (e.g., xyz) from another application on my local side, say, chrome. My local laptop clipboard is now xyz. The mosh clipboard is unchanged, which is still abc.
  3. I went back to my remote emacs, and tries to send a OSC 52 to deliver abc to my local terminal again. However, this time, since the mosh clipboard still has the abc, it'll refuse to deliver OSC 52 with text abc to my terminal, which means that abc will not be copied to my local laptop clipboard.

I think the fundamental issue here is that mosh tries to do the clipboard caching, while there is no guarantee that the mosh cached clipboard is in sync with the local system clipboard. Anyone agree on this? Any workaround?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions