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

Wishlist: Copy Buffer #382

Closed
theeternalsw0rd opened this issue Jan 20, 2013 · 6 comments
Closed

Wishlist: Copy Buffer #382

theeternalsw0rd opened this issue Jan 20, 2013 · 6 comments

Comments

@theeternalsw0rd
Copy link

It would be awesome if there was some way to send text from the server to the client.

The way it would work:

mosh-server would need to be able to take input from stdin and send it to mosh-client in much the same way that the text in the terminal is sent over. mosh-client would need to be able to receive the buffer from mosh-server and be able to store it in a user-specific manner. The user should be able to have mosh-client grab the most recent buffer and place it in stdout.

Use case:

Open a file in vim on the remote end. Make a selection in visual mode. Press a hotkey that runs a command on mosh-server saving the text in the session buffer. Or select some text in a tmux pane that's configured to run the command on the selection. On the local side, press a hotkey that runs a command on mosh-client grabbing the buffer and piping it to pbcopy/xclip/clip or whatever the local side wants to use.

Why not just copy with the mouse?

Terminals have problems with split buffers, so any of these scenarios make copying text to the local end problematic: vim with line numbers; vim with split windows; anything inside a tmux pane. I'm sure there are other scenarios as well.

Why only copy?

mosh already handles local pasting fine, so there's really only the need for remote copy.

Why should mosh do this and not something else?

There's already a connection using mosh that sends text back and forth, so why make some other protocol that uses yet another port and connection? It might be nicer if terminals would be fixed to be more content aware, but that would I think be a much larger undertaking than this.

@barosl
Copy link
Contributor

barosl commented May 29, 2013

This seems to be useful, because I also get some troubles while copying text from the remote end.

But isn't the feature beyond the range that should be covered by mosh? I'm not against the idea, just curious as I'm not familiar with the mosh development. If it is determined to be OK, I may consider working on this. Any ideas from others?

@nicowilliams
Copy link

Having the server be able to send arbitrary content to the client's
clipboard might not be so good if you don't trust the server, so this
would have to be something that could be turned off (and probably
should default to off).

@shirro
Copy link

shirro commented Mar 1, 2014

I noticed the hterm terminal emulation that runs in chrome supports OSC52 to write to the clipboard but doesn't allow read for obvious security reasons. It only supports a limited number of characters but I have found it good enough.

I can use this with the chrome Secure Shell packaged app and a remote shell command or a vim plugin to send to my clipboard. If I go through a mosh session, either using mosh compiled with nacl into a packaged app or out of an ssh session I lose this ability. I expect it is something in mosh's terminal emulation. Is there any chance this could be passed through? Then any questions about security can be left to the users terminal emulator to decide.

Interestingly tmux also blocks this sequence as does screen. The hterm example bypasses screen by chunking the sequence and passing it in DCS sequences but that doesn't work with mosh either.

@BretFisher
Copy link

This is said to work if your mosh-client is OSX and your connection doesn't get interrupted, but yea, having mosh support ssh's RemoteForward would be better: https://github.com/wincent/clipper#configuring-mosh

@chtlp
Copy link

chtlp commented Nov 14, 2018

Hope mosh has this feature as well! Remote clipboard over mosh would be very useful.

@achernya
Copy link
Collaborator

Marking this as a duplicate of #637 which has open PRs

@achernya achernya closed this as not planned Won't fix, can't repro, duplicate, stale Jan 20, 2023
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

No branches or pull requests

7 participants