spudlyo/clipetty

Add support for Mosh

Opened this issue · 8 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!

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

Any progress on mosh integraion?

how is go on this feature request?

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!

any progress since a year?

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

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

z3t0 commented

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?