Skip to content

allow negative mouse coordinates#5926

Merged
willmcgugan merged 3 commits into
mainfrom
fix-ghostty-mouse
Jul 6, 2025
Merged

allow negative mouse coordinates#5926
willmcgugan merged 3 commits into
mainfrom
fix-ghostty-mouse

Conversation

@willmcgugan

Copy link
Copy Markdown
Member

Pretty sure this is a bug in Ghostty.

@willmcgugan willmcgugan merged commit 28f0aa6 into main Jul 6, 2025
23 checks passed
@willmcgugan willmcgugan deleted the fix-ghostty-mouse branch July 6, 2025 07:40
_MAX_SEQUENCE_SEARCH_THRESHOLD = 32

_re_mouse_event = re.compile("^" + re.escape("\x1b[") + r"(<?[\d;]+[mM]|M...)\Z")
_re_mouse_event = re.compile("^" + re.escape("\x1b[") + r"(<?[-?\d;]+[mM]|M...)\Z")

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.

Doesn't this include ? in the character class?


class XTermParser(Parser[Message]):
_re_sgr_mouse = re.compile(r"\x1b\[<(\d+);(\d+);(\d+)([Mm])")
_re_sgr_mouse = re.compile(r"\x1b\[<(-?\d+);(-?\d+);(-?\d+)([Mm])")

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.

Is the negative button value just in case?

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.

2 participants