mirror of
https://github.com/zed-industries/zed.git
synced 2026-07-09 16:00:35 +00:00
terminal: Open links with Cmd/Ctrl-click when mouse mode is enabled (#60067)
This fixes #56956. The terminal link-open gesture was split between `mouse_down` and `mouse_up`, but both halves only ran in the non-mouse-reporting path. When a foreground app enabled terminal mouse reporting, a secondary click on a URL or file path was forwarded to the PTY instead of opening the link. This changes secondary-click link handling so it checks for a hyperlink before mouse reporting on press, and completes the matching hyperlink open before mouse reporting on release. The event is only consumed when the click actually lands on the same link, so normal clicks in mouse-reporting TUIs continue to be forwarded as before. Validation: - `CARGO_BUILD_JOBS=1 cargo test -j1 -p terminal test_hyperlink_ctrl_click_same_position_in_mouse_mode` - `CARGO_BUILD_JOBS=1 cargo check -j1 -p terminal` Release Notes: - Improved terminal links: Cmd/Ctrl-click now opens links even when the application has mouse reporting enabled (e.g. vim, opencode, claude). Disable `terminal.open_links_in_mouse_mode` to forward these clicks to the application instead. --------- Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This commit is contained in:
parent
739f23926d
commit
f5c975162c
8 changed files with 314 additions and 37 deletions
|
|
@ -1897,6 +1897,12 @@
|
|||
"copy_on_select": false,
|
||||
// Whether to keep the text selection after copying it to the clipboard.
|
||||
"keep_selection_on_copy": true,
|
||||
// Whether cmd-click (ctrl-click on Linux and Windows) opens hyperlinks even
|
||||
// when the terminal application has enabled mouse reporting (e.g. vim with
|
||||
// mouse=a, htop). When false, these clicks are forwarded to the application
|
||||
// instead, and hyperlinks can still be opened with shift-cmd-click
|
||||
// (shift-ctrl-click).
|
||||
"open_links_in_mouse_mode": true,
|
||||
// Whether to show the terminal button in the status bar
|
||||
"button": true,
|
||||
// Any key-value pairs added to this list will be added to the terminal's
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue