Commit Graph

14796 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7db8346fca apprt/gtk: fix SIGSEGV on ImGui GLArea re-realize
Fixes #10406

ImGui_ImplOpenGL3_Shutdown() calls imgl3wShutdown() which dlcloses the
GL library handles but does not zero out the imgl3w function pointer
table (imgl3wProcs). When a GLArea is re-realized (e.g. during
reparenting), ImGui_ImplOpenGL3_Init() calls ImGui_ImplOpenGL3_InitLoader()
which checks "if (glGetIntegerv == nullptr)". Since the stale pointers
are non-null, it skips re-initialization. The next GL call through a
dangling function pointer causes a SIGSEGV.

Fix this by introducing ImGui_ImplOpenGL3_ShutdownWithLoaderCleanup()
which calls the normal shutdown and then zeroes the imgl3wProcs table,
forcing the next Init to reload GL function pointers via imgl3wInit().

Also properly destroy the ImGui context and reset widget state in
glAreaUnrealize so re-realize starts clean. This was extra but was
probably leaking memory.
2026-02-25 15:25:22 -08:00
Mitchell Hashimoto
7935ae6649 macos: pass last focused surface as env, use for focus detection (#11024)
Fixes #10935

This is a more robust way to detect "is my surface focused" because that
question usually means "is my surface the last focused surface" if a
_different_ surface is not focused. We already have used this pattern
all over but we should extend it to SwiftUI too.
2026-02-25 14:08:34 -08:00
Mitchell Hashimoto
1c3f7601a7 macos: pass last focused surface as env, use for focus detection
Fixes #10935

This is a more robust way to detect "is my surface focused" because that
question usually means "is my surface the last focused surface" if a
_different_ surface is not focused. We already have used this pattern
all over but we should extend it to SwiftUI too.
2026-02-25 14:01:12 -08:00
ghostty-vouch[bot]
36cbbebc01 Update VOUCHED list (#11021)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11014#discussioncomment-15925945)
from @mitchellh.

Vouch: @amadeus

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-25 17:57:25 +00:00
Mitchell Hashimoto
8b1e4c66d7 macOS: fix crash when adding tab from tab overview (#11009)
(moved from #11008)

I have this branch up to fix #10252. It was written with AI (in Cursor),
but only after I made sure I thoroughly understood what was happening
(almost to an excessive extent). I had already determined that an
Objective-C helper was necessary, I just asked GPT 5.3 Codex in Cursor
to write it for me.

**TL;DR: deep within AppKit, there is an Objective-C exception that is
_always_ thrown when opening a new tab from the visual tab picker ("tab
overview"). [Objective-C exceptions *cannot* be safely recovered from in
Swift.](http://developer.apple.com/documentation/swift/handling-cocoa-errors-in-swift#Handle-Exceptions-in-Objective-C-Only)
As Ghostty is primarily Swift, we must introduce some Objective-C
wrapper around tab creation to safely swallow this exception.**

There is a lot more I know about this than the above, and can discuss it
at length if desired. Interestingly, it seems debug builds of Ghostty
(`zig build run`) *do* gracefully recover and don't crash. Release
builds (`zig build run -Doptimize=ReleaseFast`), however, *do* crash.
The crashing seems to be expected behavior and **_I don't think there's
any feasible way to get release builds to recover as debug builds do._**
The debug builds do, arguably, have better animation behavior. Not sure
how I can approach that part.

Release build off of my commit:


https://github.com/user-attachments/assets/c81927be-b2d2-48b3-a18f-30b389a90f04


Debug build off `db1e31c7a69924913e8faafcedb290de3cb4a8b6` (current
`main`, as of writing):


https://github.com/user-attachments/assets/76367154-b039-4453-8d39-8a0465973deb
2026-02-25 09:13:13 -08:00
Mitchell Hashimoto
26146f54c5 update comments 2026-02-25 09:04:20 -08:00
Mitchell Hashimoto
da045d2fb3 Remove ObjCExceptionCatcher from iOS target 2026-02-25 09:00:52 -08:00
Mitchell Hashimoto
304823d560 macos: just some textual cleanup 2026-02-25 08:58:09 -08:00
ghostty-vouch[bot]
4c8f2bc77b Update VOUCHED list (#11012)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11010#issuecomment-3956559518)
from @jcollie.

Vouch: @douglance

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-25 03:50:59 +00:00
ghostty-vouch[bot]
d1a32d382b Update VOUCHED list (#11007)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11006#discussioncomment-15917730)
from @jcollie.

Vouch: @nmggithub

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-25 01:36:51 +00:00
Noah Gregory
58acab6c7d Merge branch 'ghostty-org:main' into fix-tabbing-from-tab-overview 2026-02-24 20:24:18 -05:00
Noah Gregory
dd4e36f921 macOS: fix crash when adding tab from tab overview 2026-02-24 18:08:45 -05:00
Mitchell Hashimoto
6132597563 ci: codesign DockTilePlugin 2026-02-24 12:29:21 -08:00
Mitchell Hashimoto
99a47233af macOS: use NSDockTilePlugIn to update app icons (#9983)
* Using MAP prohibited `NSDockTilePlugIn` to update custom icons more
reliably. And it also fixes the corner radius issue on older os: #8870
* Changes in AboutWindow cc @jparise 
  * Start cycling with current icon
  * Stop cycling icons when AboutWindow is closed 
  * Add menu to copy icon config

<img width="166" height="63" alt="Xnip2025-12-20_18-40-58"
src="https://github.com/user-attachments/assets/52fc1215-909e-49c7-a37a-b7c73eef61f1"
/>

> [!WARNING]
> Upgrading from `macOS-custom-icon` needs to manually open the app once
to update the icon, since this plugin is running under
`com.apple.dock.external.extra.arm64`, which has sandbox enabled.
>
> When first upgraded to this commit, a notification about the dock
plugin will pop up. The user has to enable this to change the icon
smoothly.
> <img width="389" height="159" alt="image"
src="https://github.com/user-attachments/assets/a883ac6b-0b4d-4794-8c61-50b60707f6a2"
/>



Here are the testing results on
[Tahoe](https://github.com/user-attachments/assets/e5fc8354-5f5c-4280-805f-88f043ceadca)
and
[Sequoia](https://github.com/user-attachments/assets/633d9a07-7d9d-4806-8496-82ddaffb8833):

> When you see some pause in the recording, that's when I rebuild or
replace the older version with the latest.

This also fixes some issues when changing between different styles,
consistency issues, and resetting from others to `official`.


### Developer's Note

This shouldn't affect current CI flow, since this new target is just a
bundle not runnable, and I tested with archiving, exporting and signing
in Xcode, nothing big changed.


> [!NOTE]
> AI helped me to write the typo ignore-re and proofread my comments
2026-02-24 12:00:22 -08:00
Mitchell Hashimoto
06084cd840 macos: various dock tile cleanups 2026-02-24 10:38:02 -08:00
Jeffrey C. Ollie
0cf93a3e2f gtk: clean up title renaming and fix a small leak (#10997)
Also enables the "Change Title…" item in the main menu.
2026-02-24 12:37:34 -06:00
Mitchell Hashimoto
eaf7d8a012 macos: icon tests 2026-02-24 10:26:13 -08:00
Mitchell Hashimoto
f451ea8e46 macos: move icon codable/equatable to extension 2026-02-24 10:22:49 -08:00
ghostty-vouch[bot]
1087751d26 Update VOUCHED list (#10996)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10981#discussioncomment-15913757)
from @mitchellh.

Vouch: @Koranir

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-24 17:49:28 +00:00
Mitchell Hashimoto
245ea56597 update vouch to 1.4.2 2026-02-24 09:48:57 -08:00
Jeffrey C. Ollie
57d570525b gtk: clean up title renaming and fix a small leak 2026-02-24 10:28:33 -06:00
Kat
d0e308f32b i18n: Updated mk translations with new strings (#10985)
Issue #10632
2026-02-24 10:58:33 +00:00
Kat
8e135c4f9b i18n: update zh_TW translation (#10819)
Update to 2860dd29bb

Related to #10814
2026-02-24 10:02:56 +00:00
Lukas
c72788894e ci: fix linting and delete non-useful tests 2026-02-24 10:13:24 +01:00
Lukas
f831f68f1a macOS: update AppIcon encoding
- make `ColorizedGhosttyIcon` codable
- remove deprecated string encoding introduced in tip
2026-02-24 09:51:30 +01:00
Andrej Daskalov
9f3f97b231 i18n: Updated mk translations with new strings 2026-02-24 09:50:16 +01:00
Kat
2a9d963631 i18n: Add new translations for nl_NL (#10838)
Addding 3 new translations mentioned in #10632
2026-02-24 08:43:49 +00:00
Mitchell Hashimoto
4b1178e4f6 macos: rename a bunch of files 2026-02-24 08:58:15 +01:00
Mitchell Hashimoto
2c28c27ca5 moving lots of files, removing unused stuff 2026-02-24 08:58:15 +01:00
Lukas
a79557f521 macOS: stop cycling icons when AboutWindow is closed
and start cycling with current icon
2026-02-24 08:58:15 +01:00
Lukas
45525a0a85 macOS: use NSDockTilePlugIn to update app icons 2026-02-24 08:58:14 +01:00
Mitchell Hashimoto
c51f0d745d ci: point xcode to the mounted cache path by Namespace (#10978) 2026-02-23 20:03:59 -08:00
Mitchell Hashimoto
e3a6adeff5 ci: point xcode to the mounted cache path by Namespace 2026-02-23 19:54:51 -08:00
Mitchell Hashimoto
956b427d7a ci: update vouch to 1.4.1 (#10977) 2026-02-23 19:53:16 -08:00
Mitchell Hashimoto
c3a900d1f4 ci: update vouch to 1.4.1 2026-02-23 19:49:30 -08:00
Jeffrey C. Ollie
d3bac33d2b build(deps): bump namespacelabs/nscloud-setup from 0.0.10 to 0.0.11 (#10975)
Bumps
[namespacelabs/nscloud-setup](https://github.com/namespacelabs/nscloud-setup)
from 0.0.10 to 0.0.11.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/namespacelabs/nscloud-setup/releases">namespacelabs/nscloud-setup's
releases</a>.</em></p>
<blockquote>
<h2>v0.0.11</h2>
<h2>What's Changed</h2>
<ul>
<li>Add exponential backoff retry for flaky network operations by <a
href="https://github.com/GabrielBianconi"><code>@​GabrielBianconi</code></a>
in <a
href="https://redirect.github.com/namespacelabs/nscloud-setup/pull/9">namespacelabs/nscloud-setup#9</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/GabrielBianconi"><code>@​GabrielBianconi</code></a>
made their first contribution in <a
href="https://redirect.github.com/namespacelabs/nscloud-setup/pull/9">namespacelabs/nscloud-setup#9</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/namespacelabs/nscloud-setup/compare/v0...v0.0.11">https://github.com/namespacelabs/nscloud-setup/compare/v0...v0.0.11</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="f378676225"><code>f378676</code></a>
Change input from retries to max-attempts to match checkout action</li>
<li><a
href="57f47752a5"><code>57f4775</code></a>
Add additional safety checks for unparsable number or thrown
non-error</li>
<li><a
href="7fca3e5502"><code>7fca3e5</code></a>
Add exponential backoff retry for flaky network operations</li>
<li><a
href="d61c0c48a4"><code>d61c0c4</code></a>
Update README</li>
<li>See full diff in <a
href="d1c625762f...f378676225">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=namespacelabs/nscloud-setup&package-manager=github_actions&previous-version=0.0.10&new-version=0.0.11)](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 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>
2026-02-23 20:55:18 -06:00
dependabot[bot]
123438a4eb build(deps): bump namespacelabs/nscloud-setup from 0.0.10 to 0.0.11
Bumps [namespacelabs/nscloud-setup](https://github.com/namespacelabs/nscloud-setup) from 0.0.10 to 0.0.11.
- [Release notes](https://github.com/namespacelabs/nscloud-setup/releases)
- [Commits](d1c625762f...f378676225)

---
updated-dependencies:
- dependency-name: namespacelabs/nscloud-setup
  dependency-version: 0.0.11
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-24 00:48:13 +00:00
ghostty-vouch[bot]
b2a7f71b58 Update VOUCHED list (#10972)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10801) from
@mitchellh.

Vouch: @curtismoncoq

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-23 22:25:10 +00:00
ghostty-vouch[bot]
375a6313c9 Update VOUCHED list (#10971)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10942) from
@mitchellh.

Vouch: @aalhendi

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-23 22:23:46 +00:00
Mitchell Hashimoto
81f21a04de custom shader: added cursor style and visibility uniforms (#9572)
Fixes: #9416

Specifically:
  iCurrentCursorStyle
  iPreviousCursorStyle
  iCurrentCursorVisible
  iPreviousCursorVisible

Visibility calculated and updated independently from the typical cursor
uniform updates to preserve cursor style even when not in the viewport
or set to be hidden

I used Claude-Code to initially navigate and gauge an understanding of
the rendering system. Otherwise I authored the rest of the PR
2026-02-23 14:17:23 -08:00
ClearAspect
7a4bddd37b renderer: added cursor style and visibility uniforms
Specifically:
iCurrentCursorStyle
iPreviousCursorStyle
iCurrentCursorVisible
iPreviousCursorVisible

Visibility calculated and updated independently from the typical cursor
unifrom updates to preserve cursor style even when not in the viewport
or set to be hidden
2026-02-23 14:11:36 -08:00
Mitchell Hashimoto
ba593d823c feat(macos): Refine MacOS surface drag handle UI (#10280)
<img width="638" height="476" alt="Screenshot 2026-01-11 at 1 41 52 PM"
src="https://github.com/user-attachments/assets/bf3457e8-1b1c-4b2d-b6d1-312d48739108"
/>

This PR makes 3 small changes:

1. Makes the surface move grab handle present when the surface is
hovered and the mouse cursor is not hidden.
2. Makes the grab handle partial width, allowing space to more easily
grab the divider for resize (anywhere but the center) and increasing the
grabbable area for the grab handle.
3. Adds appropriate padding to the top of the surface (in the metal
stack so shaders can apply) to give space for the header so that text is
not occluded by the grab handle.

I think it looks good and works well, but I suggest trying it out since
the interaction is the most important part.

Problems I was trying to solve:
1. The old grab bar overlays actual clickable area on TUIs and can make
them hard to use
2. The old bar makes the entire divider also a grab area, making divider
resizing more difficult.
3. The old bar is not always present, making it hard to discover until
you're going to resize something, which then is confusing
4. The old bar is not colored with the style.


https://github.com/user-attachments/assets/588a35b5-ba2f-4074-8edb-e090e0006224


AI Disclosure: I originally did this with Claude, but at this point I've
gone over this code manually enough to feel somewhat familiar. I think
the video and design speak for themselves and the code change is
minimal, but I'm not a Swift programmer, so I can't evaluate whether
this is the best possible solution.

Human Disclosure: I don't have a linux machine to check that the padding
doesn't apply outside of MacOS. I find it hard to believe that it
wouldn't work, but worth calling out.
2026-02-23 12:25:56 -08:00
Mitchell Hashimoto
03161547f6 Remove the top padding for macOS grab bar 2026-02-23 12:08:24 -08:00
Martin Emde
40e6a6dd58 Refine spacing and header usage
This is 4pt header space, 12pt clickable frame height
2026-02-23 12:04:07 -08:00
Martin Emde
2842b18a3f Only show drag handle on hovered surface 2026-02-23 12:04:07 -08:00
Martin Emde
47577c7623 Make top visual space for surface drag handles 2026-02-23 12:03:45 -08:00
ghostty-vouch[bot]
dcbc765dc0 Update VOUCHED list (#10970)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/10767#issuecomment-3946557197)
from @mitchellh.

Unvouch: @prsweet

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-23 18:32:31 +00:00
Mitchell Hashimoto
7dad801abc ci: enable macOS caching (Zig, Xcode) (#10969)
Namespace now supports cache volumes on macOS. 

This enables caching for Zig and Xcode artifacts. We can't do Nix yet
because we can't create `/nix` and there's a chicken/egg with how Nix
installation works on macOS. I'm emailing Namespace support about it...
But still, a big win for Zig and Xcode!
2026-02-23 10:16:55 -08:00
Mitchell Hashimoto
0830ecfb65 ci: enable macOS caching (Zig, Xcode)
Namespace now supports cache volumes on macOS. 

This enables caching for Zig and Xcode artifacts. We can't do Nix yet because 
we can't create `/nix` and there's a chicken/egg with how Nix installation 
works on macOS. I'm emailing Namespace support about it... But still, a big 
win for Zig and Xcode!
2026-02-23 10:05:11 -08:00
Mitchell Hashimoto
6a9a21afb6 macOS: Add inactive window tint overlay for liquid glass (#10943)
**Summary:**
- Add tint overlay to dim terminal windows when inactive, fixes
https://github.com/ghostty-org/ghostty/discussions/10040
- Refactor the liquid glass effect into a dedicated `TerminalGlassView`
class

Note: The tint overlay color and opacity values may not be ideal —
feedback is welcome.

**AI Disclosure:** I used Claude Code to read the macos repo and
understand the liquid glass implementation. Implemented basic tint
overlay mainly by hand. Refactor the code and review changes with Claude
Code.
2026-02-23 09:01:25 -08:00