clipetty icon indicating copy to clipboard operation
clipetty copied to clipboard

Add support for Mosh

Open spudlyo opened this issue 4 years ago • 9 comments

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!

spudlyo avatar Jan 23 '20 20:01 spudlyo

+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!

ceblan avatar May 01 '20 01:05 ceblan

Any progress on mosh integraion?

ztlevi avatar Sep 29 '20 04:09 ztlevi

how is go on this feature request?

shuxiao9058 avatar Jan 03 '21 06:01 shuxiao9058

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!

spudlyo avatar Jan 10 '21 01:01 spudlyo

any progress since a year?

ztlevi avatar Jan 07 '22 20:01 ztlevi

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

  • iPadOS (blink) -> ssh -> tmux -> emacs running remotely (both emacs and emacsclient with server)
  • iPadOS (blink) -> mosh -> tmux -> emacs running remotely (both emacs and emacsclient with server)

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}')\"".

nanzhong avatar Oct 24 '22 16:10 nanzhong

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

shlevy avatar Feb 07 '24 23:02 shlevy

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?

z3t0 avatar Feb 18 '24 05:02 z3t0