Skip to content

support osc 52 clipboard copy integration.#899

Closed
acornejo wants to merge 1 commit intomobile-shell:masterfrom
acornejo:osc52
Closed

support osc 52 clipboard copy integration.#899
acornejo wants to merge 1 commit intomobile-shell:masterfrom
acornejo:osc52

Conversation

@acornejo
Copy link
Contributor

@acornejo acornejo commented Jul 15, 2017

This feature is particularly relevant for mosh for chrome (which is also used in windows I believe). Closes #637

PS: Someone should seriously consider running this codebase through clang-format, the coding style is all over the place, I did my best to be consistent with the existing style, but even simple things like tab/spaces are mixed in the codebase. If this is something the mantainers want, I would be happy to submit a pullrequest that passes the entire codebase through clang-format, together with a travis test that will fail for pull requests that don't follow the style.

@cgull
Copy link
Member

cgull commented Jul 24, 2017

Sorry to not respond to this earlier, I got reminded of this when looking at mosh-chrome issues.

This actually looks reasonable, and I'm considering pulling it for the next version of Mosh. The one thing I want to think about is that a 100KB paste is a relatively large object to be passing in a single SSP message, and I see a bit of potential for excessively-large messages getting packets dropped by too-short network queues, causing the session to stall.

Mosh has only ever promised to deliver a faithful, usable terminal window to the client; it's never promised to deliver any particular sequence of bytes reliably from server to client. This patch would bend that slightly, and it does require some arbitrary size limit (100KB actually seems fairly reasonable).

@keithw
Copy link
Member

keithw commented Jul 25, 2017 via email

This feature is particularly relevant for mosh for chrome (which also
used in windows I believe).
@acornejo
Copy link
Contributor Author

Thanks for the feedback. Changed max clipboard size to 16k, I think that is more than enough for most uses of the clipboard.

@alexbozhenko
Copy link

Hi, will this patch resolve the following:
MacOs Sierra 10.12.5 ->
ITerm2 3.0.15 -> "Applications in terminal may access clipboard" checkbox is set in preferences-general ->
ssh to centos 7 server -> start tmux 2.2 -> copy some text to tmux buffer -> this text also copied to mac clipboard

If I change ssh to mosh, tmux buffer doesn't appear in mac clipboard. Looks like tmux is using osc 52 to do that? If this patch would fix that, that would be awesome)

@acornejo
Copy link
Contributor Author

Yup, it will fix that too.

@alexbozhenko
Copy link

Wow, cool. Sorry, dumb question: do I need to patch both server and client side to make it work? I want to try to build it

@alexbozhenko
Copy link

Ok, I tried to build just client, and connecting with new client to old mosh server did not fix the issue with tmux clipboard that I described before.

@acornejo
Copy link
Contributor Author

acornejo commented Jul 28, 2017 via email

@cgull
Copy link
Member

cgull commented Aug 1, 2017

Pulled. Thanks!

@cgull cgull closed this Aug 1, 2017
@cgull
Copy link
Member

cgull commented Oct 9, 2017

@acornejo I forgot to follow up about the source-code formatting:

Where do you find the source code style to be badly inconsistent? I find it mostly consistent with Emacs formatting set for cc-mode, with 8-character tab stops, and KeithW's odd style of including spaces in parentheses in most contexts. ocb.cc is a major exception, because that was copied into the project, and there's value in retaining that security-critical code as contributed, for ease of comparison with the original and other forks. There's a few other files that are a little inconsistent but I haven't found it a major issue.

I personally would like to reformat the source (and get rid of the spaces around the parens, which really annoy me), but that's a project-wide decision.

I'd certainly like to see your clang-format machinery, or at least the clang-format invocation you use, to see what we might get-- I haven't used it much myself, and not for quite a while.

@dohsimpson
Copy link

Ok, I tried to build just client, and connecting with new client to old mosh server did not fix the issue with tmux clipboard that I described before.

Yep, you need to build the server and the client.

@andersk andersk mentioned this pull request Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mosh does not transmit OSC 52 sequence to client

5 participants