Commit Graph

12787 Commits

Author SHA1 Message Date
Mitchell Hashimoto
5c574e7745 macos: use TextEditor instead of Text for clipboard confirmation (#9324)
Fixes #9322

SwiftUI `Text` has huge performance issues. On my maxed out MBP it hangs
for any text more than 100KB (it took ~8s to display it!). `TextEditor`
with a constant value works much better and handles scrolling for us,
too!
2025-10-23 09:22:35 -07:00
Daniel Wennberg
e2fe0cf53a macOS: remove scroll edge styling with hidden titlebar (#9317)
With `macos-titlebar-style = hidden`, creating splits or cycling
fullscreen sometimes produces a transparent overlay in the titlebar
area, clipping the top of the surfaces:

<img width="504" height="272" alt="Screenshot 2025-10-22 at 21 27 28"
src="https://github.com/user-attachments/assets/e28c5226-2e47-4c1d-8c14-b286fdb261f3"
/>

This is actually SwiftUI styling for scroll views, and the fact that it
pops up even though the titlebar is hidden is possibly a SwiftUI bug; at
least it's causing frustration for others too, see
https://developer.apple.com/forums/thread/798392 and
https://stackoverflow.com/questions/79776037/strange-nsscrollpocket-height-on-my-nstableview-in-fullscreen-mode-on-macos-taho.

I tried setting `.scrollEdgeEffectHidden()` on various nodes in the
SwiftUI hierarchy, but couldn't get it to work, so I ended up resorting
to an old-fashioned game of imperative whack-a-mole. Now:

<img width="504" height="272" alt="Screenshot 2025-10-22 at 21 28 47"
src="https://github.com/user-attachments/assets/e4499f16-5bd0-43cd-a7de-37fbc56eb1c4"
/>

AI disclosure (my first!): I consulted copilot trying to figure out of
the whole SwiftUI/AppKit situation and whether there might be a
declarative solution on the SwiftUI side. Just chatting in general terms
without showing real-world code. No dice.
2025-10-23 08:33:39 -07:00
Mitchell Hashimoto
b764055c33 macos: window-position-x/y works with window-width/height (#9313)
Fixes #9132

We were processing our window size defaults separate from our window
position and the result was that you'd get some incorrect behavior.
Unify the logic more to fix the positioning.

Note there is room to improve this further, I think that all initial
positioning could go into the controller completely. But I wanted to
minimize the diff for a backport.
2025-10-22 16:14:28 -07:00
Mitchell Hashimoto
bdbda2fd83 input: accidentally merged a loud log line 2025-10-22 15:36:21 -07:00
Mitchell Hashimoto
c133fac7e7 lib-vt: wasm convenience functions and a simple example (#9309)
This adds a set of Wasm convenience functions to ease memory management.
These are all prefixed with `ghostty_wasm` and are documented as part of
the standard Doxygen docs.

I also added a very simple single-page HTML example that demonstrates
how to use the Wasm module for key encoding.

This also adds a bunch of safety checks to the C API to verify that
valid values are actually passed to the function. This is an easy to hit
bug.

**AI disclosure:** The example is AI-written with Amp. I read through
all the code and understand it but I can't claim there isn't a better
way, I'm far from a JS expert. It is simple and works currently though.
Happy to see improvements if anyone wants to contribute.
2025-10-22 14:25:52 -07:00
Mitchell Hashimoto
9dc2e5978f lib-vt: enable freestanding wasm builds (#9301)
This makes `libghostty-vt` build for freestanding wasm targets (aka a
browser) and produce a `ghostty-vt.wasm` file. This exports the same C
API that libghostty-vt does.

This commit specifically makes the changes necessary for the build to
build properly and for us to run the build in CI. We don't yet actually
try using it...
2025-10-21 20:55:54 -07:00
Jared Gizersky
3548acfac6 os: handle nil languageCode/countryCode in setLangFromCocoa (#9290)
Fixes a crash when NSLocale returns nil for languageCode or countryCode
properties. This can happen when the app launches without locale
environment variables set.

The crash occurs at `src/os/locale.zig:87-88` when trying to call
`getProperty()` on a nil object. The fix adds a null check and falls
back to `en_US.UTF-8` instead of dereferencing null.

## Testing
Tested by running with locale variables unset:
```bash
unset LC_ALL && ./zig-out/Ghostty.app/Contents/MacOS/ghostty
```

Before: segmentation fault  
After: launches successfully with fallback locale
2025-10-20 20:27:04 -07:00
Mitchell Hashimoto
da165fc3cf input: modify other keys 2 should use all mods, ignore consumed mods (#9289)
Fixes #8900

Our xterm modify other keys state 2 encoding was stripped consumed mods
from the keyboard event. This doesn't match xterm or other popular
terminal emulators (but most importantly: xterm). Use the full set of
mods and add a test to verify this.

Reproduction:

```
printf '\033[>4;2m' 
cat
```

Then press `ctrl+shift+h` and compare across terminals.
2025-10-20 14:41:35 -07:00
Mitchell Hashimoto
0546606e05 build: add -Demit-themes option to emit/omit theme resources (#9288)
We'll backport this to 1.2.x for distros that would prefer this.
2025-10-20 13:14:42 -07:00
Matthew Hrehirchuk
2696d50ca4 feat: added mouse-reporting / toggle-mouse-reporting (#9282)
Closes #8430

A few questions:
* Should I set a default keybind for `toggle-mouse-reporting`? The issue
mentioned one, it's currently unset.
* Am I handling the `toggle-mouse-reporting` action properly in
`performAction` (gtk) / `action` (macos)?

Copilot was used to understand the codebase, but code was authored
manually.
2025-10-19 20:45:37 -07:00
Mitchell Hashimoto
1b86691896 termio: use a union to represent how a process is started (#9278)
This cleans up some of our termio exec code by unifying process launch
state into a single union type. This makes it easier to distinguish
between the current two mutually exclusive modes of launching a process:
fork/exec and flatpak dbus commands.

It also ensures everyplace we touch related to process launching is
forced to address every case (exhaustive switch handling). I did find
one resource cleanup bug based on this cleanup, which is also fixed
here. This just improves memory slightly so it's not a big deal.

If we add future ways to launch processes, we can add a new union case.
For example, I originally had a `posix_spawn` option while I was
experimenting with that before abandoning it (see #9274).
2025-10-19 20:43:28 -07:00
Mitchell Hashimoto
014de2992e macos: goto_split direction is performable (#9284)
Fixes #9283

There was a comment here noting this deficiency. GTK implements this
properly.
2025-10-19 20:29:36 -07:00
Mitchell Hashimoto
c65e837b22 cli: fix +ssh-cache IPv6 address validation (#9281)
The host validation code previously expected IPv6 addresses to be
enclosed in [brackets], but that's not how ssh(1) expects them.

This change removes that requirement and reimplements the host
validation routine to check for valid hostnames and IP addresses (IPv4
and IPv6) using standard routines rather than custom logic.

Fixes #9251
2025-10-19 19:47:41 -07:00
Mitchell Hashimoto
88ec71dd5a build(deps): bump flatpak/flatpak-github-actions from 6.5 to 6.6 (#9279)
Bumps
[flatpak/flatpak-github-actions](https://github.com/flatpak/flatpak-github-actions)
from 6.5 to 6.6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/flatpak/flatpak-github-actions/releases">flatpak/flatpak-github-actions's
releases</a>.</em></p>
<blockquote>
<h2>v6.6</h2>
<ul>
<li>Specify full URL policy when mirroring screenshots</li>
<li>Fix restore cache keys to actually include arch</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="92ae9851ad"><code>92ae985</code></a>
Fix restore cache keys to actually include arch</li>
<li><a
href="b8a638469e"><code>b8a6384</code></a>
Specify full URL policy when mirroring screenshots</li>
<li><a
href="6684584b07"><code>6684584</code></a>
Switch funding to flatpak instead</li>
<li><a
href="e5aa88fb51"><code>e5aa88f</code></a>
readme: Update flathub images list</li>
<li><a
href="b93832bada"><code>b93832b</code></a>
Sync readme from flathub's fork</li>
<li>See full diff in <a
href="10a3c29f01...92ae9851ad">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=flatpak/flatpak-github-actions&package-manager=github_actions&previous-version=6.5&new-version=6.6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
2025-10-19 19:46:46 -07:00
Mitchell Hashimoto
58a1b60a4b build(deps): bump namespacelabs/nscloud-cache-action from 1.2.18 to 1.2.19 (#9280)
Bumps
[namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action)
from 1.2.18 to 1.2.19.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/namespacelabs/nscloud-cache-action/releases">namespacelabs/nscloud-cache-action's
releases</a>.</em></p>
<blockquote>
<h2>v1.2.19</h2>
<h2>What's Changed</h2>
<ul>
<li>Add <code>Playwright</code> cache framework by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/40">namespacelabs/nscloud-cache-action#40</a></li>
<li>Add <code>apt</code> cache framework by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/39">namespacelabs/nscloud-cache-action#39</a></li>
<li>Bump GitHub action workflows by <a
href="https://github.com/deining"><code>@​deining</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/37">namespacelabs/nscloud-cache-action#37</a></li>
<li>Warn if mounted cache directory already exists by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/38">namespacelabs/nscloud-cache-action#38</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/rcrowe"><code>@​rcrowe</code></a> made
their first contribution in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/40">namespacelabs/nscloud-cache-action#40</a></li>
<li><a href="https://github.com/deining"><code>@​deining</code></a> made
their first contribution in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/37">namespacelabs/nscloud-cache-action#37</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1...v1.2.19">https://github.com/namespacelabs/nscloud-cache-action/compare/v1...v1.2.19</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="caff5c9dc5"><code>caff5c9</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/38">#38</a>
from rcrowe/mount-target-exists-error</li>
<li><a
href="4e2102fe86"><code>4e2102f</code></a>
Catch filesystem errors</li>
<li><a
href="e84601ffd1"><code>e84601f</code></a>
Handle case where mount target exists</li>
<li><a
href="4878cb2fed"><code>4878cb2</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/37">#37</a>
from deining/bump-workflows</li>
<li><a
href="818af18748"><code>818af18</code></a>
bump go versions</li>
<li><a
href="bf91808d15"><code>bf91808</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/39">#39</a>
from rcrowe/apt-framework</li>
<li><a
href="7245a34835"><code>7245a34</code></a>
Address feedback with clearer variable names</li>
<li><a
href="bf55a8733d"><code>bf55a87</code></a>
add actions workflow to test</li>
<li><a
href="856ef89a7a"><code>856ef89</code></a>
apt-config is noisy in the logs</li>
<li><a
href="fd911d7189"><code>fd911d7</code></a>
Remove docker-clean script</li>
<li>Additional commits viewable in <a
href="7baedde84b...caff5c9dc5">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=namespacelabs/nscloud-cache-action&package-manager=github_actions&previous-version=1.2.18&new-version=1.2.19)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
2025-10-19 19:46:39 -07:00
Jon Parise
e522482710 cli: fix +ssh-cache IPv6 address validation
The host validation code previously expected IPv6 addresses to be
enclosed in [brackets], but that's not how ssh(1) expects them.

This change removes that requirement and reimplements the host
validation routine to check for valid hostnames and IP addresses (IPv4
and IPv6) using standard routines rather than custom logic.
2025-10-19 20:31:32 -04:00
dependabot[bot]
d01697e7d5 build(deps): bump namespacelabs/nscloud-cache-action
Bumps [namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action) from 1.2.18 to 1.2.19.
- [Release notes](https://github.com/namespacelabs/nscloud-cache-action/releases)
- [Commits](7baedde84b...caff5c9dc5)

---
updated-dependencies:
- dependency-name: namespacelabs/nscloud-cache-action
  dependency-version: 1.2.19
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 00:10:08 +00:00
dependabot[bot]
b2559e8d92 build(deps): bump flatpak/flatpak-github-actions from 6.5 to 6.6
Bumps [flatpak/flatpak-github-actions](https://github.com/flatpak/flatpak-github-actions) from 6.5 to 6.6.
- [Release notes](https://github.com/flatpak/flatpak-github-actions/releases)
- [Commits](10a3c29f01...92ae9851ad)

---
updated-dependencies:
- dependency-name: flatpak/flatpak-github-actions
  dependency-version: '6.6'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-20 00:09:59 +00:00
Mitchell Hashimoto
40e558f953 os: remove unused UrlParsingError (#9275)
This is no longer used as of e5247f6d.
2025-10-19 15:16:45 -07:00
Mitchell Hashimoto
78621622e6 os: add RFC 1123-compliant hostname.isValid (#9276)
std.net.isValidHostname is currently too generous. It considers strings
like ".example.com", "exa..mple.com", and "-example.com" to be valid
hostnames, which is incorrect according to RFC 1123 (the currently
accepted standard).

Until the standard library function is improved, we can use this local
implementation that does follow the RFC 1123 standard.

I asked Claude to perform an audit of the code based on its understand
of the RFC. It suggested some additional test cases and considers the
overall implementation to be robust (its words) and standards compliant.

Ref: https://www.rfc-editor.org/rfc/rfc1123
2025-10-19 15:16:12 -07:00
Jon Parise
010cbce220 os: add RFC 1123-compliant hostname.isValid
std.net.isValidHostname is currently too generous. It considers strings
like ".example.com", "exa..mple.com", and "-example.com" to be valid
hostnames, which is incorrect according to RFC 1123 (the currently
accepted standard).

Until the standard library function is improved, we can use this local
implementation that does follow the RFC 1123 standard.

I asked Claude to perform an audit of the code based on its understand
of the RFC. It suggested some additional test cases and considers the
overall implementation to be robust (its words) and standards compliant.

Ref: https://www.rfc-editor.org/rfc/rfc1123
2025-10-19 14:36:02 -04:00
Jon Parise
73da748390 os: remove unused UrlParsingError
This is no longer used as of e5247f6d.
2025-10-19 13:12:32 -04:00
Mitchell Hashimoto
94c5572029 fix: fish shell integration should not update the universal fish_user_paths variable (#9273)
`fish_add_path` by default updates the `fish_user_paths` universal
variable which makes the modification persist across shell sessions.

The integration also tries to update the `fish_user_paths` when the
desired path already appears in the `PATH` environment variable but not
in `fish_user_paths`. Because `fish_user_paths` will always be inserted
before the inherited `PATH` env. This makes the added path
unintentionally has a higher priority.

This patch fixes the above issues by adding `--global` and `--path`
options to `fish_user_paths` which limits the modification scope and
ensures that the path won't be added if it already exists in `PATH`.

Ref: https://fishshell.com/docs/current/cmds/fish_add_path.html
2025-10-19 08:19:01 -07:00
Sola
c6788dd178 fix: fish shell integration should not modify universal path variable
`fish_add_path` by default updates the `fish_user_paths` universal
variable which makes the modification persist across shell sessions.

The integration also tries to update the `fish_user_paths` when the
desired path already appears in the `PATH` environment variable but
not in `fish_user_paths`. Because `fish_user_paths` will always be
inserted before the inherited `PATH` env. This makes the added path
unintentionally has a higher priority.

This patch makes the above issues by adding `--global` and `--path`
options to `fish_user_paths` which limits the modification scope and
ensures that the path won't be added if it already exists in `PATH`.
2025-10-19 20:46:48 +08:00
Mitchell Hashimoto
f74bfdaa2a Update iTerm2 colorschemes (#9269)
Upstream release:
https://github.com/mbadolato/iTerm2-Color-Schemes/releases/tag/release-20251013-150525-147b9d3
2025-10-18 21:34:50 -07:00
Mitchell Hashimoto
be608ea2d1 renderer: don't allow the scrollbar state to block the renderer (#9270)
This fixes the source of a deadlock that some tip users have hit. If our
surface mailbox is full and there is a dirty scrollbar state, then
drawFrame would block forever trying to queue to the surface mailbox.

We now fail instantly if the queue is full and keep the scrollbar state
dirty. We can try again on the next frame, it's not a critical thing to
get updated.
2025-10-18 21:34:27 -07:00
Mitchell Hashimoto
3a9eedcd15 renderer: don't allow the scrollbar state to block the renderer
This fixes the source of a deadlock that some tip users have hit. If our 
surface mailbox is full and there is a dirty scrollbar state, then
drawFrame would block forever trying to queue to the surface mailbox.

We now fail instantly if the queue is full and keep the scrollbar state
dirty. We can try again on the next frame, it's not a critical thing to
get updated.
2025-10-18 21:30:11 -07:00
mitchellh
92c9ba67d5 deps: Update iTerm2 color schemes 2025-10-19 00:15:26 +00:00
tdslot
be0da4845c 🌐 i18n(locale): add lithuanian language support (#8711)
Co-authored-by: Andrius Budvytis <154380884+abudvytis@users.noreply.github.com>
2025-10-18 19:27:39 +02:00
Mitchell Hashimoto
dffa4f4fc7 macos: use stable display UUID for quick terminal screen tracking (#9256)
NSScreen instances can be garbage collected at any time, even for
screens that remain connected, making NSMapTable with weak keys
unreliable for tracking per-screen state.

This changes the quick terminal to use CGDisplay UUIDs as stable
identifiers, keyed in a strong dictionary. Each entry stores the window
frame along with screen dimensions, scale factor, and last-seen
timestamp.

**This should make quick terminal size restore more stable than 1.2.2.**

Rules for pruning:
- Entries are invalidated when screens shrink or change scale
- Entries persist and update when screens grow (allowing cached state to
work with larger resolutions)
- Stale entries for disconnected screens expire after 14 days.
- Maximum of 10 screen entries to prevent unbounded growth
2025-10-17 21:14:56 -07:00
Mitchell Hashimoto
ea505ec51d macos: use stable display UUID for quick terminal screen tracking
NSScreen instances can be garbage collected at any time, even for
screens that remain connected, making NSMapTable with weak keys
unreliable for tracking per-screen state.

This changes the quick terminal to use CGDisplay UUIDs as stable
identifiers, keyed in a strong dictionary. Each entry stores the
window frame along with screen dimensions, scale factor, and last-seen
timestamp.

Rules for pruning:
- Entries are invalidated when screens shrink or change scale
- Entries persist and update when screens grow (allowing cached state
  to work with larger resolutions)
- Stale entries for disconnected screens expire after 14 days.
- Maximum of 10 screen entries to prevent unbounded growth
2025-10-17 21:04:23 -07:00
Mitchell Hashimoto
3e6bda1fff ci: run release-tip even if prior step failed 2025-10-17 21:03:23 -07:00
Mitchell Hashimoto
5bf05dfe31 macos: make terminal smaller to account for legacy scrollbar (#9255)
https://github.com/ghostty-org/ghostty/discussions/9254

When the preferred scrollbar style is "legacy", the scrollbar takes up
space that offsets the actual terminal. To prevent reflow, we detect
this before the scrollbar becomes visible and shrink our terminal width
to prepare for it.

This doesn't account for the style changing at runtime, yet.

## Demo

Notice even before scrollbars, the `gh` output doesn't wrap.


https://github.com/user-attachments/assets/8716ff4d-0660-48b1-aadb-0d31e0b70fcd
2025-10-17 20:18:10 -07:00
Mitchell Hashimoto
5b7f145640 macos: make terminal smaller to account for legacy scrollbar
When the preferred scrollbar style is "legacy", the scrollbar takes up
space that offsets the actual terminal. To prevent reflow, we detect
this before the scrollbar becomes visible and shrink our terminal width
to prepare for it.

This doesn't account for the style changing at runtime, yet.
2025-10-17 20:08:03 -07:00
Mitchell Hashimoto
e4db7f5487 font: Default to light hinting in FreeType (#9253)
This changes the default FreeType load target to `FT_LOAD_TARGET_LIGHT`,
giving the hinter a lighter touch in line with the default behavior in
most other GTK apps, and adds a load flag such that the old hinting
behavior can be restored via config.

As discussed in
https://github.com/ghostty-org/ghostty/issues/8674#issuecomment-3417082534.
However, this doesn't close that issue, as it still doesn't respect
custom Fontconfig settings. It's just a stopgap solution bringing
Ghostty's defaults more in line with the typical results of not
customizing Fontconfig.
2025-10-17 17:14:57 -07:00
Daniel Wennberg
ad9f9dc11e font: Default to light hinting in FreeType 2025-10-17 15:04:04 -07:00
Mitchell Hashimoto
3b8e683d96 renderer: force a full rebuild on any font grid change (#9252)
Fixes #2731 (again)

This regressed in 1.2 due to the renderer rework missing porting this. I
believe this issue is still valid even with the rework since the font
grid changes the atlas and if there are still cached cells that
reference the old atlas coordinates it will produce garbage.
2025-10-17 14:51:30 -07:00
Mitchell Hashimoto
1cc22f93ca renderer: force a full rebuild on any font grid change
Fixes #2731 (again)

This regressed in 1.2 due to the renderer rework missing porting this. I
believe this issue is still valid even with the rework since the font
grid changes the atlas and if there are still cached cells that
reference the old atlas coordinates it will produce garbage.
2025-10-17 14:46:58 -07:00
Mitchell Hashimoto
063070915f gtk: Scrollbars (#9245)
Fixes #111 

This builds on the prior work and adds scrollbars to the GTK
application. After this PR, both the macOS and GTK applications support
scrollbars and #111 can be closed.

## TODO

- [x] Verify that with text coming out if we manually scroll to the
bottom we bind to the bottom
- [x] Valgrind checks
2025-10-17 09:21:57 -07:00
Mitchell Hashimoto
ed443bc6ed gtk: Scrollbars 2025-10-17 09:19:02 -07:00
Mitchell Hashimoto
a2e95ce7b5 macOS: Remove hidden titlebar safe area and pad document height in SurfaceScrollView (#9241)
Fixes #9233. The issue was that the content view was effectively
truncated by `SurfaceScrollView`s safe area insets covering the titlebar
(I suppose the scroll view doesn't inherit the `ignoresSafeArea`
modifier on `TerminalSplitTreeView` because it's not actually a node in
that tree, it just contains a subview that is). I think it's OK to zero
these insets unconditionally, as I don't think the frame size passed
down from `SurfaceWrapper` will ever overlap with a visible titlebar.

This PR also fixes a somewhat related issue I discovered along the way.
In many cases, the mouse wouldn't work on the first row of text, whether
trying to select text or interact with TUI elements like neovim
bufferlines/tablines. When looking at the inspector while moving the
mouse around, you'd see the mouse position jump discontinuously from a
y-coordinate of 10-20 pixels to -3, i.e., no longer within the surface.

The problem turned out to be that the height of the document view only
included the text lines, not the window padding, while the content view
is sized to the surface including padding. If you imagine the
metaphorical sliding of the viewport up and down the document, and you
require the text to snap to a fixed grid on the viewport, it's clear
that the document must have the same top and bottom padding as the
viewport, otherwise the math breaks at the ends. Sure enough, adding
this padding fixed the problem.

To properly reproduce these issues and see the effect of the fixes, it's
helpful to change the system settings to always show scroll bars
(Appearance -> Show scroll bars -> Always). That's what connecting an
external mouse was all about. You should also remove the debug banner or
use a release build, otherwise the banner takes the place of the hidden
titlebar and conceals the issue.
2025-10-17 06:34:25 -07:00
Daniel Wennberg
51b2374616 Add window padding to scrollView document height 2025-10-17 00:14:21 -07:00
Daniel Wennberg
ffead466c7 Remove hidden titlebar safe area for SurfaceScrollView 2025-10-17 00:06:00 -07:00
Mitchell Hashimoto
58699c7992 macOS: remove background from SurfaceScrollView (#9234)
<img width="1157" height="126" alt="image"
src="https://github.com/user-attachments/assets/07f67e6c-76b3-4d7d-ba44-37e85b8660cc"
/>
2025-10-16 14:56:47 -07:00
Lars
cc91e2ad16 macOS: remove background from SurfaceScrollView 2025-10-16 23:52:07 +02:00
Mitchell Hashimoto
0e0bbfaa61 macOS: Scrollbars (#9232)
Completes #111 for macOS

This builds on #9225 and adds the native, macOS GUI scrollbars for
terminals.

This doesn't do GTK, but all the groundwork is there to make this easy
on GTK, depending on how scrollviews work there. I have to look into
that still. But in theory all the information and controls we provide
out of core are generic to _any_ scrollbar drawing.

## Demo


https://github.com/user-attachments/assets/85683bf9-1117-4f32-aaec-d926edd68c39

## Details

- The scrollbars respect your macOS system settings on style, color,
visibility.
- A new configuration `scrollbar` controls whether scrollbars are
visible (defaults to `system` allowing the system to choose).
- There is a new keybind action `scroll_to_row:N` that lets you jump to
an absolute row number N. This is implemented efficiently. This is how
grabbing the knob and scrolling works.
2025-10-16 14:09:33 -07:00
Mitchell Hashimoto
4b34b2389a config: add scrollbar config to control when scrollbars appear 2025-10-16 14:06:48 -07:00
Mitchell Hashimoto
7207ff08d5 macos: SurfaceScrollView 2025-10-16 14:06:46 -07:00
Mitchell Hashimoto
2937aff513 gtk: mark scrollbar as unimplemented 2025-10-16 09:36:47 -07:00
Mitchell Hashimoto
c86266cd90 input: scroll_to_row action 2025-10-16 09:11:03 -07:00