From 3c1953654a32f7a03fce0e1c8d1a5f601c6b4477 Mon Sep 17 00:00:00 2001 From: GitHub Copilot Date: Fri, 30 Jan 2026 08:15:58 +0000 Subject: [PATCH] Ensure dashboard activates terminal tab --- src/webterm/local_server.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/webterm/local_server.py b/src/webterm/local_server.py index 28faa77..45e682e 100644 --- a/src/webterm/local_server.py +++ b/src/webterm/local_server.py @@ -1162,9 +1162,19 @@ class LocalServer: if (!tile || !tile.slug) return; const url = `/?route_key=${{encodeURIComponent(tile.slug)}}`; const target = `webterm-${{tile.slug}}`; - const win = window.open(url, target); - if (win && typeof win.focus === 'function') {{ - win.focus(); + let win = window.open(url, target); + if (!win) {{ + window.location.href = url; + return; + }} + if (win.closed) {{ + win = window.open(url, target); + }} + if (win) {{ + if (typeof win.focus === 'function') {{ + win.focus(); + }} + win.location.href = url; }} else {{ window.location.href = url; }}