Skip to content

fix(settings): show the default word separators as an editable value - #28336

Merged
nwparker merged 1 commit into
stablyai:mainfrom
kazuki-hanai:fix/terminal-word-separator-whitespace
Oct 28, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
kazuki-hanai:fix/terminal-word-separator-whitespace

Conversation

@kazuki-hanai

@kazuki-hanai kazuki-hanai commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

If you customize the terminal's "Word Separators" setting and the value does not contain a space (the placeholder's leading space is invisible, so this is easy to do by accident), double-clicking a word selects the whole line. Orca now always treats spaces and tabs as word boundaries, no matter what the setting says.

What Changed

  • Add normalizeTerminalWordSeparator in src/shared/terminal-word-separator-settings.ts: prepend space and tab to a custom separator list when missing; return undefined for empty or non-string values so the xterm default still applies
  • Apply it where terminalWordSeparator is passed to xterm: terminal-pane-manager-options.ts (regular and floating panes) and preview-terminal-options.ts (dashboard preview)
  • Add unit tests for the normalizer; update the preview-options test for the new expectation

Why

The setting is forwarded to xterm's wordSeparator as-is, and xterm treats only the configured characters as boundaries. A value like ()[]{},'" silently disables whitespace as a boundary, so double-click selection expands across the entire line. No configuration plausibly wants double-click selection to cross spaces, so whitespace is now force-included instead of trusting the raw setting.

Linked Issue

Fixes #28335

Visual Proof

Captured with the repo's bundled (patched) xterm build rendering dig-style output, dispatching a real double-click on the IP address. Before uses the raw separator value ()[]{},'"-; after uses the same value passed through normalizeTerminalWordSeparator.

Before (selection expands to the whole line):

before.png

After (only the word under the cursor is selected):

after.png

Testing

  • pnpm test src/shared/terminal-word-separator-settings.test.ts src/renderer/src/components/dashboard-popout/preview-terminal-options.test.ts passes

  • pnpm tc and the changed-files quality gate pass

  • Playwright harness against the bundled xterm build confirms the selection behavior (screenshots above): before selects example.com. 60 IN A 198.51.100.142, after selects 198.51.100.142

  • Tested on macOS; the change is pure string normalization with no platform-specific behavior

  • I manually tested these changes locally (verified via the xterm harness above, not a full app run)

  • Automated tests added/updated, or explained why not below

AI Disclosure

Implemented with Claude Code (Claude Fable 5), reviewed and verified by the submitter.

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No security, SSH/remote, mobile, or wire-compatibility impact: the normalization happens renderer-side right before the value reaches xterm, and the stored setting is unchanged. Backwards compatible: unset or empty settings still fall through to the xterm default.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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 (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3cb99cc5-8f88-414e-941e-3e629d276910
📥 Commits

Reviewing files that changed from the base of the PR and between a65fdc8 and d2b47db.

📒 Files selected for processing (5)
  • src/renderer/src/components/dashboard-popout/preview-terminal-options.test.ts
  • src/renderer/src/components/dashboard-popout/preview-terminal-options.ts
  • src/renderer/src/components/terminal-pane/terminal-pane-manager-options.ts
  • src/shared/terminal-word-separator-settings.test.ts
  • src/shared/terminal-word-separator-settings.ts

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

Walkthrough

A shared helper now returns undefined for invalid or empty separator values. For other values, it adds any missing space and tab characters. The preview and terminal-pane option builders use the helper. Tests cover normalization behavior and the preview option output.

Priority: Normal

Severity of issue fixed: Medium

Merge Risk: Minimal · up to d2b47

Whitespace remains a word separator in the identified terminal views, including when custom settings omit it. No merge-blocking issue is evident.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Title check Warning The title is a conventional-commit style summary, but it describes the change as showing the default word separators as an editable value. The changeset instead force-includes space and tab in the wor… Rewrite the title to name the actual change, for example: "fix(terminal): always treat whitespace as a double-click word separator". This matches the change in normalizeTerminalWordSeparator and its use in terminal pane and preview options.
Passed Passed checks: 3 passed
Check name Status Explanation
Linked Issues check Passed Issue #28335 requires whitespace to remain a word boundary for terminal double-click selection, including regular and floating panes. normalizeTerminalWordSeparator returns undefined for empty or …
Out of Scope Changes check Passed The changed files implement issue #28335. The normalizer, pane-manager integration, preview integration, and related tests all support consistent terminal word-boundary behavior. No unrelated change i…
Description check Passed The description follows the template well. It includes ELI5, What Changed, Why, a linked issue (Fixes #28335), Visual Proof with before and after images, Testing, AI Disclosure, the upstream boundary …
Full details: Linked Issues check

Explanation

Issue #28335 requires whitespace to remain a word boundary for terminal double-click selection, including regular and floating panes. normalizeTerminalWordSeparator returns undefined for empty or non-string values and prepends missing space and tab characters for non-empty strings. createTerminalPaneManagerOptions applies it to the terminal wordSeparator, which covers the pane manager path. buildPreviewAppearanceOptions applies it to dashboard previews. Unit-test changes cover invalid values, missing whitespace, and existing whitespace. The reported targeted tests and type checks pass.

Full details: Out of Scope Changes check

Explanation

The changed files implement issue #28335. The normalizer, pane-manager integration, preview integration, and related tests all support consistent terminal word-boundary behavior. No unrelated change is shown in the provided PR summary.

Full details: Description check

Explanation

The description follows the template well. It includes ELI5, What Changed, Why, a linked issue (Fixes #28335), Visual Proof with before and after images, Testing, AI Disclosure, the upstream boundary checkbox, Notes, and the Checklist. It explains the mechanism and the rationale clearly. Minor gaps: the Visual Proof section does not show a UI-level before and after from the running app, since the author describes an xterm harness, and the manual testing box is unchecked while the Testing section says the change was verified only through the harness. The Review section is empty.

Full details: Title check

Explanation

The title is a conventional-commit style summary, but it describes the change as showing the default word separators as an editable value. The changeset instead force-includes space and tab in the word separator passed to xterm, so the title is misleading and off-topic relative to the actual change. The change addresses double-click selection expanding across the whole line when a custom separator lacks whitespace.

Resolution

Rewrite the title to name the actual change, for example: "fix(terminal): always treat whitespace as a double-click word separator". This matches the change in normalizeTerminalWordSeparator and its use in terminal pane and preview options.

  • 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.

Double-click selected across spaces when a custom Word Separators value
omitted the space. The field was empty with the default (which starts with
an invisible space) only as a placeholder, so users rebuilt the list
without it. Like xterm.js, VS Code and Ghostty, Orca keeps respecting the
configured value exactly; the field now shows the default as its value,
offers Reset when customized, and warns when no space is included.

Fixes stablyai#28335

Co-authored-by: Kazuki Hanai <kazukihanai@sakana.ai>
@nwparker
nwparker force-pushed the fix/terminal-word-separator-whitespace branch from d2b47db to 4767ccd Compare October 28, 2026 08:25
@nwparker nwparker changed the title fix(terminal): always treat whitespace as a double-click word separator fix(settings): show the default word separators as an editable value Oct 28, 2026
@nwparker

Copy link
Copy Markdown
Contributor

Thanks for tracking this down, @kazuki-hanai. Your diagnosis of #28335 was right. We changed the approach, though, and rewrote the branch. You're still credited as co-author.

Why the approach changed: most terminals respect the configured separator list exactly, and so does xterm.js, which Orca's setting is passed to. VS Code (terminal.integrated.wordSeparators), Ghostty, WezTerm and Alacritty all do the same; WezTerm even documents leaving out the space as a feature. Only Windows Terminal forces whitespace. So instead of silently adding a space, Orca keeps passing the value straight through.

What was really confusing was the settings field. It was empty, and the default appeared only as a placeholder. That placeholder starts with an invisible space and disappears once you start typing, so it was easy to rebuild the list without the space. The field now:

  • shows the actual default (TERMINAL_DEFAULT_WORD_SEPARATOR) as its editable value
  • shows a Reset button only when the value is customized
  • shows a subtle, non-blocking warning when the value has no space: "No space included — double-click will select across spaces."
  • has a description that says space counts

We removed the old description key from all the locale catalogs. This will merge once CI is green.

@nwparker
nwparker merged commit 86f9b36 into stablyai:main Oct 28, 2026
56 of 58 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]: Double-click selects the whole line when the Word Separators setting omits whitespace

2 participants