Skip to content

Commit

Permalink
Patch hterm to treat DEC mode 1003 as 1002
Browse files Browse the repository at this point in the history
  • Loading branch information
nanzhong committed Feb 16, 2021
1 parent 00361d7 commit e26015c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Resources/hterm_all.patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,15 @@ hterm.Terminal.prototype.setCursorVisible = function(state) {
}
}
};

// NOTE(@nanzhong) hterm does not support DEC mode 1003 (any mouse event reporting mode).
// DEC mode 1003 and DEC mode 1002 (which hterm does support) are almost identical. The only difference is that mode 1003 includes mouse movement tracking events which are rarely used.
// This patches hterm to treat DEC mode 1003 the same as DEC mode 1002.

hterm.VT.prototype.setDECMode_original = hterm.VT.prototype.setDECMode;
hterm.VT.prototype.setDECMode = function(code, state) {
if (code === "1003") {
code = "1002";
}
hterm.VT.prototype.setDECMode_original.call(this, code, state);
};

0 comments on commit e26015c

Please sign in to comment.