Fails on NixOS
/nix/store/lkqjw3yazk7d3il8a0rp11pvjxdyq281-ghostty-0.1.0/share/ghostty/shell-integration/zsh/ghostty-integration: bad interpreter: /bin/zsh: no such file or directory
Fixes#1990
This fixes and adds a unit test for an edge case where when printing
over the same cell with the same hyperlink ID, we were unsetting the
cell hyperlink state.
This commit also adds a number of integrity checks to verify hyperlinks
remain in a consistent state.
Fixes#1991
To check if a hyperlink from another page is already present in our
page's set, we need to dupe the hyperlink struct. If the hyperlink is
already present in our page, this dupe is a waste and is freed.
In the case where the hyperlink is present AND we don't have enough
memory to dupe the hyperlink to check if its present, we'd previous
simply crash out and fail rendering. Debug builds would crash with
integrity errors.
This commit resolves the issue by falling back to a slow path when our
string allocation table is full and iterating over the hyperlink map to
check one by one if we have the hyperlink. This O(N) is much slower than
allocating (in this case) but N is usually low on top of this case being
rare.
A better solution would probably be to ensure we always have some % of
available space free in our string allocation table. This would result
in some wasteful page reallocs but would speed up the render loop. We
can look into that later.
When set, the cursor-invert-fg-bg option uses the inverted foreground
and background colors of the cursor's current cell to color the cursor,
rather than using a fixed color. This option has higher precedence than
the cursor-color and cursor-text options, but has lower precedence than
an OSC 12 command to change the cursor color.
The inspector lists modes by their parameter when used to enable or
disable the mode. Private modes are enabled by using a '?' in the
sequence - however this '?' character was prepended to the ANSI modes.
Left a FIXME where the "Copy" button action is disabled.
Though very hackish this was the best way I found to do this currently.
Disable sensitivity on the button didn't do anything and trying to
remove the button altogether like on macOS, causes the menu to become
really buggy. Either by the context menu turning into a scrollable list
or by it becoming really janky and showing the user pre-update UI.
Two bugs:
1. If our pin is the top page, and self.y == top.y, then x will tell us
the answer. Before, we'd fall through.
2. If our pin is not the top or bottom, but the top == bottom, then we
can't possibly be between. Before, we'd incorrectly check the linked
list starting AFTER top.