* Separate out DEL vs backspace when possible for ANSI-BBS terminals. *nix terminals don't send us what we need, but deal with it.

* Handle delete in MultiLineTextEditView. More to come soon!
This commit is contained in:
Bryan Ashby 2017-09-24 11:15:38 -06:00
parent 47551b1803
commit e37409e9b5
2 changed files with 39 additions and 18 deletions

View file

@ -306,7 +306,21 @@ function Client(input, output) {
key.name = 'line feed';
} else if('\t' === s) {
key.name = 'tab';
} else if ('\b' === s || '\x7f' === s || '\x1b\x7f' === s || '\x1b\b' === s) {
} else if('\x7f' === s) {
//
// Backspace vs delete is a crazy thing, especially in *nix.
// - ANSI-BBS uses 0x7f for DEL
// - xterm et. al clients send 0x7f for backspace... ugg.
//
// See http://www.hypexr.org/linux_ruboff.php
// And a great discussion @ https://lists.debian.org/debian-i18n/1998/04/msg00015.html
//
if(self.term.isNixTerm()) {
key.name = 'backspace';
} else {
key.name = 'delete';
}
} else if ('\b' === s || '\x1b\x7f' === s || '\x1b\b' === s) {
// backspace, CTRL-H
key.name = 'backspace';
key.meta = ('\x1b' === s.charAt(0));