Commit Graph

14825 Commits (45d1787effd01bd7f21d1e621e149bfbb2f27130)

Author SHA1 Message Date
Jeffrey C. Ollie 45d1787eff
i18n: rename `.po` files
This seems to be the defacto standard for naming `.po` files. See the
GTK source code [1] as an example. I was unable to find any definitive
documentation on the naming.

Replaces: #10905

[1] https://gitlab.gnome.org/GNOME/gtk/-/tree/main/po?ref_type=heads
2026-02-26 15:10:08 -06:00
trag1c 9d6a8d0fc1
i18n: add missing nb_NO strings (#11036) 2026-02-26 20:40:50 +01:00
Uzair Aftab eb4aa113d7
i18n: add missing nb_NO strings 2026-02-26 20:27:16 +01:00
Mitchell Hashimoto 4b7a55a50e
macOS: Clear badge icon when no surfaces have an active bell (#11035)
Fixes #8487

I did this by setting up a publisher on `BaseTerminalController` for any
bell state change on any surfaces in the tree (including removing
surfaces). By listening to this event at AppDelegate and reinspecting
all our windows, we can reliably set the badge.

**This also includes a change to show the number of terminals with an
active bell!** We can now determine the number, so we show it!
2026-02-26 10:32:26 -08:00
Mitchell Hashimoto dc514c9e11
build: don't build OpenGL support into imgui on iOS 2026-02-26 10:31:21 -08:00
Mitchell Hashimoto dcb7c9a4b8
macos: show the notification count number in the badge 2026-02-26 10:21:35 -08:00
Mitchell Hashimoto 5389fdfbaf
macos: lint 2026-02-26 10:14:22 -08:00
Mitchell Hashimoto 454a89e011
macos: clean up badge request state 2026-02-26 10:10:42 -08:00
Mitchell Hashimoto 3aca722415
macos: further simplication of AppDelegate bell state 2026-02-26 09:52:26 -08:00
Mitchell Hashimoto 79ca4daea6
macos: try to clean up Appdelegate combine mess 2026-02-26 09:47:17 -08:00
Mitchell Hashimoto ea8bf17df8
macos: use combine to coalesce bell values 2026-02-26 09:39:23 -08:00
Mitchell Hashimoto d05fb652ed
macos: update AGENTS.md 2026-02-26 09:10:00 -08:00
Mitchell Hashimoto aa5ef9c64c
macos: update to Sparkle 2.9 (#11034)
Nothing critical, though we may make use of some of the new features
like Markdown and signed feeds in a follow up PR.
2026-02-26 09:01:01 -08:00
Mitchell Hashimoto c60e24d200
macos: update to Sparkle 2.9 2026-02-26 08:49:42 -08:00
Mitchell Hashimoto e3d68e28c9
apprt: show title override in command palette jump commands (#10458)
Relates to https://github.com/ghostty-org/ghostty/discussions/3709

When a surface has a title override set (via `prompt_surface_title`),
the command palette's "Focus:" jump commands now display the override
instead of the terminal title.

**No title override:**
<img width="515" height="265" alt="Screenshot 2026-01-26 at 6 11 56 PM"
src="https://github.com/user-attachments/assets/55f49878-87fd-498d-be4e-098ea42b7aaf"
/>

**With title override**
<img width="519" height="270" alt="Screenshot 2026-01-26 at 6 11 30 PM"
src="https://github.com/user-attachments/assets/e2a293ef-0c29-4fab-94ff-b6b357193321"
/>

**AI DISCLAIMER**

I leveraged Claude Code to understand the codebase, make a plan and
write the first draft of the code. I reviewed and edited the code
written by claude and manually tested the change on iOS.
2026-02-26 07:28:08 -08:00
Mitchell Hashimoto 9fe3cc125d
apprt/gtk: use new get effective title 2026-02-26 07:19:26 -08:00
Noah Bernsohn c4766dff77 fix: restore terminalTitle variable removed in previous edit 2026-02-26 07:18:06 -08:00
Noah Bernsohn 62c1d50757 Update macos/Sources/Features/Command Palette/TerminalCommandPalette.swift
Co-authored-by: Lukas <134181853+bo2themax@users.noreply.github.com>
2026-02-26 07:18:06 -08:00
Noah Bernsohn f38234bc5b apprt: show title override in command palette jump commands 2026-02-26 07:18:05 -08:00
Mitchell Hashimoto e6da439e43
macos: style changes 2026-02-26 07:09:08 -08:00
Mitchell Hashimoto 87428bd1eb
macos: fix glass tinting when theme changes (#11030)
This is a minimal and temporary workaround for #11017
2026-02-26 07:06:34 -08:00
Mitchell Hashimoto 6ebc796c4c
Fix Palette.C array size typo: [265] → [256] (#11027)
The C struct Palette.C declared colors as [265]Color.C, but the terminal
palette is 256 colors (terminal.color.Palette = [256]RGB) and the C
header ghostty_config_palette_s correctly uses colors[256].

The mismatch causes ghostty_config_get to write 265×3 = 795 bytes
through a pointer sized for 256×3 = 768 bytes, producing a 27-byte
buffer overflow. On macOS Release builds with stack protector enabled,
this triggers __stack_chk_fail → SIGABRT on launch.

Discovered this while working on https://github.com/markhuot/watchtower.
Builds were succeeding but the app was crashing on launch because we use
the new C bindings to get the foreground/background colors to set window
theming like "selection" color.
2026-02-26 06:59:34 -08:00
ghostty-vouch[bot] 3dcc8e6235
Update VOUCHED list (#11032)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11031#discussioncomment-15935875)
from @mitchellh.

Vouch: @mihi314

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-26 14:58:30 +00:00
Mitchell Hashimoto de4ee288f5
pkg/dcimgui: only add the OpenGL3 shutdown helper if backend enabled 2026-02-26 06:56:17 -08:00
Lukas 05a125533b
macos: fix glass tinting when theme changes 2026-02-26 11:24:54 +01:00
ghostty-vouch[bot] 74ba971eba
Update VOUCHED list (#11028)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11027#issuecomment-3963449775)
from @jcollie.

Vouch: @markhuot

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-26 01:58:22 +00:00
markhuot 20351a71d0 Fix Palette.C array size typo: [265] → [256]
The C struct Palette.C declared colors as [265]Color.C, but the
terminal palette is 256 colors (terminal.color.Palette = [256]RGB)
and the C header ghostty_config_palette_s correctly uses colors[256].

The mismatch causes ghostty_config_get to write 265×3 = 795 bytes
through a pointer sized for 256×3 = 768 bytes, producing a 27-byte
buffer overflow. On macOS Release builds with stack protector enabled,
this triggers __stack_chk_fail → SIGABRT on launch.
2026-02-25 20:17:13 -05:00
Mitchell Hashimoto eb531caa31
apprt/gtk: fix SIGSEGV on ImGui GLArea re-realize (#11025)
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 16:03:42 -08:00
Mitchell Hashimoto 610e1f5f47
macos: add Weak to iOS build 2026-02-25 16:03:14 -08:00
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