[mosh-devel] How to support xterm modifier key setting (CSI > Ps; Ps m)

Erik Hons erik.hons at gmail.com
Sat May 26 16:18:05 EDT 2018


I'm trying to make emacs work well inside mintty/mosh. I'd like mintty
to send an alternate escape sequence for "C-Backspace" than the
default (which is "C-_"). There is an xterm sequence for this --
"\e[>4;1m" -- which sets the "modifyOtherKeys" resource. Emacs sends
that sequence on startup. When using ssh for remoting, the sequence is
passed to the client side, mintty sees it, and implements the desired
behavior.

The mosh terminal emulator appears to discard the sequence. There is
no matching function in terminal/terminalfunctions.cc defined for it,
so the dispatch process hits the "unknown function" condition in
terminal/terminaldispatcher.cc at 226 (Dispatcher::dispatch()).

As an experiment, I've added a terminal function for "\e[>4;1m" and
confirmed that it sees the sequence when emacs sends it. I'm stuck on
what to do next.

It looks like I need to add something to Terminal::DrawState, then in
Display::new_frame() look for that member and call
frame.append("\e[>4;1m"); That's how the "mouse_reporting_mode" and
similar settings are handled.

But this might bring up a bigger question: How should the mosh
terminal emulator interact with the client side terminal emulator? I
can add support for this specific sequence, but maybe something more
general is warranted.

Any advice?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/mosh-devel/attachments/20180526/c4c6276e/attachment.html


More information about the mosh-devel mailing list