mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-24 05:40:15 +00:00
surface: respect semantic prompt boundaries for links (#12435)
Link detection currently expands the clicked location to a full line before running the configured regexes. When semantic prompt markers are present, this can cause prompt text and neighboring content to be matched together even though they are distinct semantic regions. Use semantic prompt boundaries when selecting the text to inspect for link matching. This keeps prompt text separate from the content beside it and avoids folding prompt text into double-click link/path selection. Add a regression test that models a prompt and command on the same line and verifies the prompt region and input region remain separate. ---- this is a fix for the issue users reported in https://github.com/ghostty-org/ghostty/discussions/11415 **disclaimer**: I used codex addon within Cursor to research this bug/regression and find a proper fix for it.
This commit is contained in:
@@ -4302,7 +4302,9 @@ fn linkAtPin(
|
||||
const line = screen.selectLine(.{
|
||||
.pin = mouse_pin,
|
||||
.whitespace = null,
|
||||
.semantic_prompt_boundary = false,
|
||||
// Respect semantic prompt boundaries so link/path matching doesn't
|
||||
// merge shell prompt content with the text beside it.
|
||||
.semantic_prompt_boundary = true,
|
||||
}) orelse return null;
|
||||
|
||||
var strmap: terminal.StringMap = undefined;
|
||||
|
||||
Reference in New Issue
Block a user