diff --git a/lib/hterm.js b/lib/hterm.js index 287cf398..ab510d79 100644 --- a/lib/hterm.js +++ b/lib/hterm.js @@ -394,6 +394,12 @@ hterm.Screen.prototype.syncSelectionCaret = function () { s.addRange(r); }; +const oldScrollPortFocus = hterm.ScrollPort.prototype.focus; +hterm.ScrollPort.prototype.focus = function () { + oldScrollPortFocus(); + this.terminal.focusHyperCaret(); +}; + // fixes a bug in hterm, where the cursor goes back to `BLOCK` // after the bell rings const oldRingBell = hterm.Terminal.prototype.ringBell;