diff --git a/packages/cli/src/ui/utils/terminalCapabilityManager.test.ts b/packages/cli/src/ui/utils/terminalCapabilityManager.test.ts index 67f16e5db2..fce18cfb01 100644 --- a/packages/cli/src/ui/utils/terminalCapabilityManager.test.ts +++ b/packages/cli/src/ui/utils/terminalCapabilityManager.test.ts @@ -277,7 +277,7 @@ describe('TerminalCapabilityManager', () => { expect(enableModifyOtherKeys).toHaveBeenCalled(); }); - it('should infer modifyOtherKeys support from Device Attributes (DA1) alone', async () => { + it('should not enable modifyOtherKeys without explicit response', async () => { const manager = TerminalCapabilityManager.getInstance(); const promise = manager.detectCapabilities(); @@ -287,9 +287,7 @@ describe('TerminalCapabilityManager', () => { await promise; expect(manager.isKittyProtocolEnabled()).toBe(false); - // It should fall back to modifyOtherKeys because DA1 proves it's an ANSI terminal - - expect(enableModifyOtherKeys).toHaveBeenCalled(); + expect(enableModifyOtherKeys).not.toHaveBeenCalled(); }); }); }); diff --git a/packages/cli/src/ui/utils/terminalCapabilityManager.ts b/packages/cli/src/ui/utils/terminalCapabilityManager.ts index 50a69ee707..349c601ff8 100644 --- a/packages/cli/src/ui/utils/terminalCapabilityManager.ts +++ b/packages/cli/src/ui/utils/terminalCapabilityManager.ts @@ -47,9 +47,8 @@ export class TerminalCapabilityManager { private terminalBackgroundColor: TerminalBackgroundColor; private kittySupported = false; private kittyEnabled = false; + private modifyOtherKeysSupported = false; private terminalName: string | undefined; - private modifyOtherKeysSupported?: boolean; - private deviceAttributesSupported = false; private constructor() {} @@ -186,7 +185,6 @@ export class TerminalCapabilityManager { ); if (match) { deviceAttributesReceived = true; - this.deviceAttributesSupported = true; cleanup(); } } @@ -215,13 +213,7 @@ export class TerminalCapabilityManager { if (this.kittySupported) { enableKittyKeyboardProtocol(); this.kittyEnabled = true; - } else if ( - this.modifyOtherKeysSupported === true || - // If device attributes were received it's safe to try enabling - // anyways, since it will be ignored if unsupported - (this.modifyOtherKeysSupported === undefined && - this.deviceAttributesSupported) - ) { + } else if (this.modifyOtherKeysSupported) { enableModifyOtherKeys(); } // Always enable bracketed paste since it'll be ignored if unsupported.