Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osc52 support for hterm paste to clipboard #40

Closed
shirro opened this issue Mar 1, 2014 · 15 comments
Closed

osc52 support for hterm paste to clipboard #40

shirro opened this issue Mar 1, 2014 · 15 comments

Comments

@shirro
Copy link

shirro commented Mar 1, 2014

hterm supports osc52 to write from the term to the system clipboard. There are examples of a shell command and vim plugin in libapps/hterm/etc. I have found this works well with Chrome Secure Shell packaged app but when I use mosh, either the packaged app or start mosh over Secure Shell the osc sequence doesn't appear to get through the mosh terminal emulation.

This is probably an upstream issue for mosh. I added a comment at mobile-shell/mosh#382 (comment) but I don't know if it is something that would be fixed upstream. It might be an idea to patch mosh for mosh-chrome because this limits mosh-chrome compared with the Secure Shell app that sets expectations on Chrome. I have looked at the mosh terminal emulation and unfortunately c++ isn't my thing. It looks like they capture OSC sequences and use them for set title and possibly discard the rest but I am not sure how to fix it.

btw tmux also eats osc52 which limits usefullness until I can find a patch for that as well. if testing make sure you aren't running tmux.

@rpwoodbu
Copy link
Owner

rpwoodbu commented Mar 9, 2014

I hear what you're saying about feature parity with Secure Shell and the expectations of Chrome users. However, I've got bigger fish to fry right now. Maybe someone else will see this bug and volunteer their C++ chops to the cause. But I will say that this really needs to make it upstream. I'd consider cherrypicking the fix from upstream if an upstream Mosh release were a long way off, just to get it in a little sooner since it is a matter of feature parity with Secure Shell.

@shirro
Copy link
Author

shirro commented Mar 9, 2014

That makes sense.

One thing that has made it upstream is vt100 mouse mode. In Chrome Secure Shell I can select panes in tmux, drag borders to resize, move cursor in vim etc.

Would you consider cherry picking something like that? mobile-shell/mosh#461

@rpwoodbu
Copy link
Owner

keithw@ has suggested there will be a Mosh release this summer, so I'm inclined to wait instead of cherrypicking.

@sunaku
Copy link

sunaku commented Dec 2, 2014

👍 @shirro this is a showstopper for me as well: I rely on OSC-52 to yank text to my system clipboard. 😱

@rpwoodbu
Copy link
Owner

At long last, there has been an upstream mosh release, which was brought in by SHA 89ac2b2. This should add the mouse support you (@shirro) mentioned. I do not know if it adds the osc52 thing. Let me know if it does, and I can close this out. This will hit the dev channel tonight.

@sunaku
Copy link

sunaku commented Jul 27, 2015

@rpwoodbu Thanks! Under initial tests, the new mosh 1.2.5 seems to have fixed OSC-52. 👍

I need to test this on other machines though. I'll reply in (hopefully) a few days with an answer.

@cgull
Copy link

cgull commented Jul 28, 2015

That's interesting. We definitely did not add support for OSC-52 in mosh.

It's a non-trivial feature request; it's another variation of the "but I want this reliable byte stream" problem.

@sunaku
Copy link

sunaku commented Jul 29, 2015

@cgull you're right 😞, I finally got to test mosh 1.2.5 on a remote server and OSC-52 doesn't work. 😓 What happened in my initial (localhost) test was that my yank script also used X11 to copy text into my system clipboard, as a fallback, creating the illusion that mosh was actually passing OSC-52 through. 😅

@rpwoodbu
Copy link
Owner

Realizing from @cgull's comment that this requires a non-trivial enhancement to the upstream mosh which isn't likely coming anytime soon, I'm going to close this for now. Please ping this when/if this becomes available upstream, and I'll reopen.

@acornejo
Copy link

I am trying to switch to chrome os, and using mosh is part of that effort. This is a big issue for me.

Could we reopen this issue? I am happy to contribute a patch for this.

@acornejo
Copy link

I have implemented this in pull request
mobile-shell/mosh#899

I am a bit weary though, since I see there are multiple PR's on that project, some of them over a year old that have not received a single comment from the mantainers.

@rpwoodbu
Copy link
Owner

rpwoodbu commented Jul 16, 2017

I'll gladly reopen this (if needed) once your PR is in an official upstream Mosh release.

It isn't terribly difficult to build Mosh for Chrome, nor build it using your GitHub fork of the upstream Mosh which has your fixes, so you could get this in for yourself sooner. There's some documentation on building Mosh for Chrome in the GitHub wiki.

@acornejo
Copy link

Sounds good. Hopefully one of the mosh maintainers can take a look over the patch and send me some feedback so that it eventually gets merged.

Perhaps @cgull would be interested in taking a look, since I see he commented on this bug as well.
The patch is simple enough, I piggy backed into the existing OSC infrastructure that handled terminal title changes to handle clipboard changes as well, so I am hoping it wont be too controversial.

Regarding building+running my own fork... when I was younger I enjoyed running my forked versions of everything (including obscure kernel patches). These days I am too old/lazy/busy to keep up with that. In fact this is part of the reason I am giving chrome os a try (coming from linux), so having to use it with customized extensions that I maintain kind of defeats the point.

Of course, if it turns out that its impossible for me to get this feature without building my own fork, I will read up on the wiki and revisit this decision.

@acornejo
Copy link

acornejo commented Aug 2, 2017

mobile-shell/mosh#899 got merged.

Could we get a new mosh-chrome release?

@rpwoodbu
Copy link
Owner

rpwoodbu commented Aug 2, 2017

@acornejo Glad you got your PR in! However, I stick with the actual released versions of the upstream Mosh code, so we'll need to wait until they do another release. They just did one (and I haven't quite gotten that out the door yet, still only in the dev track), so it may be a little bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants