From b6649e53e2cf0d901c9b6af7b11fef7d43f61618 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:24:27 +0000 Subject: [PATCH] Focus PTYTerminal on mount after menu click Agent-Logs-Url: https://github.com/spellshift/realm/sessions/ad51667f-d58a-4d57-af22-4bf198d73ec0 Co-authored-by: KCarretto <16250309+KCarretto@users.noreply.github.com> --- .../internal/www/src/pages/shellv2/components/PtyTerminal.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tavern/internal/www/src/pages/shellv2/components/PtyTerminal.tsx b/tavern/internal/www/src/pages/shellv2/components/PtyTerminal.tsx index 46ec03adf..efdca92e2 100644 --- a/tavern/internal/www/src/pages/shellv2/components/PtyTerminal.tsx +++ b/tavern/internal/www/src/pages/shellv2/components/PtyTerminal.tsx @@ -37,6 +37,10 @@ const PtyTerminal: React.FC = ({ portalId, pivotId, shellId, o fitAddon.fit(); termInstance.current = term; + // Focus the terminal after mount; deferred so HeadlessUI menu + // finishes restoring focus to its trigger button first. + setTimeout(() => term.focus(), 0); + // Handle Resize const resizeObserver = new ResizeObserver(() => { fitAddon.fit();