Adds -e handling to both completions. Updates eval overhead on fish to
avoid similar adjustments made in #2962. Fixes improperly escaped sed
expression for generating theme names in completions.
I agree to re-license these commits as MIT
Fix a couple issues that arose from the unified metrics stuff.
One is that cursor sprites weren't rendering wide for wide characters-
I've extracted cursor rendering to a separate file so it's not mixed in
with Box any more, it should be correct now.
The other issue is that I was assuming most fonts had sane `sTypo*`
metrics for vertical sizing, but I was very wrong, so I've replaced the
extraction of the vertical metrics with code that performs a similar
process to what FreeType does to determine a font's ascent. This fixes
the problem, here's an example with a font with the issue:
|Before|After|
|-|-|
|<img width="752" alt="image"
src="https://github.com/user-attachments/assets/71752b0c-35d7-4c35-b5bb-301149d906a7"
/>|<img width="752" alt="image"
src="https://github.com/user-attachments/assets/2f9ae8ce-9f3a-4701-b0fe-e032da7e2246"
/>|
This is a big one, I kind of over scoped a touch. I don't have it in me
to do a clean-up pass on this code before PR-ing it, so apologies for
any weirdness; I'll happily resolve any feedback, but trying to review
my own code right now is not something my brain wants to do.
#### Summary
- Font metric calculations reworked to be based primarily on data from
font tables, and now the majority of the logic is shared between
CoreText and FreeType, and we have more control over the specifics.
- Sprite font metrics for the position and thickness of underlines,
strikethroughs, and overlines are now separate, as well as box drawing
thickness, allowing for individual adjustments.
- Minimums are applied to font metrics to avoid *completely* broken
results from fonts with degenerate values in them.
### Unified Metrics Calculations
I added a solid foundation for parsing as many SFNT font tables as we
need, and added parsing for `head`, `hhea` (unused), `post`, and `OS/2`.
I didn't make a strong effort to account for variable fonts, so if a
variable font changes vertical metrics significantly it could cause
issues -- luckily, width, which is the most likely metric to change, is
not a problem, since we get the width by having our backends measure the
advances for us, which does account for variations correctly.
### Separated Sprite Metrics
I reworked the sprite renderer to just get a copy of the metrics that it
can use directly, instead of being given its own metrics (width, height,
thickness) -- so that the different thickness metrics can be used for
their intended purposes, and so that offsets for "unadjusted" characters
can be handled in the Box renderer itself.
### Minimums
Prevent degenerate fonts and bad `adjust` configs from creating, e.g.
zero-thickness underlines by applying a minimum to certain fields after
calculating metrics and after applying modifiers.
### Misc.
Fixed `init` for CoreText faces selecting the first predefined instance
of a variable font rather than the default.
This fixes the #2847. There were two problems:
1. Documentation made it easy to use the bash example as a template for
calling other integrations
2. f the ZSH integration script is called the same way as for bash, it
would clobber the options
This PR fixes both. Now the ZSH script can be simply called with
`source`.
Here is why the options were clobbered, and how the method of calling
affected it:
The `-L` flag (local scope) ensures that the emulation mode only applies
to the current function scope. When the function ends, the shell reverts
to its previous state. When called outside of a function, the flags
persist even after the script execution ends.
The recommended way of calling the ZSH integration included `autoload
-Uz` that created a function with the integration script as its body.
When called directly, the assumptions about being in the function body
broke.
This PR moves a lot of code into a function, so it's best to review with
whitespace ignored in the diff.
In multiple tests we create 1 or more pages by growing them 1 row at a
time, which results in an integrity check of the page for each row grown
which is just... horrible. By simply pausing integrity checks while
growing these pages (since growing them is not the point of the test) we
MASSIVELY speed up all of these tests.
Also reduced grapheme bytes during testing and made the Terminal "glitch
text" test actually assert what it intends to achieve, rather than just
blindly assuming 100 copies of the text will be the right amount -- this
lets us stop a lot earlier, making it take practically no time.
In multiple tests we create 1 or more pages by growing them 1 row at a
time, which results in an integrity check of the page for each row grown
which is just... horrible. By simply pausing integrity checks while
growing these pages (since growing them is not the point of the test) we
MASSIVELY speed up all of these tests.
Also reduced grapheme bytes during testing and made the Terminal "glitch
text" test actually assert what it intends to achieve, rather than just
blindly assuming 100 copies of the text will be the right amount -- this
lets us stop a lot earlier, making it take practically no time.
I've added a weekly github actions workflow that automatically creates a
PR to update the iTerm2 colorschemes dependency and the zig cache hash
alongside it. I'm using a third-party action to create the pull request
such that it won't create another PR if a pending one exists already,
and will force-push to the PR branch (iterm2_colors_action) instead.
I noticed that the other workflows made use of namespace runners and
caching along with a cachix action, but I haven't included them here
yet. I could update the workflow to match those if you'd like.
… break
Fixes#2941
This fixes the rendering of the text below. For those that can't see it,
it is the following in UTF-32: `0x22 0x1F3FF 0x22`.
```
"🏿"
```
`0x1F3FF` is the Fitzpatrick modifier for dark skin tone. It has the
Unicode property `Emoji_Modifier`. Emoji modifiers are defined in UTS
#51 and are only valid based on ED-13:
```
emoji_modifier_sequence := emoji_modifier_base emoji_modifier
emoji_modifier_base := \p{Emoji_Modifier_Base}
emoji_modifier := \p{Emoji_Modifier}
```
Additional quote from UTS #51:
> To have an effect on an emoji, an emoji modifier must immediately
follow
> that base emoji character. Emoji presentation selectors are neither
needed
> nor recommended for emoji characters when they are followed by emoji
> modifiers, and should not be used in newly generated emoji modifier
> sequences; the emoji modifier automatically implies the emoji
presentation
> style.
Our precomputed grapheme break table was mistakingly not following this
rule. This commit fixes that by adding a check for that every
`Emoji_Modifier` character must be preceded by an `Emoji_Modifier_Base`.
This only has a cost during compilation (table generation). The runtime
cost is identical; the table size didn't increase since we had leftover
bits we could use.
Load and display (`T`) was responding even with implicit IDs, because
the display was achieved with an early return in the transmit function
that bypassed the logic to silence implicit ID responses- by making it
not an early return we fix this.
Fixes#2941
This fixes the rendering of the text below. For those that can't see it,
it is the following in UTF-32: `0x22 0x1F3FF 0x22`.
```
"🏿"
```
`0x1F3FF` is the Fitzpatrick modifier for dark skin tone. It has the
Unicode property `Emoji_Modifier`. Emoji modifiers are defined in UTS
#51 and are only valid based on ED-13:
```
emoji_modifier_sequence := emoji_modifier_base emoji_modifier
emoji_modifier_base := \p{Emoji_Modifier_Base}
emoji_modifier := \p{Emoji_Modifier}
```
Additional quote from UTS #51:
> To have an effect on an emoji, an emoji modifier must immediately follow
> that base emoji character. Emoji presentation selectors are neither needed
> nor recommended for emoji characters when they are followed by emoji
> modifiers, and should not be used in newly generated emoji modifier
> sequences; the emoji modifier automatically implies the emoji presentation
> style.
Our precomputed grapheme break table was mistakingly not following this
rule. This commit fixes that by adding a check for that every
`Emoji_Modifier` character must be preceded by an `Emoji_Modifier_Base`.
This only has a cost during compilation (table generation). The runtime
cost is identical; the table size didn't increase since we had leftover
bits we could use.
Load and display (`T`) was responding even with implicit IDs, because
the display was achieved with an early return in the transmit function
that bypassed the logic to silence implicit ID responses- by making it
not an early return we fix this.
This reverts commit daa0fe00b16989cf4696c686aab33b80763834a3. It is
correct to use the pkg-config name instead of the literal dylib name.
Sorry I didn't know about pkg-config needing to be installed at the time
and zig searching for the lib directly as a fallback
I believe the correct permission bits are 644 (read) instead of (755)
executable as this is not an executable file and works without
executable permissions