Previous logic had multiple issues that were hiding in edge cases of
edge cases with the ressurected item handling among other things; the
added assertIntegrity method finds these issues, the primary one being
an edge case where an ID is present in two different buckets.
Added more comments to explain logic in more detail and fixed a couple
little things like always using `+%` when incrementing the probe pos,
and replacing a silent return on an integrity issue that should be
impossible (`table[item.meta.bucket] != id`) with an assert.
There was an accidental use of `undefined` which I believe is the source
of crashes people are experiencing when drawing Powerline chevrons
(#3083). I've resolved this by using the slice from the path's internal
`ArrayList` instead of the backing array (`z2d` should probably
introduce a `getNodes()` method or similar to `StaticPath`), and also
annotated all `StaticPath` uses counting the maximum number of nodes
that may be required.
(**Edit**: confirmed, fixes#3083)
Annotate the node count of all uses of z2d `StaticPath` to verify
correctness, adjusted the size of a couple which were oversized, and
changed all painter calls that take node slices from `StaticPath`s to
use the slice from the wrapped `ArrayList` so that we don't include any
potentially `undefined` nodes at the end of the list, which I think was
causing a crash before.
Fixes#2092
This isn't perfect because it only prevents _new_ splits from being too
small. You can still resize the window to make them smaller. This just
helps prevent the very-easy-to-trigger crash of #2092.
We don't need to do this to macOS because it doesn't crash in the same
way with zero-sized splits.
Long term we should really chase down what breaks in GTK at a root level
when we have zero-sized splits. But this is a quick fix for now to
prevent the easy crash I feel like people might stress test and run into
with the 1.0 release.
Fixes#2092
This isn't perfect because it only prevents _new_ splits from being
too small. You can still resize the window to make them smaller. This
just helps prevent the very-easy-to-trigger crash of #2092.
We don't need to do this to macOS because it doesn't crash in the same
way with zero-sized splits.
Long term we should really chase down what breaks in GTK at a root level
when we have zero-sized splits. But this is a quick fix for now to
prevent the easy crash I feel like people might stress test and run into
with the 1.0 release.
From:
https://github.com/ghostty-org/ghostty/discussions/2363#discussioncomment-11645228
The justification there makes sense to me and I think it would be a good
change to make. Copied here:
> There are a few bindings that feel a little weird on macOS. My
suggestions:
>
> (1) Equalize Splits
> ```
> keybind = shift+opt+equal=unbind
> keybind = ctrl+cmd+equal=equalize_splits
> ```
> The default hijacks the `±` character on US keyboards. Believe it or
not, I do use ± in the terminal. Ctrl+cmd+equal matches the arrow key
bindings in the Window > Resize Split menu and thus looks more elegant
and is easier to memorize.
>
> (2) Jump to Prompt
> ```
> keybind = cmd+up=jump_to_prompt:-1
> keybind = cmd+down=jump_to_prompt:1
> ```
> These are the bindings in Terminal.app. The default shift-cmd-up/down
is usually associated with extending a selection. Cmd-up/down are
available (they currently act as simple up/down). I bind them
additionally to the defaults.
From: https://github.com/ghostty-org/ghostty/discussions/2363#discussioncomment-11645228
The justification there makes sense to me and I think it would be a good
change to make. Copied here:
> There are a few bindings that feel a little weird on macOS. My suggestions:
>
> (1) Equalize Splits
> ```
> keybind = shift+opt+equal=unbind
> keybind = ctrl+cmd+equal=equalize_splits
> ```
> The default hijacks the `±` character on US keyboards. Believe it or not, I do use ± in the terminal. Ctrl+cmd+equal matches the arrow key bindings in the Window > Resize Split menu and thus looks more elegant and is easier to memorize.
>
> (2) Jump to Prompt
> ```
> keybind = cmd+up=jump_to_prompt:-1
> keybind = cmd+down=jump_to_prompt:1
> ```
> These are the bindings in Terminal.app. The default shift-cmd-up/down is usually associated with extending a selection. Cmd-up/down are available (they currently act as simple up/down). I bind them additionally to the defaults.
Fixes#3072
Previously, when `window-theme = auto`, the appearance was delayed
enough on the DispatchQueue that the window was already visible. This
would result in the window appearing with the wrong appearance before
switching to the correct one.
For annoying reasons, we can't set the NSApplication.shared.appearance
in `applicationDidFinishLaunching` because it results in a deadlock with
AppKit.
This commit moves to set the `NSWindow.appearance` in `windowDidLoad`
(and any config sync) to ensure that the appearance is set before the
window is visible.
This is probably the right solution anyways because this allows windows
with different background colors to each have their own distinct
appearance.
Fixes#3072
Previously, when `window-theme = auto`, the appearance was delayed
enough on the DispatchQueue that the window was already visible. This
would result in the window appearing with the wrong appearance before
switching to the correct one.
For annoying reasons, we can't set the NSApplication.shared.appearance
in `applicationDidFinishLaunching` because it results in a deadlock with
AppKit.
This commit moves to set the `NSWindow.appearance` in `windowDidLoad`
(and any config sync) to ensure that the appearance is set before the
window is visible.
This is probably the right solution anyways because this allows windows
with different background colors to each have their own distinct
appearance.
In a [Discord
thread](https://discord.com/channels/1005603569187160125/1319727495473397791)
someone was having problems running Ghostty because they had
accidentally created a directory called `~/.config/ghostty/config`.
Instead of erroring out Ghostty would hang trying to "read" the
directory. Crashes can also happen if the argument to `--config-file` on
the CLI or a recursively loaded config file.
This patch prevents those hangs or crashes by refusing to read anything
but a plain file (symbolic links to plain files continue to work as
well).
Introduces static path methods and a reworked context API that makes
things generally cleaner.
This update incidentally fixed a bug we had before where the corner
triangle shade characters were drawn solid rather than medium shade.
### `Box_test_diff.ppm`:

Introduces static path methods and a reworked context API that makes
things generally cleaner.
This update incidentally fixed a bug we had before where the corner
triangle shade characters were drawn solid rather than medium shade.
Subsumes #2580 (which has multiple conflicts with main due to recent
changes to metrics); I figured it'd be easier to just implement it this
way.
#2580 claimed to solve #2487 but I don't think it really does- ideally
we can think of a good way to configure each individual cursor type, but
I don't wanna just do something ad hoc and add a bunch of config keys
blindly so I limited the scope of this.
Unicode 16 added "Separated Block Quadrants" from CP 0x0x1CC21 through
0x1CC2F:
To test, use the following command:
```
printf "\U0001CC21\U0001CC22\U0001CC23\U0001CC24\U0001CC25\U0001CC26\U0001CC27\U0001CC28\U0001CC29\U0001CC2A\U0001CC2B\U0001CC2C\U0001CC2D\U0001CC2E\U0001CC2F\n"
```
Which should look like this:

cc @qwerasd205 @rockorager
This adds a `+show-face` CLI action to show what font face Ghostty will
use to display a particular codepoint. The codepoint can either be
specified via a single integer or via UTF-8 encoded string.

## Description
Introduce a setting allowing to customize the behavior of the quick
terminal when it loses focus. By default, the quick terminal will
automatically hide. However, you can now configure it to remain open by
setting `quick-terminal-autohide: false`.
Resolves#2558
After upgrading Ghostty to the latest release, b92fb2d9, the unfocused
split color was quite different:
<img width="931" alt="image"
src="https://github.com/user-attachments/assets/9ff21db8-0280-416f-8119-2b0d1f08efc4"
/>
This was surprising because I don't set `unfocused-split-fill` so it
should use the background color.
I traced this to 298d6194f4c4de6727b6391b631d4d7f54d7f6b1 where the blue
and green components are divided by 255 but not the red.
Although I'm sure this should be easy to reproduce, the relevant bits of
my configuration file are included below:
```
theme = catppuccin-frappe
unfocused-split-opacity = 0.95
```
This fixes#3065.
This is some last minute flare to get into the 1.0 release. 😄
This introduces some new configurations to let you customize the macOS
app icon at runtime. The runtime icon only applies to certain areas such
as the dock, cmd-tab, etc. It does not change the icon in Finder or on
disk since Apple requires those icons are bundled as files with the
signed app bundle (i.e. you can't change it later without resigning).
I still think this introduces a lot of fun into the macOS app. 😄
I'm still finalizing the exact customization options that will exist for
the icon, so I documented this option as experimental. I'm feeling
pretty good about what's there but I may add other options in the
future.
## Demo
### Beige Yellow
```
macos-icon = custom-style
macos-icon-frame = beige
macos-icon-ghost-color = yellow
macos-icon-screen-color = dark goldenrod,dark khaki
```

### Laker Nation
```
macos-icon = custom-style
macos-icon-ghost-color = yellow
macos-icon-screen-color = purple,maroon
```

Introduce a setting allowing to customize the behavior of the quick terminal
when it loses focus. By default, the quick terminal will automatically hide.
However, you can now configure it to remain open by setting
`quick-terminal-autohide: false`.
Resolves#2558
We used a mix of shorthand and octal representations when printing these
control characters. Standardize on the shorter, more readable shorthand
notation because that's what we use in the other shell integration
scripts.
We used a mix of shorthand and octal representations when printing these
control characters. Standardize on the shorter, more readable shorthand
notation because that's what we use in the other shell integration
scripts.
When outside the viewport, other actions such as scrolling might be
happening, and doing an early return when clearing hyperlinks prevents
scrolling upwards.
We reposition the check, and do not early return so we can process
scrolling when it happens.
This fixes#2645, restoring the ability to scroll upwards while
retaining the behavior of hyperlinks when outside the viewport.
(and, yes I still permit my commits to be relicensed to MIT)
## Before
[Screen Recording 2024-12-21 at
01.36.02.webm](https://github.com/user-attachments/assets/bf144455-ff26-4d4e-9eff-c3d632c02c17)
## After
[Screen Recording 2024-12-21 at
01.36.44.webm](https://github.com/user-attachments/assets/308a795f-971d-4807-b4ba-91bd3685c185)
Given https://github.com/ghostty-org/ghostty/discussions/2994 revert
f1728f594a.
Add documentation to help point people towards the discussion and needed
changes to handle `COMP_WORDBREAKS` not including expected characters.
We know macOS and nixos defaults to including `=` so explicit handling
to change behaviour should only be required if it turns out some
systematically used tool brings in a completion function that changes
`COMP_WORDBREAKS` away from the default. (something they should not be
doing)
If necessary I can create a issue to track handling unexpected word
breaks usage. This change improves the current completions.
I agree to re-license my commits to MIT