hterm: Support to detect alt-backspace when it's remapped to DEL.
BUG=chromium:174410
TEST=Manually tested the following cases before and after to see the
same behavior w/ the pref disabled:
DEL: 0x1b 5b 33 7e == '\x1b[3~'
Backspace: 0x7f
Esc: 0x1b
Alt-Del: 0x1b 5b 33 3b 33 7e == '\x1b[3;3~'
And w/ the pref enabled, saw that Alt-backspace did:
Alt-Backspace: 0x1b 7f (this is the only chage from this CL)
Change-Id: Ie480d7087495704c7e3417d08c4e99702d5f85a0
Reviewed-on: https://gerrit.chromium.org/gerrit/47323
Reviewed-by: Robert Ginda <rginda@chromium.org>
Commit-Queue: Andrew de los Reyes <adlr@chromium.org>
Tested-by: Andrew de los Reyes <adlr@chromium.org>
diff --git a/hterm/js/hterm_terminal.js b/hterm/js/hterm_terminal.js
index 3915049..c91254e 100644
--- a/hterm/js/hterm_terminal.js
+++ b/hterm/js/hterm_terminal.js
@@ -155,6 +155,10 @@
this.prefs_ = new hterm.PreferenceManager(this.profileId_);
this.prefs_.addObservers(null, {
+ 'alt-backspace-is-meta-backspace': function(v) {
+ terminal.keyboard.altBackspaceIsMetaBackspace = v;
+ },
+
'alt-is-meta': function(v) {
terminal.keyboard.altIsMeta = v;
},