From e5c076e82fa142c22c264738edc7db0a0c2c2907 Mon Sep 17 00:00:00 2001 From: Matheus Fernandes Date: Sat, 14 Jan 2017 17:56:18 -0200 Subject: [PATCH] =?UTF-8?q?:bug:=20Focus=20the=20current=20tab=20after=20s?= =?UTF-8?q?witch=20from=20a=20new=20one=20=E2=80=93=20closes=20#1273?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/hterm.js | 6 ++++++ 1 file changed, 6 insertions(+) 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;