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.
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.