diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts index 54e87d693bf..8e18ece6f2e 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.test.ts @@ -579,4 +579,10 @@ describe('isTouchIOSUserAgent', () => { isTouchIOSUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', 5) ).toBe(false) }) + + it('keeps the forwarder on a Mac whose touch peripheral reports a single point', () => { + expect( + isTouchIOSUserAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15', 1) + ).toBe(false) + }) }) diff --git a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts index 41ff4202534..a61b9ad131f 100644 --- a/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts +++ b/src/renderer/src/components/terminal-pane/use-terminal-pane-lifecycle.ts @@ -451,9 +451,11 @@ export function resolvePaneSeedCwd(splitPaneCwd: string | undefined, fallbackCwd return splitPaneCwd ?? fallbackCwd } -/** iPadOS reports a desktop "Macintosh" UA and iOS reports "like Mac OS X" — maxTouchPoints is the only signal a real Mac never sets. */ +// Why > 1, matching isIOSWebView in mobile/src/terminal/terminal-webview-html.ts: a Mac with a +// touch peripheral can report exactly 1, and it must keep the forwarder. Real iPads report 5. +// Why UA rather than that helper's platform check: an iPhone reports platform "iPhone", not "MacIntel". export function isTouchIOSUserAgent(userAgent: string, maxTouchPoints: number): boolean { - return userAgent.includes('Mac') && maxTouchPoints > 0 + return userAgent.includes('Mac') && maxTouchPoints > 1 } type SplitStartupPayload = { command: string; env?: Record }