Fixes a bug caused by the renderer logic assuming this behavior and not
advancing the run iterator when skipping foreground elements in cells
with the invisible flag set.
This simplifies the math for calculating scroll vectors based on mouse
scroll events. This was done to fix inverted horizontal scrolling on
macOS with natural scrolling enabled. Many assertions were added for
assumptions and our preconditions are clearly documented.
The preconditions are:
* Apprt scroll offsets are negative down/left, positive up/right
* Terminal vertical scroll is postive down, negative up (opposite
since scroll for a terminal means how many rows to move down).
* `Surface.scrollCallback` is always call with an apprt offset.
* Apprt is responsible for implementing natural scrolling. Surface
always assumes negative is down/left.
Fixes#2409
This is one of the weirder macOS quirks (bugs? who knows!) I've seen
recently. The bug as described in #2409: when you have at least two
monitors ("screens" in AppKit parlance), Ghostty on one, a focused app
on the other, and you toggle the quick terminal, the quick terminal
does not have focus.
We already knew and accounted for the fact that
`window.makeKeyAndOrderFront(nil)` does not work until the window is visible
and on the target screen. To do this, we only called this once the
animation was complete. For the same NSScreen, this works, but for
another screen, it does not.
Using one DispatchQueue.async tick also does not work. Based on testing,
it takes anywhere from 2 to 5 ticks to get the window focus API to work
properly. Okay.
The solution I came up with here is to retry the focus operation every
25ms up to 250ms. This has worked consistently for me within the first 5
ticks but it is obviously a hack so I'm not sure if this is all right.
This fixes the issue but if there's a better way to do this, I'm all
ears!
macOS 12 is officially EOL by Apple and the project only supports
officially supported versions of macOS. Once publicly released, users on
older macOS versions will have to use older released builds.
Significant rework that also removes a lot of unnecessarily duplicated
work while rebuilding cells in both renderers. Fixes multiple issues
with decorations and bg colors on wide chars and ligatures, while
reducing the amount of special case handling required.
This was recently introduced a few days ago. Unfortunately, this doesn't
work as expected. The "function" modifier is not actually the fn key
but used by macOS to represent a variety of "functional" key presses.
This breaks other bindings such as #2411.
I can't find a source on the internet that reliably tells me how we
can detect fn key presses, but I do find a number of sources that tell
us we can't.