mirror of
https://github.com/stablyai/orca.git
synced 2026-11-04 02:57:36 +00:00
fix(terminal): preserve OpenCode Ctrl+Enter on Windows (#33149)
OpenCode Ctrl+Enter sends CSI-u on local Windows ConPTY so it inserts a newline instead of submitting (as on other platforms). Fixes #25372.
This commit is contained in:
@@ -41,7 +41,7 @@ describe('hasCtrlEnterCsiUAuthorityForPane', () => {
|
||||
)
|
||||
|
||||
it('authorizes only trusted Ctrl+Enter CSI-u consumers', () => {
|
||||
for (const agent of ['droid', 'grok'] as const) {
|
||||
for (const agent of ['droid', 'grok', 'opencode'] as const) {
|
||||
expect(
|
||||
hasCtrlEnterCsiUAuthorityForPane(
|
||||
{
|
||||
|
||||
@@ -62,3 +62,9 @@ export type TuiAgentConfig = {
|
||||
/** Ctrl+Enter encoding for agents that consume CSI-u without active kitty flags. */
|
||||
ctrlEnterEncoding?: 'csi-u'
|
||||
}
|
||||
|
||||
/** Authoring form: `launchCmd` and `expectedProcess` default to `detectCmd` (true for most agents). */
|
||||
export type TuiAgentConfigSource = Omit<TuiAgentConfig, 'launchCmd' | 'expectedProcess'> & {
|
||||
launchCmd?: string
|
||||
expectedProcess?: string
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { TuiAgent } from './tui-agent'
|
||||
import { getOrcaCliCommandNameForPlatform } from './orca-cli-command-name'
|
||||
import type { TuiAgentConfig } from './tui-agent-config-types'
|
||||
import type { TuiAgentConfig, TuiAgentConfigSource } from './tui-agent-config-types'
|
||||
|
||||
export type {
|
||||
AgentPromptInjectionMode,
|
||||
@@ -10,12 +10,6 @@ export type {
|
||||
TuiAgentDetectionRuntime
|
||||
} from './tui-agent-config-types'
|
||||
|
||||
/** Authoring form: `launchCmd` and `expectedProcess` default to `detectCmd` (true for most agents). */
|
||||
type TuiAgentConfigSource = Omit<TuiAgentConfig, 'launchCmd' | 'expectedProcess'> & {
|
||||
launchCmd?: string
|
||||
expectedProcess?: string
|
||||
}
|
||||
|
||||
function resolveTuiAgentConfig(source: TuiAgentConfigSource): TuiAgentConfig {
|
||||
return {
|
||||
...source,
|
||||
@@ -103,6 +97,8 @@ const TUI_AGENT_CONFIG_SOURCE: Record<TuiAgent, TuiAgentConfigSource> = {
|
||||
// was pasted blind, mid-startup (#22479). The signal itself fired every time in
|
||||
// those runs, so the budget was the problem, not a dropped escape.
|
||||
draftPasteReadyTimeoutMs: 20_000,
|
||||
// Why: OpenCode decodes CSI-u Ctrl+Enter without local ConPTY kitty negotiation (#25372).
|
||||
ctrlEnterEncoding: 'csi-u',
|
||||
composerReadyCaptures: [
|
||||
'opencode-1-18-32-timed-boot-slow',
|
||||
'opencode-1-18-32-timed-boot-hidden-pane',
|
||||
|
||||
Reference in New Issue
Block a user