Skip to content

fix: don't show crosshair on Option when term:macoptionismeta is enabled - #3544

Open
tobiashochguertel wants to merge 1 commit into
wavetermdev:mainfrom
tobiashochguertel:fix/term-macoption-crosshair
Open

tobiashochguertel wants to merge 1 commit into
wavetermdev:mainfrom
tobiashochguertel:fix/term-macoption-crosshair

Conversation

@tobiashochguertel

Copy link
Copy Markdown

Summary

Bug: with term:macoptionismeta enabled on macOS, holding Option over a terminal still switches the cursor to a crosshair, and Option+drag makes a column (block) selection. With this setting Option is supposed to be Meta, so it should not act as an xterm.js selection modifier.

Cause: xterm.js picks column-select mode in SelectionService.shouldColumnSelect():

return event.altKey && !(Browser.isMac && this._optionsService.rawOptions.macOptionClickForcesSelection);

Wave passes macOptionIsMeta but never sets macOptionClickForcesSelection, so Option still triggers column select.

Fix: pass macOptionClickForcesSelection: termMacOptionIsMeta in the xterm options in frontend/app/view/term/term.tsx. Nothing changes for the default (term:macoptionismeta off).

Side effect: with the setting on, Option+click inside a mouse-mode app (e.g. tmux or vim with mouse enabled) forces a normal xterm selection. That is what xterm.js documents for this option, and it is the usual behaviour when Option is Meta.

Verification: macOptionClickForcesSelection is part of ITerminalOptions in @xterm/xterm@6.0.0 (the version Wave uses), and it is the only flag that suppresses column select on macOS in SelectionService. The same one-line change has been running in a downstream build. There is no unit test: the change only passes an option through to xterm.js, and the frontend has no tests for terminal options.

With term:macoptionismeta on, holding Option on macOS still switches
xterm.js into column-select mode (crosshair cursor, Option+drag does a
block selection), since SelectionService.shouldColumnSelect() only skips
it when macOptionClickForcesSelection is set. Option is meant to act as
Meta in this mode, so set macOptionClickForcesSelection alongside
macOptionIsMeta.

Co-Authored-By: Tobias Hochgürtel <tobias.hochguertel@googlemail.com>
Copilot AI balanced review requested due to automatic review settings October 6, 2026 06:29
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai

coderabbitai Bot commented Oct 6, 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: da687ec5-b5bd-4e53-a61b-6b37373266f0
📥 Commits

Reviewing files that changed from the base of the PR and between 9f1c967 and 06ecb89.

📒 Files selected for processing (1)
  • frontend/app/view/term/term.tsx

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

The terminal options now set macOptionClickForcesSelection to the value of termMacOptionIsMeta. The existing macOptionIsMeta option uses that setting as well.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 06ecb

When Option-as-Meta is enabled, Option-click can force normal terminal selection. No merge-blocking risk is identified in this change.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the Option crosshair issue addressed by the change.
Description check ✅ Passed The description explains the bug, its cause, the proposed fix, and verification details relevant to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
🧪 Generate unit tests (beta)
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The focused option mapping correctly addresses the reported macOS behavior without changing defaults.

Review effort: Balanced
Findings: None

What changed in this PR

Aligns xterm.js mouse-selection behavior with term:macoptionismeta.

Changes:

  • Disables Option-based column selection when Option acts as Meta.
  • Preserves default behavior when the setting is disabled.
File Description
frontend/​app/​view/​term/​term.tsx Passes the corresponding xterm.js selection option.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

3 participants