Open jiaxincao opened 4 years ago
Yeah, this is a bug in #899 that I pointed out before (but thanks for opening an issue for it).
@andersk , I don't think we are talking about the same issue. I see the issue reported even with your fix. Mosh refuses to transfer any OSC 52 code to the terminal if it was the same one with the last time.
We’re talking about the same issue: see item 2 of my comment that I linked. I didn’t say it was fixed, much less by me.
Ah, you are right. So it seems like this is an issue that is still opening, correct?
Do you know why a clipboard cache was introduced in mosh? Why can we just sent the OSC 52 to the terminal only when the remote shell (or terminal applications) decides to do it?
https://github.com/mobile-shell/mosh/blob/0cc492dbae2f6aaef9a54dc2a8ba3222868b150f/src/terminal/terminaldisplay.cc#L114
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.
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?