Repository navigation
fix: don't show crosshair on Option when term:macoptionismeta is enabled - #3544
tobiashochguertel wants to merge 1 commit into
Conversation
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>
|
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe terminal options now set Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to 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)
✨ Finishing Touches 💡 1🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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. Comment |
There was a problem hiding this comment.
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.
Summary
Bug: with
term:macoptionismetaenabled 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():Wave passes
macOptionIsMetabut never setsmacOptionClickForcesSelection, so Option still triggers column select.Fix: pass
macOptionClickForcesSelection: termMacOptionIsMetain the xterm options infrontend/app/view/term/term.tsx. Nothing changes for the default (term:macoptionismetaoff).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:
macOptionClickForcesSelectionis part ofITerminalOptionsin@xterm/xterm@6.0.0(the version Wave uses), and it is the only flag that suppresses column select on macOS inSelectionService. 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.