Skip to content

fix(tui): preserve readline Ctrl+B in sessions - #55477

Open
Dante-dan wants to merge 1 commit into
anomalyco:devfrom
Dante-dan:readline-backward
Open

Dante-dan wants to merge 1 commit into
anomalyco:devfrom
Dante-dan:readline-backward

Conversation

@Dante-dan

@Dante-dan Dante-dan commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #54620

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Let the default background binding fall through so Ctrl+B also moves the composer cursor left. Keep the shortcut unchanged. The session route binds backgrounding only without a focused editor; the prompt owns it while editing, avoiding duplicate background requests on fallthrough.

How did you verify your code works?

  • Keymap and mini footer tests: 81 passed, 2 skipped. The regression fails on the old default and verifies abc → Ctrl+B → X produces abXc, with one background invocation.
  • TUI typecheck and git diff --check passed. Existing keymap-scope/composer checks passed; session-home fixtures failed on sandbox data directories, then hit frame/time limits with isolated data directories.
  • Full bun run check reached typechecks after lint, then failed in the unrelated changelog package because @tsconfig/node22/tsconfig.json was missing. Lint needed Node's experimental type stripping for its TypeScript plugin.

Screenshots / recordings

Key dispatch only; the shortcut and its displayed hint stay unchanged.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Added by the opencode bot (AI-generated).

Related: #49216

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works. I ran the reproduction script from #54620 with opencode-drive on the base and on this branch. On the base, typing abc, Ctrl+B, X in a session prompt gives abcX, both idle and while a reply streams. With this change it gives abXc in both cases, and the home screen is unchanged. I also ran a session with a long blocking shell command: Ctrl+B still moves it to the background (the follow-up reply appeared in about 350 ms), with a single background request, and the cursor now moves one character left at the same time. Keymap and mini footer tests pass, and typecheck passes in packages/tui.

Public API: unchanged. The only change is the built-in default for session.background, which goes from "ctrl+b" to { key: "ctrl+b", fallthrough: true }. Users who set their own binding for it keep exactly what they set.

No blocking concerns. While an editor has focus, backgrounding now goes only through the prompt's binding, which is on only during a running turn. That is the only time there is blocking work to move, and on the base the prompt's guards already stopped the session binding from running in that case, so nothing is lost.

Related: #49216

Before

After

This branch has not been deployed

No deployments
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.

Standard readline binding CTRL-B BROKEN

1 participant