fix(terminal): reject conflicting Ctrl+Enter evidence

This commit is contained in:
OrcaWin
2026-08-06 19:58:36 -07:00
parent ef08bfb0c7
commit 903f63e5d6
2 changed files with 14 additions and 0 deletions
@@ -37,6 +37,17 @@ describe('hasCtrlEnterCsiUAuthorityForPane', () => {
}
expect(hasCtrlEnterCsiUAuthorityForPane(state, PANE_KEY, '⠋ Droid')).toBe(true)
expect(hasCtrlEnterCsiUAuthorityForPane(state, PANE_KEY, 'C:\\work\\grok-project')).toBe(false)
expect(
hasCtrlEnterCsiUAuthorityForPane(
{
paneForegroundAgentByPaneKey: {
[PANE_KEY]: { agent: 'pi', shellForeground: false }
}
},
PANE_KEY,
'Droid'
)
).toBe(false)
for (const foreground of [
{ agent: 'grok' as const, routingRevoked: true, shellForeground: false },
@@ -24,5 +24,8 @@ export function hasCtrlEnterCsiUAuthorityForPane(
return agentAcceptsCtrlEnterCsiU(foreground.agent)
}
const titleAgent = terminalTitle ? resolveCommittedTitleAgentType(terminalTitle) : null
if (foreground?.agent != null && foreground.agent !== titleAgent) {
return false
}
return agentAcceptsCtrlEnterCsiU(titleAgent)
}