spudlyo / clipetty

Manipulate the system (clip)board with (e)macs from a (tty)
GNU General Public License v3.0
167 stars 13 forks source link

Add support for Mosh #9

Open spudlyo opened 4 years ago

spudlyo commented 4 years ago

Clipetty depends on the SSH_TTY environment variable to determine if you're running on a local or remote host. This obviously doesn't work if you're logged in via Mosh.

I don't see any reason why we couldn't support Mosh, so let's make it work!

ceblan commented 4 years ago

+42 to mosh support!!!

Meanwhile, I'm able to benefit clipetty in mosh by making an ssh connetion and attaching from it to the same tmux session in mosh. Then, I can dettach the tmux session from the ssh tty but I need to keep the ssh connection up sine die in order to have clippety work in mosh. As soon as ssh connection is down, clipetty stops working in mosh.

Do you think if it would be posible to manually set SSH_TTY="mosh tty" (lets say /dev/pts/X or whatever the mosh tty is) inside emacs just to avoid the ssh connection workaround? Would it work this way?

Cheers!

ztlevi commented 3 years ago

Any progress on mosh integraion?

shuxiao9058 commented 3 years ago

how is go on this feature request?

spudlyo commented 3 years ago

I've discovered a way of getting OSC-52 escape sequences past tmux without having to rely on the SSH_TTY environment variable. This is good news in that there are a couple of issues that revolve around this environment variable becoming stale, or being otherwise modified.

I think there is a path forward for supporting Mosh!

ztlevi commented 2 years ago

any progress since a year?

nanzhong commented 1 year ago

For what it's worth, I've been making use of a workaround that addresses my use cases of:

I make use of printing the OSC 52 escape sequences to the tty associated with the current tmux pane, and that seems to work in both of those scenarios.

To do this I set clipetty-tmux-ssh-tty to "echo \"SSH_TTY=$(tmux display-message -p '#{pane_tty}')\"".

shlevy commented 7 months ago

@spudlyo Is this something a new contributor might be able to help with?

z3t0 commented 7 months ago

I am very interested in helping out on this. Just need a pointer in the right direction.

Is the solution just to write to stdout?

pweibert commented 3 weeks ago

With #33 I can copy to my clipboard in kitty mosh, kitty ssh, kitty local. It should not affect tmux functionality. But since I've never used tmux I would be glad if someone can confirm this.