Skip to content

fix(terminal): preserve OpenCode Ctrl+Enter on Windows - #33149

Merged
nwparker merged 3 commits into
stablyai:mainfrom
Pr1p:codex/opencode-ctrl-enter
Oct 25, 2026
Merged

nwparker merged 3 commits into
stablyai:mainfrom
Pr1p:codex/opencode-ctrl-enter

Conversation

@Pr1p

@Pr1p Pr1p commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

ELI5

On Windows, Orca sometimes sent Ctrl+Enter to OpenCode as an ordinary Enter. That made OpenCode submit the prompt instead of treating the chord separately. Orca now sends the distinct Ctrl+Enter input sequence only to panes it can identify as OpenCode.

What Changed

Before: In a local Windows ConPTY OpenCode pane, Ctrl+Enter fell back to a carriage return (\r) unless the terminal had negotiated the Kitty keyboard protocol. Orca deliberately withholds that protocol from ordinary local ConPTY panes because some terminal programs cannot read it safely.

After: A trusted OpenCode pane is included in Orca's existing, pane-scoped CSI-u allowlist. Ctrl+Enter is sent as \x1b[13;5u; unknown panes and other agents retain the existing safe fallback.

Why

This uses the existing Droid/Grok exception rather than re-enabling the Kitty protocol for all local Windows terminals. The latter would reintroduce compatibility risk for programs that do not understand CSI-u. The scope remains one verified consumer and one shortcut.

Linked Issue

Fixes #25372

Visual Proof

N/A — this is terminal input-byte behavior with focused automated coverage; no rendered UI changes.

Testing

  • I manually tested these changes locally — a real local Windows ConPTY + OpenCode session was not run in this checkout.
  • Automated tests added/updated:
    • focused terminal authority, shortcut-policy, and TUI configuration tests: 44 passed
    • web TypeScript check passed
    • changed-code quality gate passed with 0 new findings

The regression test verifies that OpenCode requires the same trusted pane evidence as existing CSI-u consumers. macOS, Linux, SSH, WSL, unknown local panes, and all non-OpenCode agent entries retain their established paths.

AI Disclosure

Implemented with GPT-5.

Review

The change adds a single declarative capability to an existing agent table and extends the table's authorization test. It does not change global keyboard-protocol advertisement, process detection, networking, files, or credentials.

Agent skill upstream boundary

  • Not applicable; this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

opencode2, mimo-code, and Shift+Enter are intentionally unchanged: the issue only provides evidence for the opencode binary's Ctrl+Enter behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • Targeted tests, web typecheck, and changed-code quality checks pass locally; CI will run the full repository matrix

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b110f5e3-4371-475b-a587-8be7ac747b0f
Commits

Reviewing files that changed from the base of the PR and between 149fd43 and 662b67c.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e5f904bf-cc4d-485a-9c8d-0c73033656b8
Commits

Reviewing files that changed from the base of the PR and between e67daeafc5d8e17e965678f685153b2e33ed0e02 and 149fd43.

Files selected for processing: 2
  • src/shared/tui-agent-config-types.ts
  • src/shared/tui-agent-config.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Walkthrough

The OpenCode terminal configuration now sets ctrlEnterEncoding to csi-u. The trusted CSI-u consumer test now includes OpenCode.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to 149fd

The OpenCode CSI-u change is ready to merge with no identified blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the terminal behavior change for OpenCode on Windows.
Description check Passed The description covers the required sections, explains the user impact and implementation, links issue #25372, provides testing details, documents the missing real Windows ConPTY test, and addresses c…
Linked Issues check Passed Issue #25372 requires distinct CSI-u input for OpenCode Ctrl+Enter on Windows Local ConPTY while preserving the fallback for untrusted panes and other agents. The PR sets ctrlEnterEncoding: 'csi-u' …
Out of Scope Changes check Passed The PR changes the OpenCode capability declaration, its authorization test, and the shared authoring type used by the same TUI configuration. These changes support the issue implementation and test co…
Full details: Description check

Explanation

The description covers the required sections, explains the user impact and implementation, links issue #25372, provides testing details, documents the missing real Windows ConPTY test, and addresses compatibility scope.

Full details: Linked Issues check

Explanation

Issue #25372 requires distinct CSI-u input for OpenCode Ctrl+Enter on Windows Local ConPTY while preserving the fallback for untrusted panes and other agents. The PR sets ctrlEnterEncoding: 'csi-u' for opencode and adds opencode to the trusted-pane authorization test. The diff does not change global Kitty protocol advertisement or other agent capabilities.

Full details: Out of Scope Changes check

Explanation

The PR changes the OpenCode capability declaration, its authorization test, and the shared authoring type used by the same TUI configuration. These changes support the issue implementation and test coverage. The diff shows no unrelated product behavior.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker force-pushed the codex/opencode-ctrl-enter branch 2 times, most recently from 8fa7aec to d55b216 Compare October 24, 2026 23:52
Keeps tui-agent-config.ts under the 300-line limit with the OpenCode entry.

Co-authored-by: Pr1p <[email protected]>
@nwparker
nwparker force-pushed the codex/opencode-ctrl-enter branch from d55b216 to 149fd43 Compare October 24, 2026 23:54
@nwparker
nwparker merged commit a289c98 into stablyai:main Oct 25, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: OpenCode falls back to plain Enter for Ctrl+Enter on Windows Local ConPTY

2 participants