-
Notifications
You must be signed in to change notification settings - Fork 789
Description
I would really love a way to let the remote server send short messages back to the client, where mosh can then pass them to an external program. The use-case here is I use mosh to connect to irssi, and I really want some way for irssi to notify me on highlights, but since it's running remotely, it can't do it. I figured Mosh could define some escape sequence that accepts messages up to a specified length (something short but not unreasonably short, like maybe 512 or 1024 bytes), and guarantees delivery (in sequence) to the client, similar to how it handles keyboard events. On the client side, a flag can be used to denote an external program that will be called with each message (either called once per message, or perhaps invoked at connection and messages passed to it over a pipe, using some framing (such as byte count, newline, message, newline).
Using this mechanism, I could then write a script for irssi that prints that escape sequence to the terminal, along with a JSON blob containing information on the highlight, and I could write a program on the local side that displays OS X notifications for the messages.
I could theoretically do this all for an SSH connection, but because of how mosh handles the screen, I can't rely on that sort of thing working for mosh (especially because I don't know how mosh reacts to unknown escapes).