<div dir="ltr">Hi Erik,<div><br></div><div>I'm a little confused why you want this in general, and it may relate to a design weakness in Mosh, which is that it basically assumes that the client terminal acts like an xterm. By default, an xterm sends Ctrl-H (0x08) when the user types "Ctrl-Backspace" (and VTE seems to also follow this convention). Mosh advertises to the remote host that it is an xterm (or xterm-256color) and *basically* just sends bytes from the user's terminal through to the host unchanged. For terminals that act a little differently (e.g. rxvt), we have some long-lived bugs related to Mosh's failure to translate from the terminal-generated escape codes to what the application is (rightly) expecting from the advertised TERM type of xterm/xterm-256color.</div><div><br></div><div><a href="https://github.com/mobile-shell/mosh/issues/178">https://github.com/mobile-shell/mosh/issues/178</a><br></div><div><br></div><div>Maybe mintty and Ctrl-Backspace are in the same boat? If you want to help us fix this bug overall, that would be awesome.</div><div><br></div><div>For the specific question, you basically have two options:</div><div><br></div><div>(a) Propagate this state change all the way through to the client terminal emulator (which is what we do for mouse reporting), and continue to send bytes unchanged in the client-to-server direction.</div><div><br></div><div>(b) Keep track of the state in the mosh-server only, and have the server modify incoming bytes from the client before applying them to the terminal. This is what we do for the "application mode" setting for the cursor keys. SeeĀ src/terminal/terminaluserinput.cc .</div><div><br></div><div>For this one, it seems like (b) might be sufficient... but really we should just fix bug #178 overall in some clean way if that's the root cause.</div><div><br></div><div>-Keith</div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Sat, May 26, 2018 at 1:18 PM, Erik Hons <span dir="ltr"><<a href="mailto:erik.hons@gmail.com" target="_blank">erik.hons@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>I'm trying to make emacs work well inside mintty/mosh. I'd like mintty</div><div>to send an alternate escape sequence for "C-Backspace" than the</div><div>default (which is "C-_"). There is an xterm sequence for this --</div><div>"\e[>4;1m" -- which sets the "modifyOtherKeys" resource. Emacs sends</div><div>that sequence on startup. When using ssh for remoting, the sequence is</div><div>passed to the client side, mintty sees it, and implements the desired</div><div>behavior.</div><div><br></div><div>The mosh terminal emulator appears to discard the sequence. There is</div><div>no matching function in terminal/terminalfunctions.cc defined for it,</div><div>so the dispatch process hits the "unknown function" condition in</div><div>terminal/terminaldispatcher.<wbr>cc@226 (Dispatcher::dispatch()).</div><div><br></div><div>As an experiment, I've added a terminal function for "\e[>4;1m" and</div><div>confirmed that it sees the sequence when emacs sends it. I'm stuck on</div><div>what to do next.</div><div><br></div><div>It looks like I need to add something to Terminal::DrawState, then in</div><div>Display::new_frame() look for that member and call</div><div>frame.append("\e[>4;1m"); That's how the "mouse_reporting_mode" and</div><div>similar settings are handled.</div><div><br></div><div>But this might bring up a bigger question: How should the mosh</div><div>terminal emulator interact with the client side terminal emulator? I</div><div>can add support for this specific sequence, but maybe something more</div><div>general is warranted.</div><div><br></div><div>Any advice?</div><div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
mosh-devel mailing list<br>
<a href="mailto:mosh-devel@mit.edu">mosh-devel@mit.edu</a><br>
<a href="http://mailman.mit.edu/mailman/listinfo/mosh-devel" rel="noreferrer" target="_blank">http://mailman.mit.edu/<wbr>mailman/listinfo/mosh-devel</a><br>
<br></blockquote></div><br></div></div>