Skip to content

feat: enable OSC133 click events via reedline - #17491

Merged
fdncred merged 2 commits into
nushell:mainfrom
stuartcarnie:sgc/mouse-click-to-cursor
Feb 6, 2026
Merged

fdncred merged 2 commits into
nushell:mainfrom
stuartcarnie:sgc/mouse-click-to-cursor

Conversation

@stuartcarnie

@stuartcarnie stuartcarnie commented Feb 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Testing

  • cargo test -p nu-cli prompt_does_not_embed_osc_markers
  • cargo test -p nu-cli semantic_markers_
  • cargo test -p nu-protocol click_to_cursor_is_unknown_option

Release notes summary - What our users need to know

Enabling shell_integration.osc133 now also enables click-to-cursor in supported terminals.

Tasks after submitting

Details DEMO
Nushell.OSC.133.+.Ghostty.mp4

@stuartcarnie
stuartcarnie force-pushed the sgc/mouse-click-to-cursor branch from cd6b703 to 4b82ff4 Compare February 4, 2026 05:38
@fdncred

fdncred commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

This is cool. I haven't tested it yet but I didn't realize that osc133 would enable mouse clicks by itself (with changes to reedline of course).

@stuartcarnie
stuartcarnie force-pushed the sgc/mouse-click-to-cursor branch 4 times, most recently from 88e157f to 0658b95 Compare February 5, 2026 21:14
@fdncred

fdncred commented Feb 5, 2026 •

Copy link
Copy Markdown
Contributor

ok, your turn! @stuartcarnie 🤣

@fdncred

fdncred commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

@stuartcarnie when you get a minute, if you can fix these conflicts we can land this one.

Move OSC 133/633 prompt markers from nushell into reedline's
SemanticPromptMarkers, use Osc133ClickEventsMarkers to advertise
click_events=1, and wire up MouseClickMode based on osc133 config.
@stuartcarnie
stuartcarnie force-pushed the sgc/mouse-click-to-cursor branch from 0658b95 to 6d278bc Compare February 6, 2026 00:43
@stuartcarnie

Copy link
Copy Markdown
Contributor Author

@fdncred done!

@stuartcarnie
stuartcarnie marked this pull request as ready for review February 6, 2026 00:43
@stuartcarnie
stuartcarnie force-pushed the sgc/mouse-click-to-cursor branch from e1c0132 to bcc6c29 Compare February 6, 2026 01:04

@fdncred fdncred 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.

LGTM! Thanks!

@fdncred
fdncred merged commit 16b567d into nushell:main Feb 6, 2026
17 checks passed
@github-actions github-actions Bot added this to the v0.111.0 milestone Feb 6, 2026
@stuartcarnie
stuartcarnie deleted the sgc/mouse-click-to-cursor branch February 6, 2026 01:59
TestingPlant pushed a commit to TestingPlant/nushell that referenced this pull request Feb 6, 2026
<!--
Thank you for improving Nushell!
Please, read our contributing guide:
https://github.com/nushell/nushell/blob/main/CONTRIBUTING.md
-->

## Summary
- Enable OSC 133 semantic prompt markers (via @fdncred /
nushell/reedline/pull/1019)
- Enable OSC 133 click_events (via nushell/reedline/pull/1020).
- Keep OSC 633 support for VS Code and prefer it when available.

## Testing
- `cargo test -p nu-cli prompt_does_not_embed_osc_markers`
- `cargo test -p nu-cli semantic_markers_`
- `cargo test -p nu-protocol click_to_cursor_is_unknown_option`

## Release notes summary - What our users need to know
- Enabling `shell_integration.osc133` now also enables click-to-cursor
in supported terminals.

## Tasks after submitting
- [ ] Update the
[documentation](https://github.com/nushell/nushell.github.io)

<details>
<summary<strong>DEMO</strong></summary>


https://github.com/user-attachments/assets/ce11079f-0c4f-4f90-a1b1-e3c3d0b99351

</details>
@paul-d-ray

Copy link
Copy Markdown

Will this affect using Wezterm (in Windows)?
I have to make OSC133 = false when using Nushell in Wezterm.
I don't know if this issues is in Linux / MacOS or is just for Windows.

Having OSC133 = true (works find in Windows Terminal), causes Wezterm to scroll up when any character / cursor is entered.

@fdncred

fdncred commented Feb 7, 2026

Copy link
Copy Markdown
Contributor

With WezTerm nightly the problem is gone even before this change. However, I have not tried it yet in WezTerm on Windows yet.

@paul-d-ray

paul-d-ray commented Feb 15, 2026 •

Copy link
Copy Markdown

Running Windows, I updated Wezterm stable to Wezterm nightly (20260214) and now I don't have to disable OSC133.

This is from my Nushell Config:

$env.config.shell_integration
╭────────────────────────┬───────╮
│ osc2                   │ true  │
│ osc7                   │ false │
│ osc8                   │ true  │
│ osc9_9                 │ true  │
│ osc133                 │ true  │
│ osc633                 │ true  │
│ reset_application_mode │ true  │
╰────────────────────────┴───────╯

@cptpiepmatz cptpiepmatz added notes:ready Indicates Ready for Release notes notes:additions Noted in "Additions" section labels Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes:additions Noted in "Additions" section notes:ready Indicates Ready for Release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants