Compare commits

...

1487 Commits
v1.1.2 ... main

Author SHA1 Message Date
Qwerasd
776d25b065 Even More Sprite Glyphs (#7761)
Follow-on to #7755, adds the sixteenth blocks from the Symbols for
Legacy Computing Supplement and a few circle/ellipse glyphs that connect
to existing glyphs.

In order to add the one sixteenth blocks I reworked block element
alignment to not use the `yHalfs`, `yThirds`, etc. functions, but
instead a more versatile `Fraction` type I introduced, and making these
changes slightly affected how the vertical/horizontal eighths glyphs are
sized, and the horizontal center-point alignment of the smooth mosaic
glyphs for odd cell widths (shifted by half a pixel), but I believe both
of these to be improvements.

### Circle/ellipse glyphs
```
Existing sprites:
🯠 🯡 🯢 🯣

Which connect like so:
🯢🯡🯣
🯠

New sprites:
𜸀 𜸁 𜸋 𜸌

Which connect like so:
🯡𜸀𜸀🯣 🯢 𜸋𜸌
    𜸁
    𜸁
    🯠
```
|Main (via font)|This PR (via sprites)|
|-|-|
|![image](https://github.com/user-attachments/assets/b0102f7e-1cb3-4842-a8c6-352df6d5264f)|![image](https://github.com/user-attachments/assets/9a35d444-39ff-41e1-a632-597f195090a8)|

### Diffs
|Range|||||
|-|-|-|-|-|
|U+1CE00...U+1CEFF|![sprite_face_diff-U+1CE00 U+1CEFF-9x17+1](https://github.com/user-attachments/assets/632daca9-9d1e-458b-b645-3841de9f4915)|![sprite_face_diff-U+1CE00 U+1CEFF-11x21+2](https://github.com/user-attachments/assets/47731d99-9e1a-4005-a56c-dc9af3c38160)|![sprite_face_diff-U+1CE00 U+1CEFF-12x24+3](https://github.com/user-attachments/assets/2a4fd0d7-4114-480d-91e8-f8182ef0ff2b)|![sprite_face_diff-U+1CE00 U+1CEFF-18x36+4](https://github.com/user-attachments/assets/17b886b8-ad6d-4503-85dd-10ea2f734c09)|
|U+1FB00...U+1FBFF|![sprite_face_diff-U+1FB00 U+1FBFF-9x17+1](https://github.com/user-attachments/assets/c24814ea-67ef-4030-819b-a3f3d6ddac0c)|![sprite_face_diff-U+1FB00 U+1FBFF-11x21+2](https://github.com/user-attachments/assets/354ebadf-5d9c-4681-86c8-f6c21f82932e)|![sprite_face_diff-U+1FB00 U+1FBFF-12x24+3](https://github.com/user-attachments/assets/9fbb2c21-9ccd-466c-9bde-b8ce63e5df8b)|![sprite_face_diff-U+1FB00 U+1FBFF-18x36+4](https://github.com/user-attachments/assets/f76866ab-21c4-43b8-a591-009c4399ce17)|
2025-07-01 17:42:51 -06:00
Mitchell Hashimoto
d88adb131c linux: add install target to systemd user service (#7757)
This will allow users to enable Ghostty startup on login. Users will
need to explicitly enable startup on login via this command:

```sh
systemctl enable --user com.mitchellh.ghostty.service
```
2025-07-01 16:03:58 -07:00
Mitchell Hashimoto
d9d884b6e2 reload configuration on SIGUSR2 (#7759)
This is done at the apprt-level for a couple reasons.

  (1) For libghostty, we don't have a way to know what the embedding
      application is doing, so its risky to create signal handlers that
      might overwrite the application's signal handlers.

  (2) It's extremely messy to deal with signals and multi-threading.
      Apprts have framework access that handles this for us.

For GTK, we use g_unix_signal_add.

For macOS, we use `DispatchSource.makeSignalSource`. This is an awkward
API but made for this purpose.
2025-07-01 16:03:48 -07:00
Qwerasd
cff6860fd9 font/sprite: update reference images 2025-07-01 17:03:10 -06:00
Qwerasd
0cd95a791f font/sprite: add sflc supplement circle/ellipse glyphs 2025-07-01 16:52:17 -06:00
Mitchell Hashimoto
2fa4fc8902 reload configuration on SIGUSR2
This is done at the apprt-level for a couple reasons.

  (1) For libghostty, we don't have a way to know what the embedding
      application is doing, so its risky to create signal handlers that
      might overwrite the application's signal handlers.

  (2) It's extremely messy to deal with signals and multi-threading.
      Apprts have framework access that handles this for us.

For GTK, we use g_unix_signal_add.

For macOS, we use `DispatchSource.makeSignalSource`. This is an awkward
API but made for this purpose.
2025-07-01 15:51:58 -07:00
Qwerasd
ffe06f1ccd font/sprite: add sixteenth blocks from slfc supplement 2025-07-01 16:26:57 -06:00
Qwerasd
c838d3d7d2 font/sprite: remove yHalfs and friends, use Fraction
Introduces `fill`, which fills between two `Fraction`s, use this instead
of `yHalfs` and friends wherever they're used, which also means we can
remove `rect`.

This commit does change alignment of the vertical/horizontal eighths in
certain cell sizes, but the change is for the better IMO. Also changes
the center-point alignment of smooth mosaics for odd cell widths, but
the change is no more than half a pixel at worst and is probably an
improvement ultimately.
2025-07-01 16:00:45 -06:00
Jeffrey C. Ollie
190c744a6f linux: add install target to systemd user service
This will allow users to enable Ghostty startup on login. Users will
need to explicitly enable startup on login via this command:

```sh
systemctl enable --user com.mitchellh.ghostty.service
```
2025-07-01 16:51:23 -05:00
Qwerasd
ac87154362 font/sprite: introduce Fraction enum for cell fractions
I've included a compatibility test here to make sure that the numbers
from this are in line with the numbers produced by xHalfs, yThirds, etc.

After this commit I'll introduce a helper function that fills based on a
span specified with this enum to replace any uses of xHalfs and friends.

Once I do that I'll remove them and the compatibility test, this should
be a much cleaner interface for this and make it easier to consistently
align block elements with each other.
2025-07-01 15:04:21 -06:00
Qwerasd
5c4a30d85f More Sprite Glyphs (#7755)
Follow-up to #7732, but even more to come, these were just some low
hanging fruit which it would be nice to merge early.

Adds these characters from the Symbols for Legacy Computing Supplement
block:
```
𜰛 𜰜 𜰝 𜰞

𜰰𜰱𜰲𜰳
𜰴  𜰷 𜰵𜰶 𜸖𜸘
𜰸  𜰻 𜰹𜰺 𜸗𜸙
𜰼𜰽𜰾𜰿
```
How this looks in Ghostty:
|Main (via font)|This PR (via sprites)|
|-|-|
|<img width="256" alt="image"
src="https://github.com/user-attachments/assets/f6000984-7e4a-4ec0-b282-9d0905bd54ed"
/>|<img width="256" alt="image"
src="https://github.com/user-attachments/assets/0d880458-3025-4e42-b2ba-cf84f540d503"
/>|

This PR also adjusts the way block quadrants are drawn for better
alignment with other block elements, this matches how we handle sextants
already.

### Diffs
|Range|||||
|-|-|-|-|-|
|U+1CC00...U+1CCFF|![sprite_face_diff-U+1CC00
U+1CCFF-9x17+1](https://github.com/user-attachments/assets/1adfded7-bd08-414b-8965-dfc07c5c31f8)|![sprite_face_diff-U+1CC00
U+1CCFF-11x21+2](https://github.com/user-attachments/assets/836cd64e-5013-47c8-b819-ac391f630579)|![sprite_face_diff-U+1CC00
U+1CCFF-12x24+3](https://github.com/user-attachments/assets/91483e65-6fc8-401c-b5ed-e5a97d7dd5ac)|![sprite_face_diff-U+1CC00
U+1CCFF-18x36+4](https://github.com/user-attachments/assets/02d7b2fe-bbf5-4431-a3b7-d7ab3ab94714)|
|U+1CE00..U+1CEFF|![sprite_face_diff-U+1CE00
U+1CEFF-9x17+1](https://github.com/user-attachments/assets/aa690cda-a8f3-4307-9f90-bb6ad9c9e7d2)|![sprite_face_diff-U+1CE00
U+1CEFF-11x21+2](https://github.com/user-attachments/assets/e96fd3db-9ed4-40e2-9770-86b9921717b0)|![sprite_face_diff-U+1CE00
U+1CEFF-12x24+3](https://github.com/user-attachments/assets/799859eb-0ff6-4f0e-8f69-6c0c5e1e1c04)|![sprite_face_diff-U+1CE00
U+1CEFF-18x36+4](https://github.com/user-attachments/assets/5049ca8b-2502-470d-853f-f600cd9d235c)|
|U+2500...U+25FF|![sprite_face_diff-U+2500
U+25FF-9x17+1](https://github.com/user-attachments/assets/37467f96-eaaa-4951-8d56-87ad614fc44e)|![sprite_face_diff-U+2500
U+25FF-11x21+2](https://github.com/user-attachments/assets/776e25e8-b257-4ec2-9f0a-98cb3e08aaa2)|||
2025-07-01 14:04:01 -06:00
Qwerasd
adace942d0 font/sprite: update reference images 2025-07-01 13:20:10 -06:00
Qwerasd
b4d83e6349 font/sprite: align quadrants better with other glyphs
Use `xHalfs` and `yHalfs` so that the dimensions of each quadrant are
appropriately aligned with block elements like the one half block, which
could be 1px taller than the bottom quadrants before this change.

This is in line with what we do for sextants, the fact that on odd-sized
cells there's a 1px overlap is considered acceptable there so I assume
it's acceptable here too.
2025-07-01 13:15:54 -06:00
Qwerasd
0414e9e281 font/sprite: add (some) sflc supplement box drawing chars 2025-07-01 13:15:54 -06:00
Qwerasd
dd9ca556f9 font/sprite: add sflc supplement circle pieces 2025-07-01 13:15:54 -06:00
Mitchell Hashimoto
a4005946e1 Fix abnormal exit detection on macOS (#7752)
I made an oopsie with #7705 and omitted the check entirely on macOS when
the original logic only omitted the exit code check.
2025-07-01 12:15:53 -07:00
Mitchell Hashimoto
fbdaea7456 Update src/Surface.zig
Co-authored-by: Gregory Anders <greg@gpanders.com>
2025-07-01 12:15:45 -07:00
Mitchell Hashimoto
114c3f5665 Fix abnormal exit detection on macOS
I made an oopsie with #7705 and omitted the check entirely on macOS when
the original logic only omitted the exit code check.
2025-07-01 12:06:50 -07:00
Qwerasd
eea7088919 Sprite Face Rework (#7732)
- Large rework of how we draw sprite font glyphs, explained in the
commit message and comments.
- Adds separated block sextants from symbols for legacy computing
supplement
- Adds explicit underline cursor instead of using underline glyph for
it, resolves #7651, supersedes #7685

Currently we support these glyphs with the sprite font:
```
─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳╴╵╶╷╸╹╺╻╼╽╾╿▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟◢◣◤◥◸◹◺◿⠀⠁⠂⠃⠄⠅⠆⠇⠈⠉⠊⠋⠌⠍⠎⠏⠐⠑⠒⠓⠔⠕⠖⠗⠘⠙⠚⠛⠜⠝⠞⠟⠠⠡⠢⠣⠤⠥⠦⠧⠨⠩⠪⠫⠬⠭⠮⠯⠰⠱⠲⠳⠴⠵⠶⠷⠸⠹⠺⠻⠼⠽⠾⠿⡀⡁⡂⡃⡄⡅⡆⡇⡈⡉⡊⡋⡌⡍⡎⡏⡐⡑⡒⡓⡔⡕⡖⡗⡘⡙⡚⡛⡜⡝⡞⡟⡠⡡⡢⡣⡤⡥⡦⡧⡨⡩⡪⡫⡬⡭⡮⡯⡰⡱⡲⡳⡴⡵⡶⡷⡸⡹⡺⡻⡼⡽⡾⡿⢀⢁⢂⢃⢄⢅⢆⢇⢈⢉⢊⢋⢌⢍⢎⢏⢐⢑⢒⢓⢔⢕⢖⢗⢘⢙⢚⢛⢜⢝⢞⢟⢠⢡⢢⢣⢤⢥⢦⢧⢨⢩⢪⢫⢬⢭⢮⢯⢰⢱⢲⢳⢴⢵⢶⢷⢸⢹⢺⢻⢼⢽⢾⢿⣀⣁⣂⣃⣄⣅⣆⣇⣈⣉⣊⣋⣌⣍⣎⣏⣐⣑⣒⣓⣔⣕⣖⣗⣘⣙⣚⣛⣜⣝⣞⣟⣠⣡⣢⣣⣤⣥⣦⣧⣨⣩⣪⣫⣬⣭⣮⣯⣰⣱⣲⣳⣴⣵⣶⣷⣸⣹⣺⣻⣼⣽⣾⣿𜰡𜰢𜰣𜰤𜰥𜰦𜰧𜰨𜰩𜰪𜰫𜰬𜰭𜰮𜰯𜴀𜴁𜴂𜴃𜴄𜴅𜴆𜴇𜴈𜴉𜴊𜴋𜴌𜴍𜴎𜴏𜴐𜴑𜴒𜴓𜴔𜴕𜴖𜴗𜴘𜴙𜴚𜴛𜴜𜴝𜴞𜴟𜴠𜴡𜴢𜴣𜴤𜴥𜴦𜴧𜴨𜴩𜴪𜴫𜴬𜴭𜴮𜴯𜴰𜴱𜴲𜴳𜴴𜴵𜴶𜴷𜴸𜴹𜴺𜴻𜴼𜴽𜴾𜴿𜵀𜵁𜵂𜵃𜵄𜵅𜵆𜵇𜵈𜵉𜵊𜵋𜵌𜵍𜵎𜵏𜵐𜵑𜵒𜵓𜵔𜵕𜵖𜵗𜵘𜵙𜵚𜵛𜵜𜵝𜵞𜵟𜵠𜵡𜵢𜵣𜵤𜵥𜵦𜵧𜵨𜵩𜵪𜵫𜵬𜵭𜵮𜵯𜵰𜵱𜵲𜵳𜵴𜵵𜵶𜵷𜵸𜵹𜵺𜵻𜵼𜵽𜵾𜵿𜶀𜶁𜶂𜶃𜶄𜶅𜶆𜶇𜶈𜶉𜶊𜶋𜶌𜶍𜶎𜶏𜶐𜶑𜶒𜶓𜶔𜶕𜶖𜶗𜶘𜶙𜶚𜶛𜶜𜶝𜶞𜶟𜶠𜶡𜶢𜶣𜶤𜶥𜶦𜶧𜶨𜶩𜶪𜶫𜶬𜶭𜶮𜶯𜶰𜶱𜶲𜶳𜶴𜶵𜶶𜶷𜶸𜶹𜶺𜶻𜶼𜶽𜶾𜶿𜷀𜷁𜷂𜷃𜷄𜷅𜷆𜷇𜷈𜷉𜷊𜷋𜷌𜷍𜷎𜷏𜷐𜷑𜷒𜷓𜷔𜷕𜷖𜷗𜷘𜷙𜷚𜷛𜷜𜷝𜷞𜷟𜷠𜷡𜷢𜷣𜷤𜷥𜹑𜹒𜹓𜹔𜹕𜹖𜹗𜹘𜹙𜹚𜹛𜹜𜹝𜹞𜹟𜹠𜹡𜹢𜹣𜹤𜹥𜹦𜹧𜹨𜹩𜹪𜹫𜹬𜹭𜹮𜹯𜹰𜹱𜹲𜹳𜹴𜹵𜹶𜹷𜹸𜹹𜹺𜹻𜹼𜹽𜹾𜹿𜺀𜺁𜺂𜺃𜺄𜺅𜺆𜺇𜺈𜺉𜺊𜺋𜺌𜺍𜺎𜺏🬀🬁🬂🬃🬄🬅🬆🬇🬈🬉🬊🬋🬌🬍🬎🬏🬐🬑🬒🬓🬔🬕🬖🬗🬘🬙🬚🬛🬜🬝🬞🬟🬠🬡🬢🬣🬤🬥🬦🬧🬨🬩🬪🬫🬬🬭🬮🬯🬰🬱🬲🬳🬴🬵🬶🬷🬸🬹🬺🬻🬼🬽🬾🬿🭀🭁🭂🭃🭄🭅🭆🭇🭈🭉🭊🭋🭌🭍🭎🭏🭐🭑🭒🭓🭔🭕🭖🭗🭘🭙🭚🭛🭜🭝🭞🭟🭠🭡🭢🭣🭤🭥🭦🭧🭨🭩🭪🭫🭬🭭🭮🭯🭰🭱🭲🭳🭴🭵🭶🭷🭸🭹🭺🭻🭼🭽🭾🭿🮀🮁🮂🮃🮄🮅🮆🮇🮈🮉🮊🮋🮌🮍🮎🮏🮐🮑🮒🮓🮔🮕🮖🮗🮘🮙🮚🮛🮜🮝🮞🮟🮠🮡🮢🮣🮤🮥🮦🮧🮨🮩🮪🮫🮬🮭🮮🮯🮽🮾🮿🯎🯏🯐🯑🯒🯓🯔🯕🯖🯗🯘🯙🯚🯛🯜🯝🯞🯟🯠🯡🯢🯣🯤🯥🯦🯧🯨🯩🯪🯫🯬🯭🯮🯯
```
Screenshot:
<img width="1121" alt="image"
src="https://github.com/user-attachments/assets/d0979bf0-f585-415b-bbc7-b7b399adce25"
/>

I plan on doing a follow-up PR with a lot of new supported glyphs now
that it's so much easier to add them.
2025-07-01 13:05:20 -06:00
trag1c
7cb7cdf88d i18n: add Korean translations (#6963)
This pull request adds Korean translations.

I do want to add that while I do speak Korean _I am not a native
speaker_. I've done my best to provide translations as natural as
possible, but I'd love it if a native speaker could improve it before
merging.
2025-07-01 09:57:47 +02:00
trag1c
f773baa418 remove blank line in CODEOWNERS 2025-07-01 09:36:07 +02:00
Qwerasd
95fbeb5b82 style(font/sprite): annotate type for value 2025-06-30 16:44:21 -06:00
Qwerasd
a00a727e77 test(font/Atlas): add test case for setFromLarger 2025-06-30 16:37:26 -06:00
RME
8c5122876f Fixed po/ko_KR.UTF-8.po
Co-authored-by: Hojin You <dev.hojin@gmail.com>
2025-06-30 22:11:49 +02:00
Mitchell Hashimoto
3cf181a670 macos: don't overwrite the .fullScreen styleMask option in reapplyHiddenStyle (#7738)
Fixes #7625 (which apparently didn't catch anyone's attention, but I'd
be very surprised if no one were able to reproduce it if they tried;
also, re discord chat)
2025-06-30 11:31:04 -07:00
Daniel Wennberg
886e33d7b7 make hiddenStyleMask static 2025-06-30 11:21:55 -07:00
Daniel Wennberg
b1f788a768 macos: don't overwrite the .fullScreen styleMask option in reapplyHiddenStyle 2025-06-30 10:36:48 -07:00
Qwerasd
05eeaddb04 update flatpak hash 2025-06-30 11:21:50 -06:00
Qwerasd
8b6e1fe5b1 font/sprite: update reference PNGs to match new z2d export 2025-06-30 11:16:47 -06:00
Qwerasd
61b7dffcaa deps: update z2d
We need to use this version of z2d so that we can get reproducible PNG
exports in CI for testing, since previously the PNG export was affected
by the CPU arch / features because it depended on vector width.
2025-06-30 11:16:47 -06:00
Qwerasd
2084d5f256 font/sprite+renderer: never constrain sprite glyphs
This was creating problems with the branch drawing glyphs at some sizes.

In the future the whole "foreground modes" thing needs to be reworked,
so this is just a stopgap until that gets turned in to something nicer.
2025-06-30 11:16:47 -06:00
Qwerasd
e691404a57 prettier format 2025-06-30 11:16:47 -06:00
Qwerasd
4f9d7c565a font/sprite: add explicit underline cursor
Resolves #7651 - uses cursor thickness rather than underline thickness.
2025-06-30 11:16:47 -06:00
Qwerasd
c96af1b3b1 font/sprite: add separated sextants from sflc supplement 2025-06-30 11:16:47 -06:00
Qwerasd
1377e6d225 font/sprite: rework sprite font drawing
This is a fairly large rework of how we handle the sprite font drawing.
Drawing routines are now context-less, provided only a canvas and some
metrics. There is now a separate file per unicode block / PUA area.
Sprites are now drawn on canvases with an extra quarter-cell of padding
on each edge, and automatically cropped when sent to the atlas, this
allows sprites to extend past cell boundaries which makes it possible to
have, for example, diagonal box drawing characters that connect across
cell diagonals instead of being pinched in.

Most of the sprites the code is just directly ported from the old code,
but I've rewritten a handful. Moving forward, I'd like to rewrite more
of these since the way they're currently written isn't ideal.

This rework, in addition to improving the packing efficiency of sprites
on the atlas, and allowing for out-of-cell drawing, will make it a lot
easier to add new sprites in the future, since all it takes now is to
add a single function and an import (if it's a new file).

I reworked the regression/change testing to be more robust as well, it
now covers all sprite glyphs (except non-codepoint ones) and does so at
4 different sizes. Addition/removal of glyphs will no longer create diff
noise in the generated diff image, since the position in the image of
each glyph is now fixed.
2025-06-30 11:16:47 -06:00
Mitchell Hashimoto
66f73f7133 surface: add timer-based scrolling during selection (#4422)
Adds a timer to continuously scroll during selection when outside the
viewport, 15ms per line.

Currently the scrolling behavior requires you to jiggle the mouse to
continuously scroll upwards/downwards when selecting text.


### Before


https://github.com/user-attachments/assets/18e6c547-ed04-4098-88b4-35360f8c8c3c

### After


https://github.com/user-attachments/assets/46d5a6fc-b38e-46cf-b00f-52c8bc289f52
2025-06-30 09:42:45 -07:00
Mitchell Hashimoto
81cef6e63b various cleanups around scroll timers 2025-06-30 09:40:49 -07:00
moni-dz
f73c90bf5d surface: add timer-based scrolling during selection 2025-06-30 09:17:20 -07:00
moni-dz
c00b8740aa termio: add selection scrolling callback 2025-06-30 09:15:53 -07:00
Mitchell Hashimoto
ffcd633c01 Introduce font-shaping-break config option (#5374)
Adds the config option as described in #4515.

Plumbed it into the `RunIterator` and updated all the tests that rely on
that, adding additional cases to the cursor boundary tests where I found
them.

Closes #4515
2025-06-30 09:12:14 -07:00
Mitchell Hashimoto
73ff4b8f74 move runIterator options to dedicated struct 2025-06-30 09:05:09 -07:00
Daniel Patterson
beb961fb80 Introduce font-shaping-break config option 2025-06-30 08:06:00 -07:00
RME
9aa2383e05 Merge branch 'main' into ko_kr 2025-06-30 15:05:01 +02:00
RME
6484df9134 update debug build string, line 251 2025-06-30 15:01:44 +02:00
RME
e25029eff6 add ko_KR i18n to CODEOWNERS 2025-06-30 15:00:15 +02:00
Mitchell Hashimoto
2592286988 termio: indicate support for OSC 52 in primary DA report (#7725)
This is an extension agreed upon by modern terminals to indicate that
they support copying to the clipboard with XTerm's OSC 52 sequence. It
is only reported when writing to the clipboard is actually allowed.

Ref: #7590
2025-06-29 19:18:53 -07:00
Mitchell Hashimoto
747076abbf terminal: introduce testWriteSemanticString (#7733)
This test-only function wraps testWriteString with semantic prompt
marking. This replaces the manual, row-based semantic_prompt field
manipulation we were doing in all of our prompt-related test setups.

This function's heuristics are a little complex because it wraps
testWriteString as a "black box"; we don't benefit from that function's
own line-based logic to know which rows need to be updated with the
semantic prompt flag. We need to infer them externally instead.

I considered adding an options argument to testWriteString that would
allow passing e.g. a semantic_prompt prompt. Given that it's called from
200+ places, that would involve a lot of unrelated changes, but it
remains an "option" (ha!) if there's value there for other cases.

I also have plans that move us from row-based to cell-based semantic
tracking, where the current semantic type is tracked by the cursor. In
that implementation, testWriteString can update the written cells
directly, and testWriteSemanticString just helps manage the cursor's
state. Introducing testWriteSemanticString here and now therefore helps
bridge us to that world while maintaining test consistency.
2025-06-29 19:16:53 -07:00
Mitchell Hashimoto
20c6a6fcf2 update libxev to workaround the io_uring regression in Linux 6.15.4 (#7731)
Fixes #7724

Background at the end of the commit message. The fix in libxev is
described in the PR and commit we pin to here, but basically we swap
read for poll for eventfd/timerfd. libxev commit:
75a10d0fb3

From Jens Axboe on X:

> This will fix it: https://pastebin.com/n7JSZWpW which makes me
suspicious
> that it's an S_IFREG check somewhere else, as anon inodes are now
listed as
> regular files. Has potentially pretty broad implications...

> I think I can already answer why that breaks things - io_uring checks
if
> this is a regular file, and if it is, it doesn't do short reads. Short
> reads on regular files (or a bdev) will cause application issues, as
> basically nobody expects them.

> Now we have what acts like a char dev, but where io_uring will retry
IO
> because the application asked for more data than what was delivered.
This
> will cause the weird slowdowns as data isn't delivered as soon as it's
> available.

## Backporting to 1.1.3

It's a bit risky, but we can back port the libxev update to 1.1.3 (and
release a 1.1.4) since we don't plan on a 1.2 release for a couple
months. Realistically, we've been running the latest libxev on tip
(before this commit) for awhile and there haven't been issues so I think
it's safe enough.

I think we should let this merge settle for a few days at least before
we do that back port though.
2025-06-29 19:03:58 -07:00
Kat
098038cf70 i18n: Add Irish (ga_IE) translation (#7650)
This PR introduces support for Irish (Gaeilge), the first official
language of Ireland and an EU working language.

The translation file was initialized using the standard gettext tooling:

` msginit -i po/com.mitchellh.ghostty.pot -l $LANG -o "po/$LANG.po"`

The locale code `ga_IE` follows ISO standards for Gaeilge as spoken in
Ireland.

I'm happy to volunteer as the ongoing maintainer of the Irish
translation and will keep it up to date as Ghostty evolves.

Go raibh maith agat!
2025-06-30 01:56:54 +00:00
Jon Parise
a82223259a terminal: introduce testWriteSemanticString
This test-only function wraps testWriteString with semantic prompt
marking. This replaces the manual, row-based semantic_prompt field
manipulation we were doing in all of our prompt-related test setups.

This function's heuristics are a little complex because it wraps
testWriteString as a "black box"; we don't benefit from that function's
own line-based logic to know which rows need to be updated with the
semantic prompt flag. We need to infer them externally instead.

I considered adding an options argument to testWriteString that would
allow passing e.g. a semantic_prompt prompt. Given that it's called from
200+ places, that would involve a lot of unrelated changes, but it
remains an "option" (ha!) if there's value there for other cases.

I also have plans that move us from row-based to cell-based semantic
tracking, where the current semantic type is tracked by the cursor. In
that implementation, testWriteString can update the written cells
directly, and testWriteSemanticString just helps manage the cursor's
state. Introducing testWriteSemanticString here and now therefore helps
bridge us to that world while maintaining test consistency.
2025-06-29 19:51:35 -04:00
Mitchell Hashimoto
d0e12cc082 update libxev to workaround the io_uring regression in Linux 6.15.4
Fixes #7724

Background at the end of the commit message. The fix in libxev is
described in the PR and commit we pin to here, but basically we swap
read for poll for eventfd/timerfd.

From Jens Axboe on X:

> This will fix it: https://pastebin.com/n7JSZWpW which makes me suspicious
> that it's an S_IFREG check somewhere else, as anon inodes are now listed as
> regular files. Has potentially pretty broad implications...

> I think I can already answer why that breaks things - io_uring checks if
> this is a regular file, and if it is, it doesn't do short reads. Short
> reads on regular files (or a bdev) will cause application issues, as
> basically nobody expects them.

> Now we have what acts like a char dev, but where io_uring will retry IO
> because the application asked for more data than what was delivered. This
> will cause the weird slowdowns as data isn't delivered as soon as it's
> available.
2025-06-29 15:11:24 -07:00
Aindriú Mac Giolla Eoin
5da461dc35 Corrected 2 strings for better readability and consistency 2025-06-29 21:20:20 +01:00
trag1c
7106a3d716 Add Argentinian Spanish translation and locale support (#7397) 2025-06-29 21:23:31 +02:00
Alan Moyano
046f21f2dc Adding email address 2025-06-29 16:02:23 -03:00
Alan Moyano
ff599b5cf7 Improving Argentinian voseo 2025-06-29 16:02:23 -03:00
Alan Moyano
14ba7effcd Fixing issues and making the translation more similar to the es_BO version 2025-06-29 16:02:23 -03:00
Alan Moyano
43a3338491 Merge branch 'ghostty-org:main' into main 2025-06-29 15:59:29 -03:00
James Holderness
7f0778bcf2 termio: indicate support for OSC 52 in primary DA report
This is an extension agreed upon by modern terminals to indicate that
they support copying to the clipboard with XTerm's OSC 52 sequence. It
is only reported when writing to the clipboard is actually allowed.
2025-06-29 15:32:17 +01:00
Mitchell Hashimoto
0d55a1deef Introduce action for copying into clipboard (#7721)
This introduces an action for copying the path of a written
screen/selection file into the clipboard.

Pasting the path into the terminal doesn't work well if you have a
program still running and opening the file outside the terminal (on
macOS in TextEdit by default) isn't always a great experience.

Allowing to copy the file path into the clipboard seems like a minor and
hopefully uncontroversial addition. 😅
2025-06-29 06:56:21 -07:00
RME
ad5ab92333 Update po/ko_KR.UTF-8.po
Co-authored-by: Hojin You <dev.hojin@gmail.com>
2025-06-29 15:42:18 +02:00
Troels Thomsen
ef06e3d02c Introduce action for copying into clipboard 2025-06-29 09:32:48 +02:00
Mitchell Hashimoto
cc2c45ff4e Update iTerm2 colorschemes (#7718)
Upstream revision:
6fa671fdc1
2025-06-28 19:27:54 -07:00
Mitchell Hashimoto
67fe3d418a config: fix regression where we halted parsing on deprecated field (#7719)
Fix regression from d44a6cde2c7ed59f0f28fad16e6b760d7529ebee where we
halted parsing on deprecated fields, which was not the intended
behavior.

This commit fixes that and adds a test to verify it.
2025-06-28 19:27:43 -07:00
Mitchell Hashimoto
5ab7ceb589 config: fix regression where we halted parsing on deprecated field
Fix regression from d44a6cde2c7ed59f0f28fad16e6b760d7529ebee where
we halted parsing on deprecated fields, which was not the intended
behavior.

This commit fixes that and adds a test to verify it.
2025-06-28 19:24:07 -07:00
mitchellh
2f978fbdcf deps: Update iTerm2 color schemes 2025-06-29 00:15:18 +00:00
Mitchell Hashimoto
2637400904 gtk: add "remember choice" toggle for clipboard confirmation dialog (#6783)
Implements #6763 (not backporting to the 1.2 version since I'm way too
lazy)


![image](https://github.com/user-attachments/assets/9c9aca3e-8b42-4d47-8a96-841612add812)
2025-06-28 14:55:31 -07:00
Mitchell Hashimoto
d44a6cde2c config: more general purpose backwards compatibility handlers (#7717)
Fixes #7706

We previously had a very specific backwards compatibility handler for
handling renamed fields. We always knew that wouldn't scale but I wanted
to wait for a real case. Well, #7706 is a real case, so here we are.

This commit makes our backwards compatibility handler more general
purpose, and makes a special-case handler for renamed fields built on
top of this same general purpose system. The new system lets us do a lot
more with regards to backwards compatibility.

To start, this addresses #7706 by allowing us to handle a removed single
enum value of a still-existing field.

In the future, I think this may continue to get _more_ general purpose
by moving the handlers from functions to structs so we can have more
metadata like descriptions and so on that we may use to generate docs or
other help strings.
2025-06-28 14:48:02 -07:00
RME
a219aae7fc Merge branch 'main' into ko_kr 2025-06-28 23:23:11 +02:00
Mitchell Hashimoto
84432a7beb config: more general purpose backwards compatibility handlers
Fixes #7706

We previously had a very specific backwards compatibility handler for
handling renamed fields. We always knew that wouldn't scale but I wanted
to wait for a real case. Well, #7706 is a real case, so here we are.

This commit makes our backwards compatibility handler more general
purpose, and makes a special-case handler for renamed fields built on
top of this same general purpose system. The new system lets us do a lot
more with regards to backwards compatibility.

To start, this addresses #7706 by allowing us to handle a removed single
enum value of a still-existing field.
2025-06-28 13:06:43 -07:00
Jon Parise
5e76606120 fix: enable boo on FreeBSD (#7716) 2025-06-28 14:55:28 -04:00
-k
4fac5f3749 fix: enable boo on FreeBSD 2025-06-28 13:08:56 -04:00
Leah Amelia Chen
f6d1c274b9 gtk(wayland): prevent gtk4-layer-shell crash on old versions (#7712)
Supersedes #7154

In gtk4-layer-shell versions < 1.0.4, the app could crash upon opening a
quick terminal window on certain compositors that implement the
`xdg_wm_dialog_v1` protocol. The exact reason is a bit complicated, but
is nicely summarized in the upstream issue (wmww/gtk4-layer-shell#50).

The circumstances that could cause this crash to occur should gradually
diminish as distros update to newer gtk4-layer-shell versions, but this
is known to crash on Fedora 41 and Hyprland, which could be a sizable
chunk of our userbase given that this would also occur on GNOME/Mutter
and KDE/KWin. The diff should be minimal enough that this can be removed
or reverted once this band-aid fix is no longer necessary.
2025-06-28 17:09:24 +02:00
Leah Amelia Chen
0973abf9f9 translations(zh_CN): add lines from #6783 2025-06-28 17:08:29 +02:00
Leah Amelia Chen
fbe94156f9 translations: update 2025-06-28 17:06:49 +02:00
Leah Amelia Chen
ce015899f3 gtk: add "remember choice" toggle for clipboard confirmation dialog 2025-06-28 17:06:40 +02:00
Leah Amelia Chen
5fa737834b gtk(wayland): prevent gtk4-layer-shell crash on old versions
Supersedes #7154

In gtk4-layer-shell versions < 1.0.4, the app could crash upon opening
a quick terminal window on certain compositors that implement the
`xdg_wm_dialog_v1` protocol. The exact reason is a bit complicated,
but is nicely summarized in the upstream issue (wmww/gtk4-layer-shell#50).

The circumstances that could cause this crash to occur should gradually
diminish as distros update to newer gtk4-layer-shell versions, but this
is known to crash on Fedora 41 and Hyprland, which could be a sizable
chunk of our userbase given that this would also occur on GNOME/Mutter
and KDE/KWin. The diff should be minimal enough that this can be removed
or reverted once this band-aid fix is no longer necessary.
2025-06-28 16:41:19 +02:00
Mitchell Hashimoto
1607f761d2 Equalize splits based on children oriented in the same direction (#7710)
This changes equalization so it only counts children oriented in the
same direction.

This makes splits a bit more aesthetic, and replicates how split
equalization works in neovim.

### This is how splits look before this change:

Notice how the left pane gets squeezed.

Before equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 47 40 AM"
src="https://github.com/user-attachments/assets/498d3026-cfde-4856-b88b-677b2e77b4a0"
/>

After equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 47 49 AM"
src="https://github.com/user-attachments/assets/2cf7bb60-62da-4d42-882c-d8324cc7bdb6"
/>



---

### And here's how the equalization works after this change:

Before equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 18 AM"
src="https://github.com/user-attachments/assets/39974948-573c-48e8-93a2-7504968f1418"
/>

After equalization
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 24 AM"
src="https://github.com/user-attachments/assets/d97adccd-976e-45a5-b98e-6e5596cf89d3"
/>


For many splits it looks much more aesthetic:
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 28 AM"
src="https://github.com/user-attachments/assets/012d84fc-400f-4864-b8d4-cf7ce53067fb"
/>
<img width="1440" alt="Screenshot 2025-06-28 at 8 48 35 AM"
src="https://github.com/user-attachments/assets/204583ad-66e6-4a1d-a3a0-d2805a8daded"
/>
2025-06-28 07:26:49 -07:00
Mitchell Hashimoto
5364c2d723 Don't pass arena allocator to internal_os.open (#7711)
This fixes #7702 by no longer passing the arena allocator to a task that
outlives its caller.

As far as I can tell, a reference to `config_path` may live on in the
`argv` field of the ChildProcess after the arena is cleared (unless
`argv` itself becomes a dangling pointer because the literal it's
referencing goes out of scope? Struggling to wrap my head around some of
the finer points of Zig array/slice/literal semantics). However, I
suppose it's safe to assume that `argv` is never referenced after
`exe.spawn()` has returned, in which case there's no issue. If this were
a problem, it would apply equally to all uses of `internal_os.open`, not
just the open config code path.
2025-06-28 06:57:50 -07:00
Mitchell Hashimoto
3dc4321689 deps: Default gtk4-layer-shell system integration to true (#6706)
Closes #6632 
When compiling the dynamic lib and linking, the rpath resolves to the
compile cache location instead of the install location for the lib. This
resulted in loading the dylib failing when the compile cache was removed
or the install location is changed.

Based on https://github.com/ziglang/zig/issues/5827 , we specify the
rpath to search relative to the executable.
Previous state:
- dynamic lib was not installed to the output directory -> now appears
in `$OUT/lib/libgtk4-layer-shell.so`
- rpath only included the compile cache location, not the install
location.
Before:
```sh
$ patchelf --print-rpath zig-out/bin/ghostty
/home/anthony/dev/ghostty-pure/.zig-cache/o/0254fb4753185c5429180337a720248d
$ ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => /home/anthony/dev/ghostty-pure/.zig-cache/o/0254fb4753185c5429180337a720248d/libgtk4-layer-shell.so (0x00007f7975468000)
        ...
$  ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => not found
        ...
```

After:

```sh
$ zig build
$ patchelf --print-rpath zig-out/bin/ghostty
/home/anthony/dev/ghostty/.zig-cache/o/f45360ddde653cb3bc70966c326dd96d:$ORIGIN/../lib/
$ ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => /home/anthony/dev/ghostty/.zig-cache/o/f45360ddde653cb3bc70966c326dd96d/libgtk4-layer-shell.so (0x00007fbf81ad8000)
        ...
 $ rm -r .zig-cache/
 $ ldd zig-out/bin/ghostty
        ...
        libgtk4-layer-shell.so => /home/anthony/dev/ghostty/zig-out/bin/../lib/libgtk4-layer-shell.so (0x00007f60dc087000)
        ...
```
2025-06-28 06:56:50 -07:00
azhn
a8cad9831a Remove copying libgtk4-layer-shell.so from cache since install is fixed 2025-06-28 19:21:32 +10:00
azhn
46b86570f2 deps: Enable building gtk4-layer-shell without system integration 2025-06-28 19:02:30 +10:00
azhn
33e07c87c9 deps: Default gtk4-layer-shell system integration to true
We default system-integration to true as this is a shared library that
must be installed on a library path and it is recommended to use the
system package.

If the system does not package gtk4-layer-shell then doing `zig build
-fno-sys` will now correctly build and install the shared library under
a lib/ subdirectory of the output prefix.

The output prefix should be a default library path (`/lib`, `/usr/lib`,
or a lib64 variant) otherwise a custom library path can be configured
using ldconfig (see `man ld.so 8`)
2025-06-28 19:01:26 +10:00
Daniel Wennberg
4ae75cc868 Don't pass arena allocator to os.open 2025-06-28 00:21:38 -07:00
Islam Sharabash
22a624e560 Equalize splits based on children oriented in the same direction
This changes equalization so it only counts children oriented in the
same direction.

This makes splits a bit more aesthetic, and replicates how split
equalization works in neovim.
2025-06-28 09:01:41 +02:00
Mitchell Hashimoto
206d41844e terminal: fix unexpected line wrapping in tests (#7709)
These tests write specific lines into a 10-column-wide test screen. The
"prompt3$ input3\n" writes exceed that column limit, and some of their
characters wrap onto the following line.

These tests' current assertions aren't sensitive to that overflow, but I
spotted the problem while doing some related work, and I thought it
worth making these corrections to avoid any future surprises.
2025-06-27 19:43:12 -07:00
Jon Parise
138f74524e terminal: fix unexpected line wrapping in tests
These tests write specific lines into a 10-column-wide test screen. The
"prompt3$ input3\n" writes exceed that column limit, and some of their
characters wrap onto the following line.

These tests' current assertions aren't sensitive to that overflow, but
I spotted the problem while doing some related work, and I thought it
worth making these corrections to avoid any future surprises.
2025-06-27 22:34:46 -04:00
Mitchell Hashimoto
98b1af8353 Move child exit handling logic to apprt thread (#7705)
Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
2025-06-27 10:51:55 -07:00
Mitchell Hashimoto
591ef0f40f Move child exit handling logic to apprt thread
Fixes #7500
Supersedes #7582

This commit moves the child exit handling logic from the IO thead to the
apprt thread. The IO thread now only sends a `child_exited` message to
the apprt thread with metadata about the exit conditions (exit code,
runtime).

From there, the apprt thread can handle the exit situation however is
necessary. This commit doesn't change the behavior but it does fix the
issue #7500. The behavior is: exit immediately, show abnormal exit
message, wait for user input, etc.

This also gets us closer to #7649.
2025-06-27 10:36:23 -07:00
Mitchell Hashimoto
2775792b20 core: only update selection clipboard on left mouse release (#7704)
Fixes #4800, supercedes #5995

This is a rewrite of #5995 (though the solution is mostly the same since
this is pretty straightforward). The main difference is the rebase on
the new mouse handling we've had since, and I also continue to update
the selection clipboard on non-left-mouse events.
2025-06-27 09:45:52 -07:00
Mitchell Hashimoto
52354b8bec core: only update selection clipboard on left mouse release
Fixes #4800, supercedes #5995

This is a rewrite of #5995 (though the solution is mostly the same since
this is pretty straightforward). The main difference is the rebase on
the new mouse handling we've had since, and I also continue to update
the selection clipboard on non-left-mouse events.
2025-06-27 09:40:37 -07:00
Mitchell Hashimoto
4b5ccf79a5 fix compilation issue, tests should've caught this but GHA failed 2025-06-27 09:16:00 -07:00
Mitchell Hashimoto
240c9b8afc gtk: add option to always display the tab bar (#5590)
Also fixes crashes in both vanilla GTK and Adwaita implementations of
`closeTab`, which erroneously close windows twice when there are no more
tabs left (we probably already handle it somewhere else).
2025-06-27 09:14:13 -07:00
Mitchell Hashimoto
331769bc6b core: don't copy App and apprt.App (#5509)
Besides avoiding copying, this allows consumers to choose to allocate
these structs on the stack or to allocate on the heap. It also gives the
apprt.App a stable pointer sooner in the process.
2025-06-27 09:13:54 -07:00
Mitchell Hashimoto
83690744b2 reintroduce App.create 2025-06-27 09:12:20 -07:00
Jeffrey C. Ollie
1979fb92f4 embedded: fix core app init 2025-06-27 09:05:32 -07:00
Jeffrey C. Ollie
3c49d87751 fix order of defer 2025-06-27 09:05:32 -07:00
Jeffrey C. Ollie
c6f23bbb32 core: con't copy App and apprt.App
Besides avoiding copying, this allows consumers to choose to allocate
these structs on the stack or to allocate on the heap. It also gives the
apprt.App a stable pointer sooner in the process.
2025-06-27 09:05:32 -07:00
Mitchell Hashimoto
070e017b1b Update CODEOWNERS for localization managers (#7701) 2025-06-27 06:59:37 -07:00
Mitchell Hashimoto
937b10b422 Update CODEOWNERS for localization managers 2025-06-27 06:58:15 -07:00
Qwerasd
979d72056b OpenGL: Fix Custom Shaders (#7697)
Ref: GitHub Discussion #7696 

See commit messages for details.
2025-06-26 17:19:19 -06:00
Qwerasd
d6db3013be renderer/OpenGL: switch image texture from Rect to 2D
We were using the Rectangle target for simpler addressing, since that
allows for pixel coordinates instead of normalized coordinates, but
there are downsides to rectangle textures, including not supporting
compressed texture formats, and we do probably want to use compressed
formats in the future, so I'm making this change now.
2025-06-26 16:38:19 -06:00
Qwerasd
810ab6a844 renderer/OpenGL: revert change to compressed texture format
This was applied to the wrong thing by accident, making the custom
shader ping-pong textures compressed, which breaks custom shaders
because compressed texture formats are not color renderable.

Additionally, I've not switched the compressed format to the correct
texture options, because I tried that and it turns out that the default
compression applied by drivers can't be trusted to be good quality and
generally speaking looks terrible. In the future we can explore doing
the compression ourselves CPU-side with something like b7enc_rdo.
2025-06-26 16:34:51 -06:00
Mitchell Hashimoto
6d6dcf863a Correct AppStream metainfo XML, broken trailing tags 2025-06-26 13:37:20 -07:00
Mitchell Hashimoto
c12b280782 dbus and systemd activation - take 2 (#7679)
This replaces #7433. The improvements are:

1) Install the systemd user service in the proper directory depending on
if it's a 'user' install or a 'system' install. This is controlled
either by using the `--system` build flag (as most packages will) or by
the `-Dsystem-package` flag.

2) Add the absolute path to the `ghostty` binary in the application
file, the DBus service, and the systemd user service. This is done so
that they do not depend on `ghostty` being in the `PATH` of whatever is
launching Ghostty. That `PATH` is not necessarily the same as the `PATH`
in a user shell (especially for DBus activation and systemd user
services).

3) Adjust the DBus bus name that is expected by the system depending on
the optimization level that Ghostty is compiled with.
2025-06-26 13:31:29 -07:00
Mitchell Hashimoto
d92d1cac2a remove unused TODO.md 2025-06-26 13:16:55 -07:00
Mitchell Hashimoto
3d01bb43cc terminal/Screen: account for rectangle selection in clone (#7692)
Fixes an issue where rectangle selections would appear visually wrong if
their start or end were out of the viewport area, because when cloning
them the restored pins were defaulting to the start and end of the row
instead of the appropriate column.

This issue is shown in discussion #7687.
2025-06-26 13:15:48 -07:00
Mitchell Hashimoto
b4e81949ee wrong service name for dbus systemd service 2025-06-26 13:12:05 -07:00
Mitchell Hashimoto
77654eb01c use tail to clear the first line of the template 2025-06-26 13:07:41 -07:00
Mitchell Hashimoto
739b691a6d use cmake formatting to template, avoids the custom binary 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
73d5eb928c fix up formatting of desktop_template.zig 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
8a95212197 fix up the name in the metainfo when templating 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
fa4f420768 replace sed with a simple Zig program for templating desktop files 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
eb5a488b57 clean up duplicated code in installation of desktop services 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
9c95ce28ae drop system-package option 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
cf561fcc55 rename templated files with .in suffix 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
b68f9f2321 make sure that the desktop file uses the absolute path everywhere 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
ddada2fb3f flatpak: remove references to systemd unit
Replaces #7676

When building as a flatpak, don't install the systemd user services
since flatpaks can't use them. Remove references to the systemd service
from the DBus service.

Also, customize the app metadata depending on the debug mode.

Co-authored-by: Leorize <leorize+oss@disroot.org>
2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
81403f59ce dbus and systemd activation - take 2
This replaces #7433. The improvements are:

1) Install the systemd user service in the proper directory depending
on if it's a 'user' install or a 'system' install. This is controlled
either by using the `--system` build flag (as most packages will) or by
the `-Dsystem-package` flag.

2) Add the absolute path to the `ghostty` binary in the application
file, the DBus service, and the systemd user service. This is done so
that they do not depend on `ghostty` being in the `PATH` of whatever
is launching Ghostty. That `PATH` is not necessarily the same as the
`PATH` in a user shell (especially for DBus activation and systemd user
services).

3) Adjust the DBus bus name that is expected by the system depending on
the optimization level that Ghostty is compiled with.
2025-06-26 10:28:46 -07:00
Qwerasd
f7ee6b3bda terminal/Screen: clean up selection remap in clone
Cleans up the logic, checks for out of bounds using rows instead of
sel.contains because that excludes cases where a rectangle selection
doesn't include the leftmost column.

Also adds test for clipping behavior of rectangular selections.
2025-06-26 11:26:03 -06:00
Qwerasd
360124ded0 terminal/Screen: account for rectangle selection in clone
Fixes an issue where rectangle selections would appear visually wrong if
their start or end were out of the viewport area, because when cloning
them the restored pins were defaulting to the start and end of the row
instead of the appropriate column.
2025-06-25 23:16:43 -06:00
Mitchell Hashimoto
fa47db5363 config: add command-palette-entry config option (#7688)
Implements #7158 for GTK
2025-06-25 16:48:10 -04:00
Mitchell Hashimoto
9eec80e038 Terminal Background Image Support (#7686)
Adds support for background images via the `background-image` config.

Resolves #3645, supersedes PRs #4226 and #5233.

See docs of added config keys for usage details.

> [!NOTE]
> Unlike what is implied by the original issue, because this is
implemented in the renderer it is inherently per-surface not per-window,
meaning a window with a split will have two copies of the background
image.

### Future work
- We should probably introduce code in the apprts that tells surfaces
their position and size relative to the window, which would allow us to
add a `background-image-area` config with options for `surface` and
`window` to control that behavior (and probably default it to `window`).
That apprt code would also allow for window-relative custom shader
locations, which is also a fairly common user request, so I think it's
worth it.
- Currently if you use a high res background image this is fairly
inefficient, since each surface independently loads a copy of the
background image. On systems with limited VRAM this could be an issue
for users who use a lot of surfaces, so it may be worth making a shared
image cache to avoid this problem.
- ~~It's probably worth using compressed texture formats for images,
I'll look in to doing that.~~ (c43702c)
2025-06-25 16:45:40 -04:00
Mitchell Hashimoto
a8091fedf3 fix tests 2025-06-25 16:28:31 -04:00
Mitchell Hashimoto
6c2ea8637e config: add more docs for background-image 2025-06-25 16:27:23 -04:00
Qwerasd
5cb175ff63 renderer/OpenGL: use compressed texture formats for images
BPTC is required to be available OpenGL >= 4.2 and our minimum is 4.3 so
this is safe in terms of support. I tested briefly in a VM and didn't
encounter any problems so this should just be a complete win.

(Note: texture data is already automatically compressed on Metal)
2025-06-25 16:27:23 -04:00
Qwerasd
da46a47726 renderer: add support for background images
Adds support for background images via the `background-image` config.

Resolves #3645, supersedes PRs #4226 and #5233.

See docs of added config keys for usage details.
2025-06-25 16:27:23 -04:00
Qwerasd
03bdb92292 renderer: clean up image.zig, reduce repetitive code 2025-06-25 16:27:23 -04:00
Qwerasd
ca5f301eb1 util: introduce helper for detecting file types 2025-06-25 16:27:23 -04:00
Leah Amelia Chen
dbe6035da0 config: add command-palette-entry config option 2025-06-25 16:18:20 -04:00
Leah Amelia Chen
d419e5c922 gtk(command_palette): filter out more unimplemented actions 2025-06-25 16:18:20 -04:00
Leah Amelia Chen
832f27596c gtk(command_palette): grab focus correctly 2025-06-25 16:18:20 -04:00
Mitchell Hashimoto
a5f1413a1c config: make split/tab navigation keybinds performable (#7683)
Fixes #7680
2025-06-25 16:06:15 -04:00
Leah Amelia Chen
9a5aed51a3 config: make split/tab navigation keybinds performable
Fixes #7680
2025-06-25 15:20:24 +02:00
Mitchell Hashimoto
74a03ebd6e Revert "linux: add dbus and systemd activation services (#7433)" (#7678)
Reverts two commits:

977cd530c7bb9551de93900170bdaec4601b1b5b
820b7e432b57cd08c49d2e76cce4cb78016f0418

These break build from source on Linux for two reasons:

1.) The systemd user service needs to be installed in the `share`
prefix, not the `lib` prefix. This lets it get picked up in `~/.local`
but is also correct for just standard FHS paths.

2.) The `ghostty` path in the systemd user service needs to be absolute.
We should interpolate in the build install prefix to form an absolute
path.
2025-06-24 22:12:02 -04:00
Mitchell Hashimoto
f941a2185e Revert "linux: add dbus and systemd activation services (#7433)"
Reverts two commits:

977cd530c7bb9551de93900170bdaec4601b1b5b
820b7e432b57cd08c49d2e76cce4cb78016f0418

These break build from source on Linux for two reasons:

1.) The systemd user service needs to be installed in the `share`
prefix, not the `lib` prefix. This lets it get picked up in `~/.local`
but is also correct for just standard FHS paths.

2.) The `ghostty` path in the systemd user service needs to be absolute.
We should interpolate in the build install prefix to form an absolute
path.
2025-06-24 22:07:09 -04:00
Mitchell Hashimoto
00aad86625 font: faster glyph hashing (#7677)
There are two main improvements being made here. First, we move away
from using autohash and instead use a one-shot strategy similar to the
Style hashing. Since the GlyphKey includes the Metrics struct, which
contains quite a few fields, autohash was performing expensive and
unnecessary repeated updates.

The second improvement is actually just, not hashing Metrics. By
ignoring the Metrics field, we can fit the rest of the GlyphKey into a
64-bit packed struct and just return that as the hash! It ends up being
unique for each GlyphKey in renderGlyph, and is nearly a zero-cost
operation.

This ends up boosting the performance (on my machine at least), from
around 560fps to 590fps on the DOOM-fire benchmark.
2025-06-24 19:12:30 -04:00
Mitchell Hashimoto
820b7e432b flatpak: remove references to systemd unit (#7676)
Flatpak currently does not export systemd user units. As such, remove
references to it from D-Bus services to prevent D-Bus daemon from trying
to start a non-existent service.

Additionally, make sure that the D-Bus service name is correct for debug
builds.

Follow up to #7433
2025-06-24 19:06:07 -04:00
David Rubin
93dcb1954d faster glyph hashing
There are two main improvements being made here. First, we move away from using autohash and instead
use a one-shot strategy similar to the Style hashing. Since the GlyphKey includes the Metrics struct,
which contains quite a few fields, autohash was performing expensive and unnecessary repeated updates.

The second improvement is actually just, not hashing Metrics. By ignoring the Metrics field, we can
fit the rest of the GlyphKey into a 64-bit packed struct and just return that as the hash! It
ends up being unique for each GlyphKey in renderGlyph, and is nearly a zero-cost operation.

This ends up boosting the performance (on my machine at least), from around 560fps to 590fps on the
DOOM-fire benchmark.
2025-06-24 15:47:54 -07:00
Leorize
32e61d2a23 flatpak: remove references to systemd unit
Flatpak currently does not export systemd user units. As such, remove
references to it from D-Bus services to prevent D-Bus daemon from trying
to start a non-existent service.

Additionally, make sure that the D-Bus service name is correct for debug
builds.
2025-06-24 17:34:41 -05:00
Mitchell Hashimoto
977cd530c7 linux: add dbus and systemd activation services (#7433) 2025-06-24 18:14:24 -04:00
Mitchell Hashimoto
4c3db76733 fix: always wait on open command to avoid defunct processes (#7657)
Without waiting on the xdg-open process on linux/freebsd, we end up with
a defunct (zombie) process after each time we open a URL.

For example, after click on two URLs in a ghostty, here is the output of
`ps ux | grep xdg-open`:

```
pbui      8364  0.0  0.0      0     0 tty7     Z+   05:03   0:00 [xdg-open] <defunct>
pbui      8453  0.0  0.0      0     0 tty7     Z+   05:03   0:00 [xdg-open] <defunct>
```

Perhaps we should revisit 695bc30, which removed the wait in the first
place. On my machine running Alpine Linux 3.22, `xdg-open` does not stay
alive and finishes immediately, thus making it safe to call wait (and
not block). This is also the case on my other machine running Ubuntu
24.04: `xdg-open` launches the URL in a browser and terminates
immediately.

Either way, this process must be waited upon eventually. Otherwise, we
will accumulate a collection of defunct processes until the terminal
itself terminates.
2025-06-24 08:08:31 -04:00
Mitchell Hashimoto
5f6cdb0c4e core, gtk: implement host resources dir for Flatpak (#6661)
Introduces host resources directory as a new concept: A directory
containing application resources that can only be accessed from the host
operating system. This is significant for sandboxed application runtimes
like Flatpak where shells spawned on the host should have access to
application resources to enable integrations.

Alongside this, apprt is now allowed to override the resources lookup
logic.
2025-06-24 07:54:37 -04:00
Peter Bui
3d89fadc85 fix: always wait on open command to avoid defunct processes
To avoid blocking on waiting for the child process, perform the wait in
a detached thread.
2025-06-24 07:50:53 -04:00
Aindriú Mac Giolla Eoin
c12bccc9c5 Replaced 6 strings with táb rather than cluaisín 2025-06-24 12:45:21 +01:00
Mitchell Hashimoto
0b5092bf3a pwd: fix hostname resolution on macos (#7029)
## Description

Yet another edge case in #2484 

When macOS's "Private WiFi address" feature is enabled it'll change the
hostname to a mac address. Mac addresses look like URIs with a hostname
and port component, e.g. `12:34:56:78:90:12` where `:12` looks like port
`12`. However, mac addresses use hex numbers and as such can also
contain letters `a` through `f`. So, a mac address like
`ab💿ef🆎cd:ef` is valid, but will not be parsed as a URI, because
`:ef` is not a valid port.

This commit attempts to fix that by checking if the hostname is a valid
mac address when `std.Uri.parse()` fails and constructing a new
`std.Uri` struct using that information.

It's not perfect, but is equally compliant with the URI spec as
`std.Uri` currently is. Meaning not at all compliant 😅

## Testing instructions

### Unit tests

> [!IMPORTANT]
> I don't know if these tests are run in CI or if they're picked up by
`zig build test`. I get an unrelated crash that mentions `minidump` and
an invalid OSC command when I try to run `zig build test` on my mac.

1. Make sure `zig test src/os/hostname.zig` is passing.

### Manual testing instructions

#### Setup - Enable the "Private WiFi address" setting

> [!IMPORTANT]
> You must be connected to WiFi to be able to test this.

1. Open your mac's "System Settings".
2. Go to Network &rarr; Wi-Fi &rarr; Details.

<img width="710" alt="image"
src="https://github.com/user-attachments/assets/fe30cfe7-8e77-4421-8b36-2f7aab0918dd"
/>

3. Set the "Private Wi-Fi address" setting to `Rotating`.

<img width="710" alt="image"
src="https://github.com/user-attachments/assets/bd695c20-106c-46bd-8862-cbdce55fed6f"
/>

> [!IMPORTANT]
> Now you wait. The private Wi-Fi address will eventually rotate to a
mac address that ends with a non-digit, e.g. `0a`, `ff`, `e2`, etc.
You'll notice this when your shell integration stops working, e.g. you
open a new tab in Ghostty and the shell is in your home directory
instead of whichever directory you had open in your previous tab.

#### Testing the changes

1. Open Ghostty.
3. `cd` to any directory that isn't the default (usually `$HOME`)
directory, e.g. `cd Documents`.
4. Open a new tab (<kbd>Cmd+T</kbd>) or split (<kbd>Cmd+D</kbd>).
5. Assuming the setup steps have been followed you should:
    * On `main`:  land in `$HOME` in the new tab or split.
* On this branch: land in the same working directory as the original tab
or split.
2025-06-24 07:40:14 -04:00
Leorize
faf9d59160 core, apprt: make runtimes implement resourcesDir directly 2025-06-24 07:36:09 -04:00
Leorize
1688f2576c core, gtk: implement host resources dir for Flatpak
Introduces host resources directory as a new concept: A directory
containing application resources that can only be accessed from the host
operating system. This is significant for sandboxed application runtimes
like Flatpak where shells spawned on the host should have access to
application resources to enable integrations.

Alongside this, apprt is now allowed to override the resources lookup
logic.
2025-06-24 07:35:28 -04:00
Mitchell Hashimoto
82859bd844 cli: +edit-config command to open the config file in $EDITOR (#7668)
This adds a new CLI `ghostty +edit-config`. This will open the config
file in the user's specified `$EDITOR`. If Ghostty has never been
configured, this will also create the initial config file with some
default templated contents (the same as that which we introduced back in
Ghostty 1.0.1 or something -- not new behavior here).

This is useful on its own because it will find the correct configuration
path to open. If users are terminal users anyway (not a big stretch
since this is a terminal app), this will allow them to easily edit
config right away.

This is also forward looking: I want to replace our "Open Config" action
to open a Ghostty window executing this command so that users can edit
their config in a terminal editor. This has been heavily requested since
forever (short of a full GUI settings editor, which is not ready yet). I
don't do this in this PR but plan to in a future PR.

Even further forward looking: when we have an API, we can have
`edit-config` auto-reload the config on exit. This isn't possible today
but this is where we'd put that.
2025-06-24 07:30:50 -04:00
Mitchell Hashimoto
865ba546a9 cli: +edit-config command to open the config file in $EDITOR
This adds a new CLI `ghostty +edit-config`. This will open the config
file in the user's specified `$EDITOR`. If Ghostty has never been
configured, this will also create the initial config file with some
default templated contents (the same as that which we introduced back in
Ghostty 1.0.1 or something -- not new behavior here).

This is useful on its own because it will find the correct configuration
path to open. If users are terminal users anyway (not a big stretch
since this is a terminal app), this will allow them to easily edit
config right away.

This is also forward looking: I want to replace our "Open Config" action
to open a Ghostty window executing this command so that users can edit
their config in a terminal editor. This has been heavily requested since
forever (short of a full GUI settings editor, which is not ready yet). I
don't do this in this PR but plan to in a future PR.
2025-06-24 07:17:05 -04:00
Aindriú Mac Giolla Eoin
b8bc37fb95 Changed Pailéad ordú to Pailéad ordaithe 2025-06-24 09:22:33 +01:00
Qwerasd
f0db524924 Miscellaneous Renderer Cleanup (#7671)
This PR is a collection of small improvements, cleanup, and fixes to the
renderer, as a follow-up to #7620.

### Summary of changes
- The nearly identical-between-backends `cell.zig` and `image.zig` are
now both unified.
- Shader pipeline preparation is now even DRYer in preparation for
future changes that will involve adding new pipelines, where I don't
want to be slowed down by having to add them in multiple places to get
things working. There is now a single source of truth at the top of
`shaders.zig` for what core pipelines are available and how they're
configured.
- Global background color drawn in a separate step before individual
cell background colors, this is required to be able to draw kitty images
between these layers. Can't use the clear color for this because that
would require color space conversions on the CPU-side which we don't yet
have utilities for.
- Fixed a bug with the kitty image z-index logic where not having
foreground images made the background images act as foreground images.
- Moved the custom shader uniform buffer to the frame state so we don't
create a new one every frame like we were before.
- Fixed color glyphs under OpenGL being channel-swapped because the
texture format was RGBA when the data was BGRA (#7670).
2025-06-23 21:07:11 -06:00
Qwerasd
1fb5e8691a naming: ArrayListPool -> ArrayListCollection
Also remove unnecessary and confusing default value for the lists.
2025-06-23 20:47:19 -06:00
Qwerasd
c465317e4e font/atlas: fix testing code that used old enum name
Forgot to change these instances when I renamed rgb(a) to bgr(a), which
was breaking test builds. Also went ahead and fixed some code that was
assuming rgba was actually rgba order and added a note to another part.
2025-06-23 18:01:34 -06:00
Qwerasd
41ae32814f renderer: fix color glyph rendering under OpenGL
Also changes color atlas to always use an sRGB internal format so that
the texture reads automatically linearize the colors.

Renames the misleading `rgba` atlas format to `bgra`, since both
FreeType and CoreText are set up to draw color glyphs in bgra.
2025-06-23 18:01:34 -06:00
Qwerasd
f5439c860a renderer: extract kitty image upload in drawFrame to fn
For cleanliness -- also updated some comments while I was at it.
2025-06-23 18:01:34 -06:00
Qwerasd
706a43138e renderer: keep post uniform buffer in frame state
This avoids creating a new buffer for this every frame.
2025-06-23 18:01:34 -06:00
Qwerasd
1da40ccbac fix(renderer): kitty image z-index accounting
The previous logic would consider all images fg if the only present
placements were bg, or consider mg images fg if there were no fg.
2025-06-23 18:01:34 -06:00
Qwerasd
4c3ab14571 renderer: make shader pipeline prep code DRYer
In this format it will be a lot easier to iterate on this since adding
and removing pipelines only has to be done in a single place.

This commit also separates out the main background color from individual
cell background color drawing, because sometimes kitty images need to be
between the main background and individual cell backgrounds (kitty image
z-index seems to be entirely broken at the moment, I intend to fix it in
future commits).
2025-06-23 18:01:34 -06:00
Qwerasd
df8dc33ab6 renderer: unify image.zig
The code in metal/image.zig and opengl/image.zig was virtually identical
save for the texture options, so I've moved that to the GraphicsAPI and
unified them in to renderer/image.zig
2025-06-23 13:12:17 -06:00
Qwerasd
7eb3e813dd datastruct: move ArrayListPool from renderer/cell.zig 2025-06-23 13:06:41 -06:00
Qwerasd
4b01cc1d88 renderer: unify cell.zig
The code in metal/cell.zig and opengl/cell.zig was virtually identical
aside from the types for the cell data, moved it to renderer/cell.zig
2025-06-23 12:21:30 -06:00
Mitchell Hashimoto
373fc6bcbf docs: document uniforms available to custom shaders (#7653) 2025-06-23 04:47:28 -07:00
Aindriú Mac Giolla Eoin
72fb87b20e Updated Irish to sentence case, updated struct, added ga_IE to supported locales 2025-06-23 09:27:22 +01:00
Mitchell Hashimoto
3e79c4b7ea macOS: Run scripts using stdin rather than executing directly (#7654)
Fixes #7647

See #7647 for context. This commit works by extending the `input` work
introduced in #7652 to libghostty so that the macOS can take advantage
of it. At that point, it's just the macOS utilizing `input` in order to
set the command and `exit` up similar to Terminal and iTerm2.

This applies both to files opened directly by Ghostty as well as the App
Intent to run a command in a new terminal.
2025-06-22 18:15:32 -07:00
Mitchell Hashimoto
471098df30 macOS: Run scripts using stdin rather than executing directly
Fixes #7647

See #7647 for context. This commit works by extending the `input` work
introduced in #7652 to libghostty so that the macOS can take advantage
of it. At that point, its just the macOS utilizing `input` in order to
set the command and `exit` up similar to Terminal and iTerm2.
2025-06-22 21:06:32 -04:00
Mitchell Hashimoto
0721955dde input configuration to pass input as stdin on startup (#7652)
This adds a new configuration `input` that allows passing either raw
text or file contents as stdin when starting the terminal.

The input is sent byte-for-byte to the terminal, so control characters
such as `\n` will be interpreted by the shell and can be used to run
programs in the context of the loaded shell. After the input is sent, it
switches to `stdin` as usual.

Example: `ghostty --input="hello, world\n"` will start the your default
shell, run `echo hello, world`, and then show the prompt

The `--input` configuration can be repeated to send multiple data
concatenated directly to together. Values can be also be prefixed with
`file:` to send a file contents, e.g. `file:data.txt`. File contents are
limited to 10MB to prevent excessive memory usage and avoid malicious
use. Beyond that, users should write their own script...

This is all in pursuit of #7647, but we're not there yet.
2025-06-22 16:20:39 -07:00
Qwerasd
7ca9cd1994 docs: document uniforms available to custom shaders 2025-06-22 17:07:26 -06:00
Mitchell Hashimoto
1947afade9 input configuration to pass input as stdin on startup
This adds a new configuration `input` that allows passing either raw
text or file contents as stdin when starting the terminal.

The input is sent byte-for-byte to the terminal, so control characters
such as `\n` will be interpreted by the shell and can be used to run
programs in the context of the loaded shell.

Example: `ghostty --input="hello, world\n"` will start the your default
shell, run `echo hello, world`, and then show the prompt.
2025-06-22 18:18:16 -04:00
Aindriú Mac Giolla Eoin
84b1984f08 Added Irish translation 2025-06-22 19:45:02 +01:00
Qwerasd
8573d53fe6 Custom Shader Cursor Uniforms (#7648)
Supersedes #6912, implements #6901

Also included in this PR is a fix/cleanup of the custom shader uniform
handling, moved the CPU-side custom shader uniforms struct to the main
renderer struct instead of having it be per-frame, moved the layout
struct to `shadertoy.zig` since it has the `std140` layout for both
backends.

Also, I added the current/previous cursor colors to the uniforms, since
I figured they'd be useful to have and it's a trivial addition.

### Future Work
- This extension to the shadertoy uniforms needs to be documented
somewhere so it's discoverable by users.
- The flipped Y axis on Metal still needs to be fully addressed instead
of just being patched over like it is right now.
2025-06-22 12:04:12 -06:00
Qwerasd
d0ff2452d5 renderer: add cursor color to custom shader uniforms 2025-06-22 11:05:16 -06:00
Qwerasd
bb576d1340 renderer: add custom shader cursor uniforms
Based on / supersedes PR #6912, implements discussion #6901

Co-authored-by: Krone Corylus <ahustinkrone@gmail.com>
2025-06-22 11:05:16 -06:00
Mitchell Hashimoto
f07816f188 macOS: Fix window-decoration=none regression on Tahoe (#7644)
This regression may have existed on Sequoia too, but I only saw it on
Tahoe.

The issue is that we should not be setting up titlebar accessory views
when there is no titlebar. This was triggering an AppKit assertion.

To further simplify things, I always use the basic window styling if
window decorations are off, too.
2025-06-22 08:19:47 -07:00
Mitchell Hashimoto
02e05a85fc macOS: Fix window-decoration=none regression on Tahoe
This regression may have existed on Sequoia too, but I only saw it on
Tahoe.

The issue is that we should not be setting up titlebar accessory views
when there is no titlebar. This was triggering an AppKit assertion.

To further simplify things, I always use the basic window styling if
window decorations are off, too.
2025-06-22 07:28:30 -07:00
Mitchell Hashimoto
f4a2772045 build: simulator should use iphoneos metal, its the -m flags important 2025-06-22 07:11:12 -07:00
Qwerasd
c7a7474be0 renderer: move custom shader uniforms out of frame state
These should not be independent per-frame, that makes the time
calculations all sorts of jank.

Also moves the uniforms struct layout in to `shadertoy.zig` and cleans
up the handling in general somewhat.
2025-06-21 23:07:18 -06:00
Qwerasd
5bfdb1b9cf The Big Renderer Rework (#7620)
It's here, the long-foretold and long-procrastinated renderer rework!
Hopefully this makes it easier to adapt and modify the renderer in the
future and ensures feature parity between Metal and OpenGL. Despite
having been a lot of work to write initially, with the abstraction layer
in place I feel like working on the renderer will be a much more
pleasant experience going forward.

## Key points
- CPU-side renderer logic is now mostly unified via a generic
`Renderer`.
- A graphics API abstraction layer over OpenGL and Metal has been
introduced.
- Minimum OpenGL version bumped to `4.3`, so can no longer be run on
macOS; I used the nix VM stuff for my testing during development. (Edit
by @mitchellh: Note for readers that Ghostty still works on macOS, but
the OpenGL backend doesn't, only the Metal one)
- The OpenGL backend now supports linear blending! Woohoo! The default
`alpha-blending` has been updated to `linear-corrected` since it's
essentially a strict improvement over `native`. The default on macOS is
still `native` though to match other mac apps in appearance, since macOS
users are more sensitive to text appearance.
- Custom shaders can now be hot reloaded.
- The background color is once again drawn by us, so custom shaders can
interact with it properly. In general, custom shaders should be a little
more robust.

## The abstraction layer
The general hierarchy of the abstraction layer is as such:
```
 [ GraphicsAPI ] - Responsible for configuring the runtime surface
    |     |        and providing render `Target`s that draw to it,
    |     |        as well as `Frame`s and `Pipeline`s.
    |     V
    | [ Target ] - Represents an abstract target for rendering, which
    |              could be a surface directly but is also used as an
    |              abstraction for off-screen frame buffers.
    V
 [ Frame ] - Represents the context for drawing a given frame,
    |        provides `RenderPass`es for issuing draw commands
    |        to, and reports the frame health when complete.
    V
 [ RenderPass ] - Represents a render pass in a frame, consisting of
   :              one or more `Step`s applied to the same target(s),
 [ Step ] - - - - each describing the input buffers and textures and
   :              the vertex/fragment functions and geometry to use.
   :_ _ _ _ _ _ _ _ _ _/
   v
 [ Pipeline ] - Describes a vertex and fragment function to be used
                for a `Step`; the `GraphicsAPI` is responsible for
                these and they should be constructed and cached
                ahead of time.

 [ Buffer ] - An abstraction over a GPU buffer.

 [ Texture ] - An abstraction over a GPU texture.
```
More specific documentation can be found on the relevant structures.

## Miscellany
Renderers (which effectively just means the generic renderer) are now
expected to only touch GPU resources in `init`, certain lifecycle
functions such as the `displayRealized`/`displayUnrealized` callbacks
from GTK-- and `drawFrame`; and are also expected to be thread-safe.
This allows the renderer thread to build the CPU-side buffers
(`updateFrame`) even if we can only *draw* from the app thread.

Because of this change, we can draw synchronously from the main thread
on macOS when necessary to always have a frame of the correct size
during a resize animation. This was necessary to allow the background to
be drawn by our GPU code (instead of setting a background color on the
layer) while still avoiding holes during resize.

The OpenGL backend now theoretically has access to multi-buffering, but
it's disabled (by setting the buffer count to 1) because it
synchronously waits for frames to complete anyway which means that the
extra buffers were just a waste of memory.

## Validation
To validate that there are no significant or obvious problems, I
exercised both backends with a variety of configurations, and visually
inspected the results. Everything looks to be in order.

The images are available in a gist here:
https://gist.github.com/qwerasd205/c1bd3e4c694d888e41612e53c0560179

## Memory
Here's a comparison of memory usage for ReleaseFast builds on macOS,
between `main` and this branch.
Memory figures given are values from Activity Monitor measuring windows
of the same size, with two tabs with 3 splits each.

||Before|After|
|-:|-|-|
|**Memory**|247.9 MB|224.2 MB|
|**Real Memory**|174.4 MB|172.5 MB|

Happily, the rework has slightly *reduced* the memory footprint- likely
due to removing the overhead of `CAMetalLayer`. (The footprint could be
reduced much further if we got rid of multi-buffering and satisfied
ourselves with blocking for each frame, but that's a discussion for
another day.)

If someone could do a similar comparison for Linux, that'd be much
appreciated!

## Notes / future work
- There are a couple structures that *can* be unified using the
abstraction layer, but I haven't gotten around to unifying yet.
Specifically, in `renderer/(opengl|metal)/`, there's `cell.zig` and
`image.zig`, both of which are substantially identical between the two
backends. `shaders.zig` may also be a candidate for unification, but
that might be *overly* DRY.
- ~~I did not double-check the documentation for config options, which
may mention whether certain options can be hot-reloaded; if it does then
that will need to be updated.~~ Fixed: be5908f
- The `fragCoord` for custom shaders originates at the top left for
Metal, but *bottom* left for OpenGL; fixing this will be a bit annoying,
since the screen texture is likewise vertically flipped between the two.
Some shaders rely on the fragcoord for things like falling particles, so
this does need to be fixed.
- `Target` should be improved to support multiple types of targets right
now it only represents a framebuffer or iosurface, but it should also be
able to represent a texture; right now a kind of messy tagged union is
used so that steps can accept both.
- Custom shader cursor uniforms (#6912) and terminal background images
(#4226, #5233) should be much more straightforward to implement on top
of this rework, and I plan to make follow-up PRs for them once this is
merged.
- I *do* want to do a rework of the pipelines themselves, since the way
we're rendering stuff is a bit messy currently, but this is already a
huge enough PR as it is- so for now the renderer still uses the same
rendering passes that Metal did before.
- We should probably add a system requirements section to the README
where we can note the minimum required OpenGL version of `4.3`, any even
slightly modern Linux system will support this, but it would be good to
document it somewhere user-facing anyway.

# TODO BEFORE MERGE
- [x] Have multiple people test this on both macOS and linux.
- [ ] ~~Have someone with a better dev setup on linux check for memory
leaks and other problems.~~ (Skipped, will merge and let tip users
figure this out, someone should *specifically* look for memory leaks
before the next versioned release though.)
- [x] Address any code review feedback.
2025-06-21 22:00:01 -06:00
Mitchell Hashimoto
5521af4b2b Update iTerm2 colorschemes (#7640)
Upstream revision:
e436898274
2025-06-21 19:49:39 -07:00
mitchellh
fece388f58 deps: Update iTerm2 color schemes 2025-06-22 00:15:04 +00:00
Mitchell Hashimoto
9d922e1c62 feat: add FreeBSD support (#7606)
- [x] Waiting for mitchellh/libxev#167
- [x] Translations
- [x] x11
- [x] Wayland
- [ ] CI
2025-06-21 14:16:52 -07:00
Mitchell Hashimoto
888daca891 ci: remove freebsd test for now 2025-06-21 14:12:13 -07:00
-k
097d1ad21e ci: switch to freebsd-firecracker-action 2025-06-21 14:11:50 -07:00
-k
b32b1e7188 fix: set resources_dir on FreeBSD 2025-06-21 14:11:50 -07:00
-k
8b0de9be4a build: fix terminfo location on FreeBSD 2025-06-21 14:11:50 -07:00
-k
89b39775e5 build: fix fontconfig paths on FreeBSD 2025-06-21 14:11:50 -07:00
Mitchell Hashimoto
43a46d1741 flatpak: update hash 2025-06-21 14:11:50 -07:00
Mitchell Hashimoto
c4d594980a update nix hash 2025-06-21 14:11:50 -07:00
Mitchell Hashimoto
2314d3dbf0 ci: run freebsd tests on Namespace 2025-06-21 14:11:50 -07:00
-k
d6b2d0ef2a fix: update libxev 2025-06-21 14:11:50 -07:00
-k
a209494b43 build: comment locale trim 2025-06-21 14:11:50 -07:00
-k
43b8472ad2 style: fix formatting 2025-06-21 14:11:50 -07:00
-k
16348549c4 fix: enable i18n on FreeBSD 2025-06-21 14:11:50 -07:00
-k
780ee894d8 build: disable i18n on FreeBSD
for now
2025-06-21 14:11:50 -07:00
-k
3e582a6158 test: fix desktop cases 2025-06-21 14:11:50 -07:00
-k
4d7a667dd1 build(deps): bump charlesrocket/libxev to e29fc0c
Waiting for mitchellh/libxev#167
2025-06-21 14:11:50 -07:00
-k
451043357d ci: add freebsd job 2025-06-21 14:11:50 -07:00
-k
baa41c3291 fix(config): enable cgroups for linux only 2025-06-21 14:11:50 -07:00
-k
6e190acf31 fix(config): fix quick-terminal-autohide comment 2025-06-21 14:11:50 -07:00
-k
8e7e9cb8ec fix: check DE env var on FreeBSD 2025-06-21 14:11:50 -07:00
-k
e2937448bb fix: get GTK env var on FreeBSD 2025-06-21 14:11:50 -07:00
-k
e2f86f03b8 test: fix desktop cases on BSD 2025-06-21 14:11:50 -07:00
-k
c1830b563d Import libxev fork
Temp
2025-06-21 14:11:50 -07:00
-k
e09657e263 Add FreeBSD support
Following 7aeadb06ee
2025-06-21 14:11:50 -07:00
Mitchell Hashimoto
0e75dc899c Ghostty Icon Update for macOS Tahoe (#7638)
Fixes #7564 

This updates the Ghostty icon to be compatible with macOS Tahoe
(supports glass effects, light/dark, tinting, etc.). This icon is made
in the new Apple Icon Composer as the source format, and all other
formats are exported from it. The icon is made by [Michael
Flarup](https://flarup.co), the same designer as our original icon.

This commit also updates the icon for non-Apple platforms because the
icon is fundamentally the same and I don't see any reason to maintain
multiple icons of fundamentally the same design and style.

This commit also includes updates to the macOS app so that the About
Window and so on will use the new icon.

## Icon Styles Demo


https://github.com/user-attachments/assets/4b4ea331-9b24-4648-a3f8-8605c1282071

## Glass Demos


https://github.com/user-attachments/assets/f5d04b27-4aae-4178-bd62-ddc739ffb144


https://github.com/user-attachments/assets/11bee1ac-a3e9-4ea9-8bad-3fd1f4babc62


https://github.com/user-attachments/assets/3dae1be9-a2df-465e-a133-022ecaa462b2

## Tinted


https://github.com/user-attachments/assets/e1a9ec28-b8cb-4160-9158-8953e9fb1320
2025-06-21 12:48:52 -07:00
Mitchell Hashimoto
c1c3f639c5 macos: Ghostty Icon Update for macOS Tahoe
This updates the Ghostty icon to be compatible with macOS Tahoe
(supports glass effects, light/dark, tinting, etc.). This icon is made
in the new Apple Icon Composer as the source format, and all other
formats are exported from it.

This commit also updates the icon for non-Apple platforms because the
icon is fundamentally the same and I don't see any reason to maintain
multiple icons of fundamentally the same design and style.

This commit also includes updates to the macOS app so that the About
Window and so on will use the new icon.
2025-06-21 12:34:49 -07:00
Mitchell Hashimoto
95ac157bc5 feat(translation): add missing pt_BR translation (#7632)
Add missing translation
2025-06-21 07:14:22 -07:00
Mitchell Hashimoto
6fe72db0c4 macOS: App Intents (#7634)
This PR integrates Ghostty on macOS with the [App
Intents](https://developer.apple.com/documentation/appintents) system.
The focus of this initial work was on enabling [Apple
Shortcuts](https://support.apple.com/guide/shortcuts/welcome/ios) on
macOS, but App Intents are the same underlying system that powers a
number of other Apple features such as Spotlight, Siri, Widgets, and
more. We don't do much with these latter ones yet, though.

Additionally, this PR begins to refactor and untangle some of our
libghostty API calls from macOS views. Presently, macOS views and view
controllers directly call into the libghostty API and own libghostty
data models. This tight coupling is kind of nasty because it tends to
also couple libghostty API calls to the main GUI thread when they don't
really have to be (they just have to not be concurrently accessed). This
becomes an issue because App Intents run on background threads. This PR
starts to extract out some of this business logic into standalone
classes, but we still force all execution onto the main thread during
the transition.

**Version requirement:** Most of the shortcuts will work on macOS 13,
but there are some that require macOS 14, and some functionality will
require macOS 26. We gracefully degrade in all scenarios (the
capabilities that are unavailable just don't show up on older systems).

> [!IMPORTANT]
>
> This bumps our build requirements on macOS to Xcode 26 and the macOS
26 SDK. **You can still build on macOS 15,** but you must be using the
Xcode 26 beta. This includes a README update about that.

## Why?

Apple Shortcuts is an extremely powerful scripting tool on Apple
platforms. It comes with a number of built-in capabilities such as
moving windows, taking screenshots, fetching secrets, and more. By
integrating with Apple Shortcuts, it allows Ghostty to become scriptable
to a certain extent while also being able to take advantage of this
large ecosystem.

It is a huge downside that Shortcuts is Apple-only and I still would
like to make Ghostty scriptable to some extent on Linux and other
platforms as well. This work doesn't preclude that goal, but gives us an
answer to a large subset of users (macOS users), which is great.

Beyond this, no terminals integrate with Apple Shortcuts except the
built-in Terminal. And even then, the built-in Terminal only exposes two
actions (run script and run script over SSH). I think there's a lot that
can be done by exposing more functionality and I'm excited to see what
people do with this.

Finally, I think Shortcuts is possibly a way we can do some GUI testing
on macOS. That remains to be explored but it seems promising.

## Capability

The initial set of Shortcut actions is shown in the screenshot below:

![CleanShot 2025-06-20 at 12 19
47@2x](https://github.com/user-attachments/assets/07ac3901-8871-4ee5-a7da-663e0e2a90db)

These can be combined with the built-in shortcuts to do some pretty
interesting things.

### Future

There are more capabilities I'd like to expose, but they require
changing core parts of Ghostty that I didn't want to mix into this PR.

## Security

Scripting Ghostty can be considered a security risk, since it allows
arbitrary command execution, reading terminal output, etc. Therefore,
Ghostty will ask for permission prior to allowing any Shortcut to remote
control it:

<img width="859" alt="image"
src="https://github.com/user-attachments/assets/62344248-9c2c-402d-80f6-3fe3910d23fd"
/>

This can be directly overridden using the new `macos-shortcuts`
configuration, which defaults to `ask` but can also be set to `deny` or
`allow` with self-explanatory behaviors.
2025-06-21 07:07:10 -07:00
Mitchell Hashimoto
296f340ff4 macos: the approval dialog is now forever 2025-06-21 06:53:09 -07:00
Mitchell Hashimoto
020976bf88 macos: address some feedback 2025-06-21 06:42:32 -07:00
Mitchell Hashimoto
e4c13cdba8 macos: Optional/Array extensions need to build for iOS too 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
b6559d0899 macos: add a macos-shortcut config 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
647f29bad1 macos: intents all ask for permission 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
027171bd5d macos: can set env vars on new terminal 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
f8bc9b547c macos: support env vars for surface config, clean up surface config 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
e6c24fbf0a macos: remove confirmation option for close terminal 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
2c1e83ba2f macos: intent to open quick terminal 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
f096675eaf macos: Close Terminal Intent 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
0a27aef508 README: note Xcode 26 requirement 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
2df301e2fb macos: mouse pos and scroll intents 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
bc134016f7 macos: move mousePos and mousScroll to Ghostty.Surface 2025-06-21 06:39:20 -07:00
Mitchell Hashimoto
4445a9c637 macos: add mouse button intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
71b6e223af macos: input keyboard event can send modifiers and actions now 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
93619ad420 macos: Ghostty.Key 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
a6074040e7 macos: input intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
c904e86883 macos: invoke keybind intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
14e46d0979 macos: InvokeCommandPaletteIntent and CommandEntity 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
5259d0fa55 macos: starting to work on new libghostty data models 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
bbb69c8f27 macos: NewTerminalIntent returns Terminal, can split 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
683b38f62c macos: can specify parent terminal for new terminal intent 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
b8d4463754 macos: terminal not found should be an error 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
e51a93ee7c macos: Terminal entity has screen contents deferred 2025-06-21 06:39:19 -07:00
Mitchell Hashimoto
93f0ee2089 macos: GetTerminalDetails intent 2025-06-21 06:39:18 -07:00
Mitchell Hashimoto
2aa731a64e macos: TerminalEntity 2025-06-21 06:39:18 -07:00
Mitchell Hashimoto
7ae5018fe8 macos: new terminal intent 2025-06-21 06:39:18 -07:00
Mário Victor Ribeiro Silva
b249fe0b2c fix: undo poedit formatting 2025-06-20 21:15:03 -03:00
Qwerasd
ddf1a5b23d renderer: move drawFrame AutoreleasePool handling to GraphicsAPI
Introduces `drawFrameStart`/`drawFrameEnd` for this purpose.
2025-06-20 16:21:44 -06:00
Qwerasd
ab926fc842 naming(GraphicsAPI): repeat -> presentLastTarget 2025-06-20 15:51:48 -06:00
Qwerasd
a802108558 renderer: remove unused surface parameter from updateFrame 2025-06-20 15:49:53 -06:00
Qwerasd
8b9e6641f2 style(renderer): explicit result type
In case of future breaking changes to `options`
2025-06-20 15:48:44 -06:00
Qwerasd
3e7d64b5ce style(renderer): explicit empty error set for OpenGL init 2025-06-20 15:45:43 -06:00
Qwerasd
ea7a91e2ba style(renderer): explicit error sets 2025-06-20 15:18:41 -06:00
Qwerasd
9d00018f8b renderer: minimize initial size of GPU resources
These will all be resized anyway on the first frame, so there's no point
in preallocating sizes that will be too small.
2025-06-20 15:18:41 -06:00
Qwerasd
2f10caec8f renderer: clarify why SwapChain.defunct is required 2025-06-20 15:18:41 -06:00
Qwerasd
6b7d751007 renderer: make GraphicsAPI.swap_chain_count required 2025-06-20 15:18:41 -06:00
Qwerasd
dccbec2283 style(renderer): capture generic consts as decls in returned struct
Out of an abundance of caution, since there have been issues in the past
relating to consts outside of the returned struct.
2025-06-20 15:18:41 -06:00
Qwerasd
b9e35c5970 renderer: uncomment resize message handling
We need this to get info about the padding, even if we do derive the
grid and screen size separately.

In the future this should possibly be changed to a message that only
sends the padding info and nothing else.
2025-06-20 15:18:41 -06:00
Qwerasd
8b23e73d20 metal: retain IOSurfaceLayer ourselves instead of relying on the view
If this was Swift code, we'd be using a strong reference, which would
retain the layer for us and release it when the object is deallocated,
but this is Zig land so we have to do that manually.

NOTE: We don't *have* to do this, but it fits much better with Zig idiom
and hopefully avoids potential future footguns. We should do this to any
autoreleased objects that we persist a reference to in a Zig struct.
2025-06-20 15:18:41 -06:00
Qwerasd
e8460e80b2 docs: update info about runtime change of custom-shader
Also removes incorrect information about OpenGL requirement, since the
minimum required OpenGL is now unconditionally 4.3
2025-06-20 15:18:41 -06:00
Qwerasd
541bb0d4d9 fix window cross-compilation 2025-06-20 15:18:41 -06:00
Qwerasd
ea1e507af7 unwrap unnecessary @"" identifiers 2025-06-20 15:18:41 -06:00
Qwerasd
6dc5ae7a00 format (remove empty lines) 2025-06-20 15:18:41 -06:00
Qwerasd
ac2eef9aeb renderer: disable multi-buffering for OpenGL
Frames are sequential for OpenGL since the completion handler always
calls `glFinish`, so the extra buffers do nothing but waste memory.
2025-06-20 15:18:41 -06:00
Qwerasd
371d62a82c renderer: big rework, graphics API abstraction layers, unified logic
This commit is very large, representing about a month of work with many
interdependent changes that don't separate cleanly in to atomic commits.

The main change here is unifying the renderer logic to a single generic
renderer, implemented on top of an abstraction layer over OpenGL/Metal.

I'll write a more complete summary of the changes in the description of
the PR.
2025-06-20 15:18:41 -06:00
Qwerasd
521872442a vendor: update glad to OpenGL 4.3 2025-06-20 15:18:41 -06:00
Qwerasd
7cfc906c60 debug: properly set thread names on macOS 2025-06-20 15:18:41 -06:00
Qwerasd
77c050c156 refactor(Metal): make pipeline handling DRYer 2025-06-20 15:18:41 -06:00
Qwerasd
f40cd3cae3 chore: improve Metal API definitions a bit 2025-06-20 15:18:41 -06:00
Mitchell Hashimoto
f55c77bc81 build: Use correct SDK for iOS Simulator shader build (#7636)
This PR makes the build script use the correct SDK and version flag for
the iOS Simulator.

Without this PR, the terminal fails to initialize on the iOS Simulator:

```
Compiler failed to build request
metal error=Target OS is incompatible: library was not compiled for the simulator
error initializing surface err=error.MetalFailed
```


<details>
<summary>With the PR</summary>


![image](https://github.com/user-attachments/assets/13735334-1321-42d5-8f01-4d5f6a7660ba)
</details>

Fixes #7635.
2025-06-20 14:01:54 -07:00
Zhaofeng Li
fda08a6999 build: Use correct SDK for iOS Simulator shader build 2025-06-20 14:02:07 -06:00
Mário Victor Ribeiro Silva
b89cb59d79 translation(pt_BR): add missing translation 2025-06-20 10:23:10 -03:00
RME
cb991620b9 Apply suggestions from code review
Co-authored-by: Hojin You <dev.hojin@gmail.com>
2025-06-19 13:51:34 +02:00
Mitchell Hashimoto
d0e145292e snap: vendor libgtk4-layer-shell.so (#7623)
vendor libgtk4-layer-shell.so to ensure it's available at runtime
regardless of host system.
2025-06-18 08:38:43 -07:00
Ken VanDine
7d2da23021 snap: vendor libgtk4-layer-shell.so 2025-06-18 10:06:35 -04:00
Mitchell Hashimoto
5a788bfa90 build: use xcrun --sdk <sdk> metal for metal paths (#7619)
This wasn't working before but it just requires a restart of the machine
for the changes to take effect. The namespace runners have this prebuilt
so this should work now.

The other workaround was flaky for unknown reasons so I'd prefer to go
back to this.
2025-06-17 16:36:43 -07:00
Mitchell Hashimoto
30a8ba1bf6 macos: disambiguate close tab vs close window for confirmation (#7618)
This fixes an issue where pressing the red close button in a window or
the "x" button on a tab couldn't differentiate and would always close
the tab or close the window (depending on tab counts).

It seems like in both cases, AppKit triggers the `windowShouldClose`
delegate method on the controller, but for the close window case it
triggers this on ALL the windows in the group, not just the one that was
clicked.

I implemented a kind of silly coordinator that debounces
`windowShouldClose` calls over 100ms and uses that to differentiate
between the two cases.
2025-06-17 16:24:46 -07:00
Mitchell Hashimoto
559fd92295 build: use xcrun --sdk <sdk> metal for metal paths
This wasn't working before but it just requires a restart of the machine
for the changes to take effect. The namespace runners have this prebuilt
so this should work now.

The other workaround was flaky for unknown reasons so I'd prefer to go
back to this.
2025-06-17 16:23:29 -07:00
Mitchell Hashimoto
51b9fa751a macos: disambiguate close tab vs close window for confirmation
This fixes an issue where pressing the red close button in a window or
the "x" button on a tab couldn't differentiate and would always close
the tab or close the window (depending on tab counts).

It seems like in both cases, AppKit triggers the `windowShouldClose`
delegate method on the controller, but for the close window case it
triggers this on ALL the windows in the group, not just the one
that was clicked.

I implemented a kind of silly coordinator that debounces
`windowShouldClose` calls over 100ms and uses that to differentiate
between the two cases.
2025-06-17 16:16:14 -07:00
Mitchell Hashimoto
7d01332574 macOS tip regression: Confirm close on window close (#7617)
Fixes #7615

We were incorrectly closing the window without confirmation when there
were no tabs.

This was part of the undo/redo PR.
2025-06-17 15:20:53 -07:00
Mitchell Hashimoto
e6c77789d3 macOS: Confirm close on window close
Fixes #7615

We were incorrectly closing the window without confirmation when there
were no tabs.
2025-06-17 15:03:10 -07:00
Mitchell Hashimoto
676d11fd06 ci: build macOS releases with Xcode 26 (#7616)
Resolves #7591

This moves our CI to build macOS on Sequoia (macOS 15) with Xcode 26,
including the new macOS 26 beta SDK. This includes tip releases. Stable
releases continue to use Xcode 15 and the stable SDK, in case we need to
make a release before macOS Tahoe is stable (though, if its late enough
in the cycle, we may even cut a full release with it).

Importantly, this will make our builds on macOS 26 use the new styling.

I've added a new job that ensures we can continue to build with Xcode 16
and the macOS 15 SDK, as well, although I think that might come to an
end when we switch over to an IconComposer-based icon. I'll verify then.
For now, we continue to support both.

I've also removed our `hasLiquidGlass` check, since this will now always
be true for macOS 26 builds.
2025-06-17 14:04:57 -07:00
Mitchell Hashimoto
6d283c012e ci: build macOS releases with Xcode 26
Resolves #7591

This moves our CI to build macOS on Sequoia (macOS 15) with Xcode 26,
including the new macOS 26 beta SDK.

Importantly, this will make our builds on macOS 26 use the new styling.

I've added a new job that ensures we can continue to build with Xcode 16 and
the macOS 15 SDK, as well, although I think that might come to an end
when we switch over to an IconComposer-based icon. I'll verify then. For
now, we continue to support both.

I've also removed our `hasLiquidGlass` check, since this will now always
be true for macOS 26 builds.
2025-06-17 13:44:13 -07:00
Mitchell Hashimoto
f794693bdc bash: remove dependency on $GHOSTTY_RESOURCES_DIR (#7611)
We were depending on $GHOSTTY_RESOURCES_DIR for two reasons:

1. To locate our script-adjacent bash-preexec.sh script
2. To restrict our script's execution to environments in which
$GHOSTTY_RESOURCES_DIR is available (i.e. Ghostty-only shells)

For (1), we can instead determine our directory using $BASH_SOURCE[0].
This is slightly differently than our previous behavior, where we'd
always load bash-preexec.sh from the $GHOSTTY_RESOURCES_DIR hierarchy,
even if ghostty.bash from source from somewhere else on the file system
... but we never relied on that behavior, even in development.

For (2), there's no harm in source'ing this script outside of Ghostty,
and if that does become a concern, we can restore this condition or use
something more targeted based on those specific cases.

Historically, I believe (2) was in place to enable (1), so addressing
(1) removes the need for (2).

And lastly, none of the other shell integration scripts depend on
$GHOSTTY_RESOURCES_DIR.
2025-06-17 06:48:54 -07:00
Jon Parise
b629f3337a bash: remove dependency on $GHOSTTY_RESOURCES_DIR
We were depending on $GHOSTTY_RESOURCES_DIR for two reasons:

1. To locate our script-adjacent bash-preexec.sh script
2. To restrict our script's execution to environments in which
   $GHOSTTY_RESOURCES_DIR is available (i.e. Ghostty-only shells)

For (1), we can instead determine our directory using $BASH_SOURCE[0].
This is slightly differently than our previous behavior, where we'd
always load bash-preexec.sh from the $GHOSTTY_RESOURCES_DIR hierarchy,
even if ghostty.bash from source from somewhere else on the file system
... but we never relied on that behavior, even in development.

For (2), there's no harm in source'ing this script outside of Ghostty,
and if that does become a concern, we can restore this condition or use
something more targeted based on those specific cases.

Historically, I believe (2) was in place to enable (1), so addressing
(1) removes the need for (2).

And lastly, none of the other shell integration scripts depend on
$GHOSTTY_RESOURCES_DIR.
2025-06-16 19:54:27 -04:00
Mitchell Hashimoto
d0f116da35 macOS: Basic Read-Only Accessibility Integration (#7601)
This integrates with macOS accessibility APIs to expose Ghostty terminal
structure and content.

This is a very, very bare implementation and the terminal contents
currently reported are the _full screen and scrollback_ which is way too
much for realistic human accessibility use. The target use case for this
PR is to enable automated tooling (namely, AI screen readers). However,
this is all groundwork we'll need to iterate and improve the
accessibility work anyways.

To make this work, I also replatformed some of our hacky C APIs onto a
more robust `ghostty_surface_read_text` API that can now read arbitrary
ranges of the screen into C strings for consumers to use. This will be
useful in more places going forward (hint hint).

## Before

Accessibility tooling can't read anything, Ghostty has no attributes, no
contents, just shows up as a square.

![CleanShot 2025-06-15 at 14 06
55@2x](https://github.com/user-attachments/assets/55eba1b4-6fd4-4d78-9434-5d672f374c67)

## After

A lot of metadata, including the screen contents as text.

![CleanShot 2025-06-15 at 14 07
25@2x](https://github.com/user-attachments/assets/e14cb7df-e4e2-4cc4-a214-004a8459f353)

Also, split hierarchies are navigable:



https://github.com/user-attachments/assets/a7b2ffb7-dbeb-41b2-8705-9c3200812c4d
2025-06-15 15:10:27 -07:00
Mitchell Hashimoto
a2b4a2c0e4 macos: complete more ax APIs for terminal accessibility 2025-06-15 14:00:39 -07:00
Mitchell Hashimoto
e69c756c89 macos: auto-expire cached screen contents 2025-06-15 13:55:06 -07:00
Mitchell Hashimoto
839d89f2dc macos: simple cache of screen contents for ax 2025-06-15 13:46:40 -07:00
Mitchell Hashimoto
e1ee180172 apprt/embedded: API to read text can get top left/bottom right coords 2025-06-15 13:06:38 -07:00
Mitchell Hashimoto
c5f921bb06 apprt/embedded: improve text reading APIs (selection, random points) 2025-06-15 07:59:19 -07:00
Mitchell Hashimoto
b46673e631 macos: Tahoe menu item icons, missed the "Ghostty" menu entirely (#7599)
This is a follow up to #7594, I missed an entire menu.
2025-06-15 07:57:11 -07:00
Mitchell Hashimoto
be437f5b64 macos: bare minimum terminal ax 2025-06-15 07:56:05 -07:00
Mitchell Hashimoto
c90eb2e952 macos: AX for debug warning 2025-06-15 07:56:05 -07:00
Mitchell Hashimoto
4237dad240 macOS: simple SplitView AX
Proper labels, action to move the divider
2025-06-15 07:56:05 -07:00
Mitchell Hashimoto
57c79fa357 macos: Tahoe menu item icons, missed the "Ghostty" menu entirely
This is a follow up to #7594, I missed an entire menu.
2025-06-15 07:48:20 -07:00
Mitchell Hashimoto
db28ab4340 macos 15 regression: transparent style shouldn't draw border (#7597)
This fixes a regression from our Tahoe window styling changes on
earlier, stable versions of macOS. We need to set
"titlebarAppearsTransparent" to true in order to hide the bottom border.
2025-06-15 06:57:05 -07:00
Mitchell Hashimoto
7cc7f6cb06 macos 15 regression: transparent style shouldn't draw border
This fixes a regression from our Tahoe window styling changes on
earlier, stable versions of macOS. We need to set 
"titlebarAppearsTransparent" to true in order to hide the bottom
border.
2025-06-15 06:51:11 -07:00
Mitchell Hashimoto
9e45da17d0 macos: menu item symbols for Tahoe (#7594)
This is recommended for macOS Tahoe and all standard menu items now have
associated images. This makes our app look more polished and native for
macOS Tahoe.

On earlier versions of macOS (macOS 15 and earlier), we _do not_ set the
menu item image. Cocoa has supported menu item images for a long time
but it isn't idiomatic to show them in earlier versions, so we only do
this for later macOS versions.

For icon choice, I tried to copy other native macOS apps as much as
possible, mostly from Xcode. It looks like a lot of apps aren't updated
yet. I'm absolutely open to suggestions for better icons but I think
these are a good starting point.

One menu change is I moved "reset font size" above "increase font size"
which better matches other apps (e.g. Terminal.app).


https://github.com/user-attachments/assets/50a68326-221f-454f-9a9c-078878010a63
2025-06-14 19:50:58 -07:00
Mitchell Hashimoto
202020cd7d macos: menu item symbols for Tahoe
This is recommended for macOS Tahoe and all standard menu items now have
associated images. This makes our app look more polished and native for
macOS Tahoe.

For icon choice, I tried to copy other native macOS apps as much as
possible, mostly from Xcode. It looks like a lot of apps aren't updated
yet. I'm absolutely open to suggestions for better icons but I think
these are a good starting point.

One menu change is I moved "reset font size" above "increase font size"
which better matches other apps (e.g. Terminal.app).
2025-06-14 19:44:24 -07:00
Mitchell Hashimoto
bfb1daffbe macos: set toolbar title isBordered to avoid glass view (#7593)
This was recommended by the WWDC25 session on AppKit updates. My hack
was not the right approach.
2025-06-14 15:04:49 -07:00
Mitchell Hashimoto
c4a978b07a macos: set toolbar title isBordered to avoid glass view
This was recommended by the WWDC25 session on AppKit updates. My hack
was not the right approach.
2025-06-14 13:50:02 -07:00
Kristófer R
2f33eee166 fix comptime if statement 2025-06-14 16:26:03 -04:00
Mitchell Hashimoto
22776adc28 ci: update macOS builders to Sequoia (15) and Xcode 16.4 (#7592)
We have been building on macOS 14 and Xcode 16.0 for a longggg time now.
This gets us to a version that will be running Xcode 26 eventually so we
can ultimately build for Tahoe on a stable OS.

This should change nothing in the interim.
2025-06-14 12:48:31 -07:00
Mitchell Hashimoto
5b9f4acbc8 ci: update macOS builders to Sequoia (15) and Xcode 16.4
We have been building on macOS 14 and Xcode 16.0 for a longggg time now.
This gets us to a version that will be running Xcode 26 eventually so
we can ultimately build for Tahoe on a stable OS.

This should change nothing in the interim.
2025-06-14 12:32:48 -07:00
Mitchell Hashimoto
f26dec559a macOS: Tahoe Titlebar Styling Fixes (#7588)
Fixes #7568 
Fixes #7563 

This PR incorporates all the fixes necessary to make all of our
`macos-titlebar-style` values work on macOS Tahoe.

All titlebar styles are significantly more efficient on macOS Tahoe. I
was able to refactor a lot of our complicated logic out of `update`
ticks (which are called on _every event loop tick_) to being eventful,
so the CPU required to render any titlebar style on Tahoe is
dramatically lowered. This fix _might_ be able to be back ported but I
tried my best to not modify Sequoia and earlier codebases to keep them
stable.

The major change here is `macos-titlebar-style = tabs`, which takes on a
whole new look with Tahoe. The ultimate goal of this setting is that the
_native tab bar_ goes into the titlebar, and we've respected that here.
For more background, see #7563 on why we can't easily mimic the Sequoia
style. I think longer term, for people who don't want capsule-tabs in
their titlebar, we'll need a custom tab bar.

## Future Improvements

There are obviously future improvements that can be made. I think for
example the readability in some cases of the `tabs` styling is pretty
bad. But I wonder if Apple themselves will do something about this with
the tab bar, so I'm going to hold out on caring too much.

The main goal of this PR was to make sure Ghostty was usable when
recompiled with the v26 SDKs.

## Screenshots

> [!NOTE]
>
> Ignore the weird background color glitches in the titlebar. That's a
screenshot artifact (bug probably in macOS) and not actually visible
when running.

### `macos-titlebar-style = tabs`

![CleanShot 2025-06-13 at 12 40
43@2x](https://github.com/user-attachments/assets/8728631e-fd0b-47f3-b195-099a7e0e5b72)
![CleanShot 2025-06-13 at 12 40
34@2x](https://github.com/user-attachments/assets/4c280666-4aba-4ae1-9730-cac96e2c88ed)

### `macos-titlebar-style = transparent`

![CleanShot 2025-06-13 at 12 43
53@2x](https://github.com/user-attachments/assets/1743b109-d4bf-4f37-9d73-2e0a0ba21789)
![CleanShot 2025-06-13 at 12 43
45@2x](https://github.com/user-attachments/assets/8cd884b8-5d13-458d-a204-a0ff81698be4)

### `macos-titlebar-style = native`

![CleanShot 2025-06-13 at 12 45
21@2x](https://github.com/user-attachments/assets/781300dc-2229-4d73-80d5-f75105ba0e38)
![CleanShot 2025-06-13 at 12 45
15@2x](https://github.com/user-attachments/assets/ac71b117-ef5a-46bd-8d13-a95a4cb8f5a3)

## TODO

- [x] A really weird bug where if I resize vertically to create
scrollback then create a new tab my font size is... tiny?
- [x] Verify no major regressions on Sequoia
- [x] Sequoia regression: non-native fullscreen with titlebar tabs
doesn't work
- [x] Sequoia regression: reset split zoom button doesn't restore for
tabs titlebar going to zero tabs
- [x] Sequoia regression: transparent isn't working
- [x] Check macOS 26 gates on Solarium instead of version?
- [ ] Merge all windows doesn't create titlebar tabs on Tahoe
2025-06-14 07:02:12 -07:00
Mitchell Hashimoto
928603c23e macos: use a runtime liquid glass check for our Tahoe styling 2025-06-13 20:20:56 -07:00
Mitchell Hashimoto
1b6142b271 macos: don't restore tab bar with non-native fs 2025-06-13 15:02:06 -07:00
Mitchell Hashimoto
ac4b0dcac0 macos: fix transparent tabs on sequoia 2025-06-13 14:57:54 -07:00
Mitchell Hashimoto
1388c277d5 macos: sequoia should use same tab bar identifier as TerminalWindow 2025-06-13 14:43:04 -07:00
Mitchell Hashimoto
8cfc904c0c macos: fix up some sequoia regressions 2025-06-13 14:39:12 -07:00
Mitchell Hashimoto
a7df90ee55 macos: remove split zoom accessory when tabs appear 2025-06-13 13:36:42 -07:00
Mitchell Hashimoto
f7f0514b9f macos: move old toolbar into ventura file 2025-06-13 13:14:16 -07:00
Mitchell Hashimoto
59812c3b02 macos: remove TODO 2025-06-13 12:27:44 -07:00
Mitchell Hashimoto
b1b74d3421 comments 2025-06-13 12:25:21 -07:00
Mitchell Hashimoto
00d41239da macOS: prep the tab bar when system appearance changes 2025-06-13 12:22:29 -07:00
Jeffrey C. Ollie
c1d04a6175 gtk: document effect of changing the class on launching Ghostty 2025-06-13 10:22:17 -05:00
Jeffrey C. Ollie
e5c737a423 linux: use launched-from for new window action 2025-06-13 10:22:16 -05:00
Jeffrey C. Ollie
57392dfcb5 linux: use explicit launched-from config in service files 2025-06-13 10:22:16 -05:00
Jeffrey C. Ollie
649cca61eb gtk: use exhaustive switch for initial-window 2025-06-13 10:22:16 -05:00
Jeffrey C. Ollie
8824d11e1c linux: add dbus and systemd activation services 2025-06-13 10:22:12 -05:00
Mitchell Hashimoto
17ad77b5b0 macos: fix background color of terminal window to match surface 2025-06-12 21:36:00 -07:00
Mitchell Hashimoto
9d9c451b0a macos: titlebar tabs handle hidden traffic buttons 2025-06-12 20:03:21 -07:00
Mitchell Hashimoto
d84c30ce71 macos: titlebar tabs should be transparent 2025-06-12 18:10:37 -07:00
Mitchell Hashimoto
5f99670247 macos: tahoe titlebar tabs taking shape 2025-06-12 17:52:15 -07:00
Mitchell Hashimoto
6ae8bd737a macos: hide the reset zoom titlebar accessory when tab bar is shown 2025-06-12 15:13:23 -07:00
Mitchell Hashimoto
5c8f1948ce macos: remove the duplicated reset zoom accessory view from legacy 2025-06-12 14:42:09 -07:00
Mitchell Hashimoto
de40e7ce02 macos: non-native fullscreen should restore toolbars 2025-06-12 14:36:33 -07:00
Mitchell Hashimoto
658ec2eb6f macos: add reset zoom to all window titles 2025-06-12 14:33:53 -07:00
Mitchell Hashimoto
70029bf82a macos: tahoe terminal tabs shows title 2025-06-12 13:39:19 -07:00
Mitchell Hashimoto
5877913ab8 macoS: Split out terminal tabs for ventura vs tahoe 2025-06-12 12:06:30 -07:00
Mitchell Hashimoto
fd785f98bb macos: titlebar tabs uses legacy window for now 2025-06-12 11:39:10 -07:00
Mitchell Hashimoto
ccfd33022f macos: only titlebar tabs uses legacy styling now 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
e5cb33e911 typos 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
63e56d0402 macos: titlebar fonts work with new terminal window 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
a804dab288 macos: native terminal style works with new subclasses 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
dfa7a114de macos: make transparent titlebars robust against show/hide tabs 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
3595b2a847 macos: transparent titlebar handles transparent background 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
6ce7f612a6 macos: transparent titlebar needs to be rehidden when tabs change 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
7d02977482 macos: add NSView hierarchy debugging code 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
4d33a73fc4 wip: redo terminal window styling 2025-06-11 15:18:02 -07:00
Mitchell Hashimoto
c3d65d3975 build(deps): bump softprops/action-gh-release from 2.2.2 to 2.3.2 (#7569)
Bumps
[softprops/action-gh-release](https://github.com/softprops/action-gh-release)
from 2.2.2 to 2.3.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/softprops/action-gh-release/releases">softprops/action-gh-release's
releases</a>.</em></p>
<blockquote>
<h2>v2.3.2</h2>
<ul>
<li>fix: revert fs <code>readableWebStream</code> change</li>
</ul>
<h2>v2.3.1</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>Bug fixes 🐛</h3>
<ul>
<li>fix: fix file closing issue by <a
href="https://github.com/WailGree"><code>@​WailGree</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/629">softprops/action-gh-release#629</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/WailGree"><code>@​WailGree</code></a>
made their first contribution in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/629">softprops/action-gh-release#629</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/softprops/action-gh-release/compare/v2.3.0...v2.3.1">https://github.com/softprops/action-gh-release/compare/v2.3.0...v2.3.1</a></p>
<h2>v2.3.0</h2>
<!-- raw HTML omitted -->
<ul>
<li>Migrate from jest to vitest</li>
<li>Replace <code>mime</code> with <code>mime-types</code></li>
<li>Bump to use node 24</li>
<li>Dependency updates</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/softprops/action-gh-release/compare/v2.2.2...v2.3.0">https://github.com/softprops/action-gh-release/compare/v2.2.2...v2.3.0</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md">softprops/action-gh-release's
changelog</a>.</em></p>
<blockquote>
<h2>2.3.2</h2>
<ul>
<li>fix: revert fs <code>readableWebStream</code> change</li>
</ul>
<h2>2.3.1</h2>
<h3>Bug fixes 🐛</h3>
<ul>
<li>fix: fix file closing issue by <a
href="https://github.com/WailGree"><code>@​WailGree</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/629">softprops/action-gh-release#629</a></li>
</ul>
<h2>2.3.0</h2>
<ul>
<li>Migrate from jest to vitest</li>
<li>Replace <code>mime</code> with <code>mime-types</code></li>
<li>Bump to use node 24</li>
<li>Dependency updates</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="72f2c25fcb"><code>72f2c25</code></a>
release 2.3.2</li>
<li><a
href="552dc5524b"><code>552dc55</code></a>
fix: revert <code>fs:readableWebStream</code> change (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/632">#632</a>)</li>
<li><a
href="f3cad8bcbf"><code>f3cad8b</code></a>
release 2.3.1</li>
<li><a
href="07a2257003"><code>07a2257</code></a>
fix: fix file closing issue (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/629">#629</a>)</li>
<li><a
href="d5382d3e6f"><code>d5382d3</code></a>
release 2.3.0</li>
<li><a
href="a0e2122208"><code>a0e2122</code></a>
feat: migrate from jest to vitest (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/626">#626</a>)</li>
<li><a
href="8836085300"><code>8836085</code></a>
chore: replace <code>mime</code> with <code>mime-types</code> (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/624">#624</a>)</li>
<li><a
href="86463358d8"><code>8646335</code></a>
chore: bump node to 20.19.2</li>
<li><a
href="46b284799f"><code>46b2847</code></a>
chore(deps): bump the npm group across 1 directory with 5 updates (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/623">#623</a>)</li>
<li><a
href="37fd9d0351"><code>37fd9d0</code></a>
chore(deps): bump undici from 5.28.5 to 5.29.0 (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/621">#621</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/softprops/action-gh-release/compare/v2.2.2...v2.3.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=softprops/action-gh-release&package-manager=github_actions&previous-version=2.2.2&new-version=2.3.2)](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-06-11 06:54:43 -07:00
Kristófer R
31e386afa6 use else if instead of else { if } 2025-06-10 22:03:33 -04:00
dependabot[bot]
990b6a6b08 build(deps): bump softprops/action-gh-release from 2.2.2 to 2.3.2
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2.2.2 to 2.3.2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2.2.2...v2.3.2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 2.3.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-11 00:31:07 +00:00
Mitchell Hashimoto
76a3612195 macos: hidden titlebar windows should cascade on new tab (#7567)
Windows with `macos-titlebar-style = hidden` create new windows when the
new tab binding is pressed. This behavior has existed for a long time.

However, these windows did not cascade, meaning they'd appear overlapped
directly on top of the previous window, which is kind of nasty.

This commit changes it so that new windows created via new tab from a
hidden titlebar window will cascade.
2025-06-10 14:38:48 -07:00
Mitchell Hashimoto
3db5b3da75 macos: hidden titlebar windows should cascade on new tab
Windows with `macos-titlebar-style = hidden` create new windows when the
new tab binding is pressed. This behavior has existed for a long time.

However, these windows did not cascade, meaning they'd appear overlapped
directly on top of the previous window, which is kind of nasty.

This commit changes it so that new windows created via new tab from a
hidden titlebar window will cascade.
2025-06-10 14:31:41 -07:00
Mitchell Hashimoto
e5f5e19eef macos: for windowShouldClose, only close the tab if we have multiple (#7566)
Fixes a regression from our undo/redo rework. We were accidentally
closing the entire window when the "X" button in the tab bar was
clicked.
2025-06-10 12:46:47 -07:00
Mitchell Hashimoto
1f340b4b2d macos: for windowShouldClose, only close the tab if we have multiple
Fixes a regression from our undo/redo rework. We were accidentally
closing the entire window when the "X" button in the tab bar was
clicked.
2025-06-10 12:39:09 -07:00
Mitchell Hashimoto
8b5cceed3e ci: pin gh-action-release to 2.2.2 to workaround issue
https://github.com/softprops/action-gh-release/issues/628
2025-06-10 12:30:22 -07:00
Mitchell Hashimoto
95a04eebc8 macos: unsplit window shouldn't allow split zooming (#7565)
This was always the case, and is a recent regression from the SplitTree
rework. This brings it back to the previous behavior.
2025-06-10 12:21:58 -07:00
Mitchell Hashimoto
2b9a6a4820 macos: unsplit window shouldn't allow split zooming
This was always the case, and is a recent regression from the SplitTree
rework. This brings it back to the previous behavior.
2025-06-10 12:11:18 -07:00
Mitchell Hashimoto
40340e994c font/sprite: add corner pieces from Geometric Shapes block (#7562)
Resolves #3344

Adds ◢ ◣ ◤ ◥ ◸ ◹ ◺ ◿

(The outlined versions aren't perfect, if someone actually uses them and
is dissatisfied they can be improved in the future.)

### Before

![image](https://github.com/user-attachments/assets/72ce8f0a-6109-4c89-b4a9-090ebba401b2)
### After

![image](https://github.com/user-attachments/assets/d10f7569-e476-40e8-9e54-a8d75f2453bb)
2025-06-10 11:57:33 -07:00
Mitchell Hashimoto
c9e6f8bc8d license: update copyright notices to include contributors (#7561)
Updates all copyright notices to include "Ghostty contributors" to
reflect the fact that Mitchell is not the sole copyright owner.

Also adds "Ghostty contributors" to the author section in the manpages,
linking https://github.com/ghostty-org/ghostty/graphs/contributors for
proper credit.

This change was discussed in the Discord.
2025-06-10 11:35:54 -07:00
Qwerasd
12ad0fa4b6 font/sprite: add corner pieces from Geometric Shapes block
◢ ◣ ◤ ◥ ◸ ◹ ◺ ◿
2025-06-10 12:18:56 -06:00
Qwerasd
3d692e46f4 license: update copyright notices to include contributors
Updates all copyright notices to include "Ghostty contributors" to
reflect the fact that Mitchell is not the sole copyright owner.

Also adds "Ghostty contributors" to the author section in the manpages,
linking https://github.com/ghostty-org/ghostty/graphs/contributors for
proper credit.
2025-06-10 10:20:26 -06:00
Mitchell Hashimoto
ad4facf8f1 build: Xcode 26, macOS Tahoe support (build tooling only) (#7559)
This updates our build script and CI to support Xcode 26 and macOS
Tahoe. **This doesn't update the Ghostty app to resolve any Tahoe
issues.**

For CI, we've added a new build job that runs on macOS Tahoe with Xcode
26. I've stopped short of updating our tip release job, since I think I
want to wait until I verify a bit more about Tahoe before we flip that
bit. Also, ideally, we'd run Xcode 26 on Sequoia (macOS 15) for
stability reasons and Namespace doesn't have Xcode 26 on 15 yet.

For builds, this updates our build script to find Metal binaries using
`xcodebuild -find-executable` instead of `xcrun`. The latter doesn't
work with Xcode 26, but the former does and also still works with older
Xcodes. I'm not sure if this is a bug but I did report it: FB17874042.
2025-06-10 07:22:28 -07:00
Mitchell Hashimoto
b0e0aadaf3 build: Xcode 26, macOS Tahoe support (build tooling only)
This updates our build script and CI to support Xcode 26 and macOS
Tahoe. **This doesn't update the Ghostty app to resolve any Tahoe
issues.**

For CI, we've added a new build job that runs on macOS Tahoe with Xcode
26. I've stopped short of updating our tip release job, since I think I
want to wait until I verify a bit more about Tahoe before we flip that
bit. Also, ideally, we'd run Xcode 26 on Sequoia (macOS 15) for
stability reasons and Namespace doesn't have Xcode 26 on 15 yet.

For builds, this updates our build script to find Metal binaries using
`xcodebuild -find-executable` instead of `xcrun`. The latter doesn't
work with Xcode 26, but the former does and also still works with older
Xcodes. I'm not sure if this is a bug but I did report it: FB17874042.
2025-06-10 07:10:40 -07:00
Mitchell Hashimoto
57cd5ef085 feat: implement mode 1048 for saving/restoring cursor position (#7553)
Implements mode 1048 for saving/restoring cursor position.

This is the same as mode 1049 but only saves cursor position without
touching the alternate screen.

**save/restore cursor position:**
- `ESC[?1048h` - save cursor position  
- `ESC[?1048l` - restore cursor position

**Quick test:**
```bash
printf '\e[5;10H[SAVED HERE]'
printf '\e[?1048h'                # save position
printf '\e[15;1HMoved somewhere else...'
printf '\e[?1048l'                # restore 
printf ' RESTORED!'           # should appear next to [SAVED HERE]
```

Fixes #7473
2025-06-09 07:14:59 -07:00
Mitchell Hashimoto
5e77bd6e9b termio: unconditionally show "process exited" message (#7556)
We previously only showed this message if the user had
`wait-after-command` set to true, since if its false the surface would
close anyways.

With the latest undo feature on macOS, this is no longer the case; a
exited process can be undone and reopened. I considered disallowing
undoing an exited surface, but I think there is value in being able to
go back and recapture output in scrollback if you wanted to.
2025-06-09 06:57:59 -07:00
Alex Straight
59bc980250 feat: implement mode 1048 for saving/restoring cursor position 2025-06-09 06:55:38 -07:00
Mitchell Hashimoto
a87c68d49a termio: unconditionally show "process exited" message
We previously only showed this message if the user had
`wait-after-command` set to true, since if its false the surface would
close anyways.

With the latest undo feature on macOS, this is no longer the case; a
exited process can be undone and reopened. I considered disallowing
undoing an exited surface, but I think there is value in being able to
go back and recapture output in scrollback if you wanted to.
2025-06-09 06:51:17 -07:00
Mitchell Hashimoto
e25708fc43 macos: add id to SplitTreeView to detect tree structural changes (#7547)
Fixes #7546

The comments explain what was going on here.
2025-06-08 20:18:12 -07:00
Mitchell Hashimoto
e4cd90b8a0 macos: set explicit identity for split tree view based on structure
Fixes #7546

SwiftUI uses type and structure to identify views, which can lead
to issues with tree like structures where the shape and type is the same
but the content changes. This was causing #7546.

To fix this, we need to add explicit identity to the split tree view
so that SwiftUI can differentiate when it needs to redraw the view.

We don't want to blindly add Hashable to SplitTree because we don't want
to take into account all the fields. Instead, we add an explicit
"structural identity" to the SplitTreeView that can be used by SwiftUI.
2025-06-08 20:11:58 -07:00
Mitchell Hashimoto
804d270ba1 macOS: Undo/Redo for changes to windows, tabs, and splits (#7535)
This PR implements the ability to undo/redo new and closed windows,
tabs, and splits.

## Demo


https://github.com/user-attachments/assets/98601810-71b8-4adb-bfa4-bdfaa2526dc6

## Details

### Undo Timeout

Running terminal sessions _remain running_ for a configurable period of
time after close, during which time they're undoable. This is similar to
"email unsend" (since email in the traditional sense can't be unsent,
clients simply hold onto it for a period of time before sending).

This behavior is not unique to Ghostty. The first and only place I've
seen it is in iTerm2. And iTerm2 behaves similarly, although details of
our behavior and our implementation vary greatly.

The configurable period of time is done via the `undo-timeout`
configuration. The default value is 5 seconds. This feels reasonable to
be and is grounded in being the default for iTerm2 as well, so it's
probably a safe choice.

Undo can be disabled by setting `undo-timeout = 0`. 

### Future

The actions that can be potentially undone/redone can be easily expanded
in the future. Some thoughts on things that make sense to me:

- Any sort of split resizing, including equalization
- Moving tabs or splits

#### What about Linux?

I'd love to support this on Linux. I don't think any other terminal on
Linux has this kind of feature (definitely might be wrong, but I've
never seen it and I've looked at a lot of terminal emulators 😄 ). But
there's some work to be done to get there.

## TODO for the Draft PR

This is still a draft. There are some items remaining (list will update
as I go):

- [x] Undoing a closed window is sometimes buggy still and I'm not sure
why, I have to dig into this.
- [x] New window should be undoable
- [x] New tab should be undoable
- [x] Close All Windows should be undoable
- [x] I think I have to get rid of TerminalManager. Undone windows won't
be in TerminalManager's list of controllers and I think that's going to
break a lot of things.
- [x] I haven't tested this with QuickTerminal at all. I expect bugs
there but I want undo to work with splits there.
- [x] Close window with the red traffic light button doesn't trigger
undo
- [x] Closing window with multiple tabs undoes them as separate windows
2025-06-08 12:54:55 -07:00
Mitchell Hashimoto
6e85c2970b Update iTerm2 colorschemes (#7545)
Upstream revision:
10f216f54a
2025-06-08 12:42:14 -07:00
Mitchell Hashimoto
26e1dd8f8e macos: clear out the surface trees to prevent repeat undo
see the comment
2025-06-08 12:41:45 -07:00
Mitchell Hashimoto
3de3f48faf macos: fix undo/redo for closing windows with multiple tabs
When closing a window that contains multiple tabs, the undo operation
now properly restores all tabs as a single tabbed window rather than
just restoring the active tab.

The implementation:
- Collects undo states from all windows in the tab group before closing
- Sorts them by their original tab index to preserve order
- Clears tab group references to avoid referencing garbage collected objects
- Restores all windows and re-adds them as tabs to the first window
- Tracks and restores which tab was focused (or focuses the last tab if none were)

AI prompts that generated this commit are below.

Each separate prompt is separated by a blank line, so this session was
made up with many prompts in a back-and-forth conversation.

> We need to update the undo/redo implementation in
> @macos/Sources/Features/Terminal/TerminalController.swift `closeWindowImmediately`
> to handle the case that multiple windows in a tab group are closed all at once,
> and to restore them as a tabbed window. To do this, I think we should collect
> all the `undoStates`, sort them by `tabIndex` (null at the end), and then on j
> restore, restore them one at a time but add them back to the same tabGroup. We
> can't use the tab group in the `undoState` because it will be garbage collected
> by then. To be sure, we should just set it to nil.

I should note at this point that the feature already worked, but the
code quality and organization wasn't up to my standards. If someone
using AI were just trying to make something work, they might be done at
this point.

I do think this is the biggest gap I worry about with AI-assisted
development: bridging between the "it works" stage at a junior quality
and the "it works and is maintainable" stage at a senior quality. I
suspect this will be a balance of LLMs getting better but also senior
code reviewers remaining highly involved in the process.

> Let's extract all the work you just did into a dedicated private method
> called `registerUndoForCloseWindow`

Manual: made some tweaks to comments, moved some lines around, didn’t change
any logic.

> I think we can pull the tabIndex directly from the undoState instead of
> storing it in a tuple.

> Instead of `var undoStates`, I think we can create a `let undoStates` and
> build and filter and sort them all in a chain of functional mappings.

> Okay, looking at your logic for restoration, the `var firstController` and
> conditionals are littly messy. Can you make your own pass at cleaning those
> up and I'll review and provide more specific guidance after.

> Excellent. Perfect. The last thing we're missing is restoring the proper
> focused window of the tab group. We should store that and make sure the
> proper window is made key. If no windows were key, then we should make the
> last one key.

> Excellent. Any more cleanups or comments you'd recommend in the places you
> changed?

Notes on the last one: it gave me a bunch of suggestions, I rejected most but
did accept some.

> Can you write me a commit message summarizing the changes?

It wrote me a part of the commit message you're reading now, but I
always manually tweak the commit message and add my own flair.
2025-06-08 08:08:01 -07:00
Mitchell Hashimoto
ec043e1386 macos: red traffic light should be undoable 2025-06-08 07:00:51 -07:00
Kristófer R
6ed94b0034 move mac address length constant to file-level scope 2025-06-07 22:17:01 -04:00
Kristófer R
73e5f7e5d6 merge std.Uri.ParseError and os/hostname error sets 2025-06-07 22:12:26 -04:00
Kristófer R
e4a175d24a use explicit error set 2025-06-07 22:07:18 -04:00
Kristófer R
7760389ab8 add comptime check for platform
we only need the mac-address-as-hostname workaround on macos, so we
now have a comptime check to see if we're on macos.
2025-06-07 22:07:18 -04:00
Kristófer R
68f48b9911 name the 17 magic constant mac_address_length 2025-06-07 22:07:18 -04:00
Kristófer R
dfdb588f58 add tests for hostnames without a path component 2025-06-07 22:07:18 -04:00
Kristófer R
a24d0c9faf re-order end-of-hostname validity check 2025-06-07 22:07:18 -04:00
Kristófer R
bb07e9c026 don't rely on hard-coded schemes 2025-06-07 22:07:18 -04:00
Kristófer R
7a639a7119 use iterator syntax in for loop 2025-06-07 22:07:18 -04:00
Kristófer R
e0655a7f75 Move url parsing helper to os/hostname
Also adds a test to verify that the function is working as intended.
2025-06-07 22:07:18 -04:00
Kristófer R
ffe7f0d8bf extract url parsing into its own function 2025-06-07 22:07:18 -04:00
Kristófer R
64bfaf23f9 take kitty-shell-cwd scheme into account 2025-06-07 22:07:17 -04:00
Kristófer R
b66368b4d6 extract mac address validity check to function 2025-06-07 22:07:17 -04:00
Kristófer R
19ca1bfb1c Fix modulo operation and custom Uri struct init 2025-06-07 22:07:17 -04:00
Kristófer R
0e74b8027a pwd: fix hostname resolution on macos
When macOS's "Private WiFi address" feature is enabled it'll change the
hostname to a mac address. Mac addresses look like URIs with a hostname
and port component, e.g. 12:34:56:78:90:12 where `:12` looks like port
12. However, mac addresses can also contain letters a through f, so a
valid mac address like ab💿ef🆎cd:ef is valid, but will not be parsed
as a URI, because `:ef` is not a valid port.

This commit attempts to fix that by checking if the hostname is a valid
mac address when `std.Uri.parse()` fails and constructing a new std.Uri
struct using that information.

It's not perfect, but is equally compliant with the URI spec as std.Uri
currently is.
2025-06-07 22:07:17 -04:00
mitchellh
3b33813071 deps: Update iTerm2 color schemes 2025-06-08 00:14:39 +00:00
Mitchell Hashimoto
e986beb6a7 input: parse binds containing equal signs correctly (#7544)
Since the W3C rewrite we're able to specify codepoints like `+` directly
in the config format who otherwise have special meanings. Turns out we
forgot to do the same for `=`.
2025-06-07 16:30:01 -07:00
Leah Amelia Chen
ba15da4722 input: parse binds containing equal signs correctly
Since the W3C rewrite we're able to specify codepoints like `+` directly
in the config format who otherwise have special meanings. Turns out we
forgot to do the same for `=`.
2025-06-08 01:12:17 +02:00
Leah Amelia Chen
990d1cdf37 gtk/CommandPalette: prevent leaks on initialization (#7541)
* Deallocate the builder after use
* Don't hold a reference to `Command` after appending to `GListStore`
2025-06-07 23:15:16 +02:00
Mitchell Hashimoto
6f6d493763 macos: show quick terminal on undo/redo 2025-06-07 13:14:21 -07:00
Mitchell Hashimoto
6e77a5a6ca macos: address quick terminal basic functionality with new API 2025-06-07 13:07:31 -07:00
Mitchell Hashimoto
537b5101c6 os/flatpak: fix resource leaks in FlatpakHostCommand (#7542)
This PR solves a few resource leaks in `FlatpakHostCommand`:

- Threads created by `FlatpakHostCommand.spawn` are now detached,
allowing its resources to be released.
- Errors created by various `glib`/`gio` APIs are now freed after use.
2025-06-07 12:57:34 -07:00
Mitchell Hashimoto
20744f0482 macos: fix some CI build issues 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
973a2afdde macos: make sure we're not registering unnecessary undos 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
b234cb2014 macos: only process reopen if already activated 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
396e53244d config: add super+shift+t as a default undo too to mimic browsers 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
aeede903f5 macos: undo close all windows 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
d92db73f25 macos: undo new tab 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
636b1fff8a macos: initial window shouldn't support undo 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
797c10af37 macos: undo new window 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
33d128bcff macos: remove TerminalManager
All logic related to TerminalController is now in TerminalController.
2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
3b77a16b63 Make undo/redo app-targeted so it works with no windows 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
5507ec0fc0 macos: compile errors in CI 2025-06-07 12:46:15 -07:00
Mitchell Hashimoto
966c4f98c7 apprt/glfw,gtk: noop undo/redo actions 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
d2d3852026 macos: remove debug log 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
49cc88f0d3 macos: configurable undo timeout 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
3e02c0cbd5 macos: fix an incorrect bindable write during view update 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
b044f4864a add undo/redo keybindings, default them on macOS 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
e1847da139 macos: more robust undo tab that goes back to the same position 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
5f74445b14 macos: basic undo tab, not quite working 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
104cc2adfe macos: basic undo close window, not very robust yet 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
f571519157 macos: setup undo responders at the AppDelegate level 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
6d32b01c64 macos: implement a custom ExpiringUndoManager, setup undo for new/close 2025-06-07 12:46:14 -07:00
Mitchell Hashimoto
493b1f5350 wip: undo 2025-06-07 12:46:13 -07:00
Mitchell Hashimoto
e70a4682ac macos: quick terminal restores previous size when exiting final surface (#7543)
This fixes a regression from the new split work last week, but it was
also probably an issue before that in a slightly different way.

With the new split work, the quick terminal was becoming unusable when
the final surface explicitly `exit`-ed, because AppKit/SwiftUI would
resize the window to a very small size and you couldn't see the new
terminal on the next toggle.

Prior to this, I think the quick terminal would've reverted to its
original size but I'm not sure (even if the user resized it manually).

This commit saves the size of the quick terminal at the point all
surfaces are exited and restores it when the quick terminal is shown the
next time with a new initial surface.
2025-06-07 12:46:04 -07:00
Mitchell Hashimoto
41ee578b7a macos: quick terminal restores previous size when exiting final surface
This fixes a regression from the new split work last week, but it was
also probably an issue before that in a slightly different way.

With the new split work, the quick terminal was becoming unusable when
the final surface explicitly `exit`-ed, because AppKit/SwiftUI would
resize the window to a very small size and you couldn't see the new
terminal on the next toggle.

Prior to this, I think the quick terminal would've reverted to its
original size but I'm not sure (even if the user resized it manually).

This commit saves the size of the quick terminal at the point all
surfaces are exited and restores it when the quick terminal is shown the
next time with a new initial surface.
2025-06-07 12:37:44 -07:00
Leorize
53c2874667 flatpak: free GError after use 2025-06-07 14:34:55 -05:00
Leorize
42bafe9d59 flatpak: detach process tracking thread after spawn
This makes sure the underlying thread implementation know to free
resources the moment the thread is no longer necessary, preventing leaks
from not manually collecting the thread.
2025-06-07 14:34:39 -05:00
Leorize
ea0766e62b gtk/CommandPalette: prevent leaks on initialization
* Deallocate the builder after use
* Don't hold a reference to `Command` after appending to `GListStore`
2025-06-07 12:00:51 -05:00
Mitchell Hashimoto
1c7623db81 terminal: fix crash when reflowing grapheme with a spacer head (#7537)
Fixes #7536

When we're reflowing a row and we need to insert a spacer head, we must
move to the next row to insert it. Previously, we were setting a spacer
head and then copying data into that spacer head, which could lead to
corrupt data and an eventual crash.

In debug builds this triggers assertion failures but in release builds
this would lead to silent corruption and a crash later on.

The unit test shows the issue clearly but effectively you need a
multi-codepoint grapheme such as `👨‍👨‍👦‍👦` to wrap across a row by
changing the columns.
2025-06-07 06:53:01 -07:00
Mitchell Hashimoto
aab00da242 terminal: fix crash when reflowing grapheme with a spacer head
Fixes #7536

When we're reflowing a row and we need to insert a spacer head, we must
move to the next row to insert it. Previously, we were setting a spacer
head and then copying data into that spacer head, which could lead to
corrupt data and an eventual crash.

In debug builds this triggers assertion failures but in release builds
this would lead to silent corruption and a crash later on.

The unit test shows the issue clearly but effectively you need a
multi-codepoint grapheme such as `👨‍👨‍👦‍👦` to wrap across a row by changing
the columns.
2025-06-06 20:37:12 -07:00
Mitchell Hashimoto
269d29624b Add bell feature flags for audio, attention, and title actions on macOS (#7533)
Resolve #7526
2025-06-06 12:59:23 -07:00
Aaron Ruan
5f6a15abef Add bell feature flags for audio, attention, and title actions on macOS
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-06-06 23:54:34 +08:00
Mitchell Hashimoto
5b68e49847 macos: dismiss notifications on focus, application exit (#7531)
I've only recently been using programs that use user notifications
heavily and this commit addresses a number of annoyances I've
encountered.

1. Notifications dispatched while the source terminal surface is focused
are now only shown for a short time (3 seconds hardcoded) and then
automatically dismiss.

2. Notifications are dismissed when the target surface becomes focused
from an unfocused state. This dismissal happens immediately (no delay).

  3. Notifications are dismissed when the application exits.

  4. This fixes a bug where notification callbacks were modifying view
     state, but the notification center doesn't guarantee that the
     callback is called on the main thread. We now ensure that
     the callback is always called on the main thread.
2025-06-06 07:36:30 -07:00
Mitchell Hashimoto
70f030e3c2 macos: dismiss notifications on focus, application exit
I've only recently been using programs that use user notifications heavily
and this commit addresses a number of annoyances I've encountered.

  1. Notifications dispatched while the source terminal surface is
     focused are now only shown for a short time (3 seconds hardcoded)
     and then automatically dismiss.

  2. Notifications are dismissed when the target surface becomes focused
     from an unfocused state. This dismissal happens immediately (no
     delay).

  3. Notifications are dismissed when the application exits.

  4. This fixes a bug where notification callbacks were modifying view
     state, but the notification center doesn't guarantee that the
     callback is called on the main thread. We now ensure that
     the callback is always called on the main thread.
2025-06-06 07:28:32 -07:00
Mitchell Hashimoto
08101b0bc5 macos: fix hasWindowButtons logic (#7504 follow-up) (#7528)
Took another look through #7504 after the merge and realized that the
logic behind the `hasWindowButtons` property wasn't quite sound. It
would return `false` if either _at least one_ button were missing in the
`standardWindowButton(.theButton) == nil` sense, or if _all_ buttons
were hidden in the `isHidden` sense.

With this PR, the logic is rectified: `false` if _all_ buttons are
missing or hidden in any sense, otherwise `true`.

In practice, I suppose Ghostty won't ever instantiate a `TerminalWindow`
where `standardWindowButton(.theButton) == nil`, but might as well get
it right and sleep better at night.
2025-06-05 14:11:10 -07:00
Mitchell Hashimoto
2fae2eb568 macos: split directional navigation should use distance to leaf (#7527)
Fixes regression from #7523

I messed two things up around spatial navigation in the split tree that
this commit fixes:

1. The distance in the spatial tree only used a single dimension that we
were navigating. This commit now uses 2D euclidean distance from the
top-left corners of nodes. This handles the case where the nodes are
directly above or below each other better.

2. The spatial slots include split containers because they are layout
elements. But we should only navigate to leaf nodes. This was causing
the wrong navigatin to happen in some scenarios.
2025-06-05 13:54:53 -07:00
Daniel Wennberg
c2c267439b macos: fix hasWindowButtons logic 2025-06-05 13:48:53 -07:00
Mitchell Hashimoto
045c84acb7 macos: split directional navigation should use distance to leaf
Fixes regression from #7523

I messed two things up around spatial navigation in the split tree
that this commit fixes:

  1. The distance in the spatial tree only used a single dimension
     that we were navigating. This commit now uses 2D euclidean
     distance from the top-left corners of nodes. This handles the case
     where the nodes are directly above or below each other better.

  2. The spatial slots include split containers because they are layout
     elements. But we should only navigate to leaf nodes. This was
     causing the wrong navigatin to happen in some scenarios.
2025-06-05 13:43:07 -07:00
Mitchell Hashimoto
efc1ceab5d macOS: New value-based split tree implementation, move split logic out of SwiftUI into AppKit (#7523)
This is a major rework of how we represent, handle, and render splits in
the macOS app.

This new PR moves the split structure into a dedicated, generic
(non-Ghostty-specific) value-type called `SplitTree<V>`. All logic
associated with splits (new split, close split, move split, etc.) is now
handled by notifications on `BaseTerminalController`. The view hierarchy
is still SwiftUI but it has no logic associated with it anymore and
purely renders a static tree of splits.

Previously, the split hierarchy was owned by AppKit in a type called
`SplitNode` (a recursive class that contained the tree structure). All
logic around creating, zooming, etc. splits was handled by notification
listeners directly within the SwiftUI hierarchy. SwiftUI managed a
significant amount of state and we heavily used bindings, publishers,
and more. The reasoning for this is mostly historical: splits date back
to when Ghostty tried to go all-in on SwiftUI. Since then, we've taken a
more balanced approach of SwiftUI for views and AppKit for data and
business logic, and this has proven a lot more maintainable.

## Spatial Navigation

Previously, focus moving was handled by traversing the tree structure.
This led to some awkward behaviors. See:
https://github.com/ghostty-org/ghostty/issues/524#issuecomment-2668396095

In this PR, we now handle focus moving spatially. This means that move
"left" means moving to the visually left split (from the top-left
corner, a future improvement would be to do it from the cursor
position).

Concretely, given the following split structure:

```
+----------+-----+
|          |  b  |
|          |     |
|   a      +-----+
|          |     |
|          |     |
|          |     |
|          |     |
|----------|  d  |
|   c      |     |
|          |     |
+----------+-----+
```

Moving "right" from `c` now moves to `d`. Previously, it would go to
`b`. On Linux, it still goes to `b`.

## Value Types

One of the major architectural shifts is moving **purely to immutable
value types.** Whenever a split property changes such as a new split,
the ratio between splits, zoomed state, etc. we _create an entirely new
`SplitTree` value_ and replace it along the entire view hierarchy. This
is in some ways wasteful, but split hierarchies are relatively small
(even the largest I've seen in practical use are dozens of splits, which
is small for a computer). And using value types lets us get rid of a ton
of change notification soup around the SwiftUI hierarchy. We can rely on
reference counting to properly clean up our closed views.

> [!NOTE]
> 
> As an aside, I think value types are going to make it a lot easier in
the future to implement features like "undo close." We can just keep a
trailing list of surface tree states and just restore them. This PR
doesn't do anything like that, but it's now possible.

## SwiftUI Simplicity

Our SwiftUI view hierarchy is dramatically simplified. See the
difference in `TerminalSplitTreeView` (new) vs `TerminalSplit` (old).
There's so much less logic in our new views (almost none!). All of it is
in the AppKit layer which is just way nicer.

## AI Notes

This PR was heavily written by AI. I reviewed every line of code that
was rewritten, and I did manually rewrite at every step of the way in
minor ways. But it was very much written in concert. Each commit usually
started as an AI agent writing the whole commit, then nudging to get
cleaned up in the right way.

One thing I found in this task was that until the last commit, I kept
the entire previous implementation around and compiling. The agent
having access to a previous working version of code during a refactor
made the code it produced as follow up in the new architecture
significantly better, despite the new architecture having major
fundamental differences in how it works!
2025-06-05 12:59:43 -07:00
Mitchell Hashimoto
a2a3863ad2 macOS: Add option to hide window buttons (#7504)
Conversion of #7497 to a PR. This implements a feature requested in
#7331: an option to hide the default window buttons on macOS for a
cleaner aesthetic.

~~Builds on #7502 as it requires the same change to avoid the main
toolbar title showing on top of the tab bar.~~ EDIT: rebased on main now
that #7502 was merged.

I aligned the scope of the new option with `macos-titlebar-style`, since
they both customize titlebar elements. This means it has the same edge
case quirks: For example, if you change the setting, reload the config,
and then open a new tab, the appearance of the current window will
depend on which tab is in the foreground. I did it this way because
`macos-titlebar-style` provided an easy template for which derived
configs and functions to modify. Let me know if you want me to try
adjusting this so that a change in the setting also takes effect for
current windows/tabs, which I _think_ should be possible.

Screenshots:
* `macos-titlebar-style = transparent` (default)
![Screenshot 2025-06-01 at 18 04
56](https://github.com/user-attachments/assets/01fa3953-d2ef-4c39-a6e3-f236488dd841)
![Screenshot 2025-06-01 at 18 07
24](https://github.com/user-attachments/assets/cd463ded-a0b2-4f69-9abe-384e7eecaa27)
* `macos-titlebar-style = tabs`
![Screenshot 2025-06-01 at 17 56
35](https://github.com/user-attachments/assets/bf99d046-cdbb-4e5d-b1c5-d51bbba79007)
![Screenshot 2025-06-01 at 17 56
48](https://github.com/user-attachments/assets/098164b8-bf97-4df1-9dff-c1c17e12665d)
2025-06-05 07:46:57 -07:00
Mitchell Hashimoto
6db455eee5 fix: exit non-native fullscreen on close (#7525)
Fixes https://github.com/ghostty-org/ghostty/discussions/7159.
2025-06-05 07:36:50 -07:00
Mitchell Hashimoto
5edf0dffda gtk/TabView: do not closeTab within close-page signal handler (#7515)
`TabView` assumes to be the sole owner of all `Tab`s within a Window. As
such, it could close the managed `Window` once all tabs are removed from
its widget.

However, during `AdwTabView::close-page` signal triggered by libadwaita,
the `Tab` to be closed will gain an another reference for the duration
of the signal, breaking `TabView.closeTab` (called via
`Tab.closeWithConfirmation`) assumptions that having no tabs meant they
are all destroyed.

This commit solves the issue by scheduling `Tab.closeWithConfirmation`
to be run after `AdwTabView::close-page` signal has finished processing.

Fixes #7426
2025-06-05 07:36:10 -07:00
Mitchell Hashimoto
d4249679e3 macos: simplify some ServiceProvider code (#7508)
First, remove the always-inlined openTerminalFromPasteboard code and
combine it with openTerminal. Now that we're doing a bit of work inside
openTerminal, there's little better to having an intermediate, inlined
function.

Second, combine some type-casting operations (saving a .map() call).

Lastly, adjust some variable names because a generic `objs` or `urls`
was a little ambiguous now that we're all in one function scope.
2025-06-05 07:30:03 -07:00
Mitchell Hashimoto
2e0a23aa77 gtk: make requesting attention configurable (#7521)
Partially fixes #7520
2025-06-05 07:29:17 -07:00
Francisco Giordano
9008e21637 fix: exit non-native fullscreen on close 2025-06-05 07:25:53 -07:00
Mitchell Hashimoto
c40ac6b785 input: add focus split directional commands to command palette 2025-06-05 07:11:18 -07:00
Mitchell Hashimoto
1966dfdef7 macos: moving some files around 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
f8e3539b7d macos: remove the unused resizeEvent code from SplitView 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
01fa87f2ab macos: fix iOS builds 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
9474092f77 macos: remove the old split implementation 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
69c3c359cb macos: resize split keybind handling 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
5299f10e13 macos: unzoom on new split and focus change 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
19a9156ae1 macos: address remaining todos 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
6c97e4a59a macos: fix focus after closing splits 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
77458ef308 macos: rename surfaceTree2 to surfaceTree 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
f1ed07caf4 macos: Remove the legacy SurfaceTree 2025-06-05 07:05:13 -07:00
Mitchell Hashimoto
22819f8a29 macos: transfer doesBorderTop 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
8b979d6dce macos: handle surfaceTreeDidChange 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
ea1ff438f8 macos: handle split zooming 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
b7c01b5b4a macos: spatial focus navigation 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
ec7fd94d0f macos: equalize splits works with new tree 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
a389926ca7 macos: use surfaceTree2 needsConfirmQuit 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
aef61661a0 macos: fix up command palette, focusing 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
7dcfebcd5d macos: isSplit guarding on focus split directions works 2025-06-05 07:05:12 -07:00
Mitchell Hashimoto
0fb58298a7 macos: focus split previous/next 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto
b84b715ddb macos: unify confirm close in our terminal controllers 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto
d1dce1e372 macos: restoration for new split tree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto
33d94521ea macos: setup sequence for SplitTree 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto
672d276276 macos: confirm close on split close 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto
e3bc3422dc macos: handle split resizing 2025-06-05 07:05:11 -07:00
Mitchell Hashimoto
1707159441 new SplitTree 2025-06-05 07:05:11 -07:00
Leah Amelia Chen
77479feee6 gtk: make requesting attention configurable 2025-06-05 00:29:49 +02:00
Mitchell Hashimoto
722629f9fa build(deps): bump namespacelabs/nscloud-cache-action from 1.2.7 to 1.2.8 (#7517)
Bumps
[namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action)
from 1.2.7 to 1.2.8.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="449c929cd5"><code>449c929</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/20">#20</a>
from namespacelabs/niklas-timeout</li>
<li><a
href="a63596ed5b"><code>a63596e</code></a>
Wrap action with a timeout.</li>
<li>See full diff in <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1.2.7...v1.2.8">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.7&new-version=1.2.8)](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-06-04 09:07:32 -07:00
Mitchell Hashimoto
f383d7b550 core: document keybind actions better (#7522)
The current documentation for actions are very sparse and would leave
someone (even including contributors) as to what exactly they do. On top
of that there are many stylistic and grammatical problems that are
simply no longer in line with our current standards, and certainly not
on par with our configuration options reference.

Hence, I've taken it upon myself to add, clarify, supplement, edit and
even rewrite the documentation for most of these actions, in a wider
effort of trying to offer better, clearer documentation for our users.
2025-06-04 09:04:16 -07:00
Leah Amelia Chen
2c8d6ba944 core: document keybind actions better
The current documentation for actions are very sparse and would leave
someone (even including contributors) as to what exactly they do.
On top of that there are many stylistic and grammatical problems that are
simply no longer in line with our current standards, and certainly not
on par with our configuration options reference.

Hence, I've taken it upon myself to add, clarify, supplement, edit and
even rewrite the documentation for most of these actions, in a wider
effort of trying to offer better, clearer documentation for our users.
2025-06-04 17:04:52 +02:00
dependabot[bot]
037d4732a6 build(deps): bump namespacelabs/nscloud-cache-action from 1.2.7 to 1.2.8
Bumps [namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action) from 1.2.7 to 1.2.8.
- [Release notes](https://github.com/namespacelabs/nscloud-cache-action/releases)
- [Commits](https://github.com/namespacelabs/nscloud-cache-action/compare/v1.2.7...v1.2.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-06-04 00:46:01 +00:00
Leorize
4e39144d39 gtk/TabView: do not closeTab within close-page signal handler
`TabView` assumes to be the sole owner of all `Tab`s within a Window.
As such, it could close the managed `Window` once all tabs are removed
from its widget.

However, during `AdwTabView::close-page` signal triggered by libadwaita,
the `Tab` to be closed will gain an another reference for the duration
of the signal, breaking `TabView.closeTab` (called via
`Tab.closeWithConfirmation`) assumptions that having no tabs meant they
are all destroyed.

This commit solves the issue by scheduling `Tab.closeWithConfirmation`
to be run after `AdwTabView::close-page` signal has finished processing.
2025-06-03 03:19:13 -05:00
Leah Amelia Chen
108fab11a5 gtk/GlobalShortcuts: don't request session with no shortcuts (#7510) 2025-06-03 09:22:20 +02:00
Mitchell Hashimoto
d993588263 flatpak: rename .Devel variant to .ghostty-debug (#7511)
This is done to match against the default application id when Ghostty is
built using debug configuration, preparing the Flatpak version for D-Bus
activation support (#7433).
2025-06-02 20:09:16 -07:00
Leorize
1183ac8972 flatpak: rename .Devel variant to .ghostty-debug
This is done to match against the default application id when Ghostty is
built using debug configuration, done to prepare the Flatpak version for
D-Bus activation support.
2025-06-02 21:11:58 -05:00
Leorize
58cece07f0 gtk/GlobalShortcuts: don't request session with no shortcuts
There aren't any reason to pay the D-Bus tax if you don't use global
shortcuts.
2025-06-02 20:55:04 -05:00
Jon Parise
652f551bec macos: simplify some ServiceProvider code
First, remove the always-inlined openTerminalFromPasteboard code and
combine it with openTerminal. Now that we're doing a bit of work inside
openTerminal, there's little better to having an intermediate, inlined
function.

Second, combine some type-casting operations (saving a .map() call).

Lastly, adjust some variable names because a generic `objs` or `urls`
was a little ambiguous now that we're all in one function scope.
2025-06-02 20:11:18 -04:00
Mitchell Hashimoto
aa6c349545 macos: fix small memory leak in surface tree when closing splits (#7507)
This fixes a small memory leak I found where the `SplitNode.Leaf` was
not being deinitialized properly when closing a split. It would get
deinitialized the next time a split was made or the window was closed,
so the leak wasn't big. The surface view underneath the split was also
properly deinitialized because we forced it, so again, the leak was
quite small.

But conceptually this is a big problem, because when we change the
surface tree we expect the deinit chain to propagate properly through
the whole thing, _including_ to the SurfaceView.

This fixes that by removing the `id(node)` call. I don't find this to be
necessary anymore. I don't know when that happened but we've changed
quite a lot in our split system since it was introduced. I'm also not
100% sure why the `id(node)` was causing a strong reference to begin
with... which bothers me a bit.

AI note: While I manually hunted this down, I started up Claude Code and
Codex in separate tabs to also hunt for the memory leak. They both
failed to find it and offered solutions that didn't work.
2025-06-02 14:50:02 -07:00
Mitchell Hashimoto
d1f1be8833 macos: fix small memory leak in surface tree when closing splits
This fixes a small memory leak I found where the `SplitNode.Leaf` was
not being deinitialized properly when closing a split. It would get
deinitialized the next time a split was made or the window was closed,
so the leak wasn't big. The surface view underneath the split was also
properly deinitialized because we forced it, so again, the leak was
quite small.

But conceptually this is a big problem, because when we change the
surface tree we expect the deinit chain to propagate properly through
the whole thing, _including_ to the SurfaceView.

This fixes that by removing the `id(node)` call. I don't find this to be
necessary anymore. I don't know when that happened but we've changed
quite a lot in our split system since it was introduced. I'm also not
100% sure why the `id(node)` was causing a strong reference to begin
with... which bothers me a bit.

AI note: While I manually hunted this down, I started up Claude Code and
Codex in separate tabs to also hunt for the memory leak. They both
failed to find it and offered solutions that didn't work.
2025-06-02 14:12:26 -07:00
Mitchell Hashimoto
957ddd00dd Follow-up to #7462: var -> let (#7505)
Just a quick follow-up to #7462: I noticed Swift was admonishing me
about a `var` that could be a `let`, and realized that it was I who had
failed to make that change. Apologies for the noise.
2025-06-02 12:16:41 -07:00
Daniel Wennberg
5244f8d6ac Follow-up to #7462: var -> let 2025-06-02 10:14:52 -07:00
Daniel Wennberg
232a46d2dc Add option to hide macOS traffic lights 2025-06-02 09:22:01 -07:00
Mitchell Hashimoto
3638916819 Enable reset zoom button when macos-titlebar-style = tabs and only one tab (#7502)
This is the conversion of #7496 into a PR. The problem was discussed in
#3288: When `macos-titlebar-style = tabs`, the reset zoom button doesn't
appear with only a single tab, i.e., no tab bar.

This fix was simply to remove an unnecessary branch, as the titlebar
style doesn't make any difference for the required logic. If the tab bar
is visible, you should unconditionally hide the titlebar's button and
rely on the per-tab buttons. If the tab bar is not visible, you should
hide or show the titlebar button depending on `surfaceIsZoomed`.

One wrinkle was that the main toolbar title started showing on top of
the tabs. Turns out it was previously not showing only because it would
always be pushed into the hidden overflow menu. With the reset zoom
button present (either hidden or visible, but always there), this no
longer happens reliably, presumably due to some cascading change in the
overflow calculations. In any case, it seems brittle to rely on this way
of concealing the main title, so I added a few lines of code to properly
hide it when the tab bar is visible.

Screenshots:
![Screenshot 2025-06-01 at 15 42
37](https://github.com/user-attachments/assets/893ba88e-a7e0-4d2f-8d08-45af4a2ba11b)
![Screenshot 2025-06-01 at 15 42
51](https://github.com/user-attachments/assets/f45db556-15a9-4655-96df-c41a34a80ec2)
![Screenshot 2025-06-01 at 15 42
58](https://github.com/user-attachments/assets/645cfe42-014c-4259-afd4-489b8ccdb311)
2025-06-02 09:18:09 -07:00
Daniel Wennberg
12a01c0460 Hide main title when covered by tabs 2025-06-02 09:10:22 -07:00
Daniel Wennberg
85beda9c49 Fix reset zoom button visibility in macOS "tabs" mode when no tabs 2025-06-02 09:09:04 -07:00
Mitchell Hashimoto
70a3d9e895 config: add launched-from to specify launch source (#7503)
Related to #7433

This extracts our "launched from desktop" logic into a config option.
The default value is detection using the same logic as before, but now
this can be overridden by the user.

This also adds the systemd and dbus activation sources from #7433.

There are a number of reasons why we decided to do this:

1. It automatically gets us caching since the configuration is only
loaded once (per reload, a rare occurrence).

2. It allows us to override the logic when testing. Previously, we had
to do more complex environment faking to get the same behavior.

3. It forces exhaustive switches in any desktop handling code, which
will make it easier to ensure valid behaviors if we introduce new launch
sources (as we are in #7433).

4. It lowers code complexity since callsites don't need to have N
`launchedFromX()` checks and can use a single value.
2025-06-02 09:07:28 -07:00
Mitchell Hashimoto
5306e7cf56 config: add launched-from to specify launch source
Related to #7433

This extracts our "launched from desktop" logic into a config option.
The default value is detection using the same logic as before, but now
this can be overridden by the user.

This also adds the systemd and dbus activation sources from #7433.

There are a number of reasons why we decided to do this:

  1. It automatically gets us caching since the configuration is only
     loaded once (per reload, a rare occurrence).

  2. It allows us to override the logic when testing. Previously, we
     had to do more complex environment faking to get the same
     behavior.

  3. It forces exhaustive switches in any desktop handling code, which
     will make it easier to ensure valid behaviors if we introduce new
     launch sources (as we are in #7433).

  4. It lowers code complexity since callsites don't need to have N
     `launchedFromX()` checks and can use a single value.
2025-06-02 08:45:02 -07:00
Leah Amelia Chen
1ff9162598 gtk(wayland,x11): refactors (#7485) 2025-05-31 08:17:11 +02:00
Mitchell Hashimoto
7e85ca3a16 gtk: clean up per-surface cgroup on close (#7487)
Fixes #6766

This ensures that during surface deinit the cgroup is removed. By the
time the surface is deinitialized, the subprocess should already be dead
so the cgroup can be safely removed. If the cgroup cannot be removed for
any reason we log a warning.

I'm still investigating whether we also need to remove the transient
cgroup we create per app but that's a lot less noisy since app startup
and shutdown is a lot more rare.
2025-05-30 19:32:32 -07:00
Mitchell Hashimoto
2b9e781933 gtk: clean up per-surface cgroup on close
Fixes #6766

This ensures that during surface deinit the cgroup is removed. By the
time the surface is deinitialized, the subprocess should already be
dead so the cgroup can be safely removed. If the cgroup cannot be
removed for any reason we log a warning.
2025-05-30 19:31:04 -07:00
Mitchell Hashimoto
84aa359984 font: rework coretext discovery sorting (#7483)
This should make the sorting more robust to fonts with questionable
metadata or atypical style names.

I was originally just going to change the scoring slightly to account
for fonts whose regular italic style is named "Regular Italic" - which
previously resulted in the Bold Italic or Thin Italic style being chosen
instead because they're shorter names, but I decided to do some better
inspection of the metadata and looser style name matching while I was
changing code here anyway.

Also adds a unit test to verify the sorting works correctly, though a
more comprehensive set of tests may be desirable in the future.

(Feel free to make any changes to the PR you feel necessary before
merging while I'm gone over the weekend.)
2025-05-30 19:30:19 -07:00
Mitchell Hashimoto
6e69893f29 font/sprite: rework yQuads and friends for better alignment with draw_block (#7488)
This improves "outer edge" alignment of octants and other elements drawn
using `yQuads` and friends with blocks drawn with `draw_block` -- this
should guarantee alignment along a continuous edge, but may result in a
1px overlap of opposing edges (such as a top half block followed by a
bottom half block with an odd cell height, they will both have the
center row filled).

This is very necessary since several block elements are needed to
complete the set of octants, since dedicated octant characters aren't
included when they would be redundant.

Fixes #7479 

<details>
<summary><b><code>Box.ppm</code> diff</b></summary>


![image](https://github.com/user-attachments/assets/aea667fd-446f-4b60-a220-cdd636093d05)

</details>

> [!NOTE]
> In the future I think we should have a unified single source of truth
for grid positions (divisions of the cell) to ensure this type of thing
can't happen with other characters, and also it would make a lot of the
code cleaner. For now this works though.
2025-05-30 19:29:45 -07:00
Qwerasd
dd670f5107 font/sprite: rework yQuads and friends for better alignment with draw_block
This improves "outer edge" alignment of octants and other elements drawn
using `yQuads` and friends with blocks drawn with `draw_block` -- this
should guarantee alignment along a continuous edge, but may result in a
1px overlap of opposing edges (such as a top half block followed by a
bottom half block with an odd cell height, they will both have the
center row filled).

This is very necessary since several block elements are needed to
complete the set of octants, since dedicated octant characters aren't
included when they would be redundant.
2025-05-30 17:53:52 -06:00
Mitchell Hashimoto
5667b83328 macos: quick terminal can equalize splits (#7486)
Fixes #7480

I regret to inform the haters that an AI agent did this while I was out
getting a coffee. I only had to follow up once to ask it rename the
method to be more idiomatic. I absolutely didn't need AI to do this, but
I was leaving the office _anyways_ and figured why not. Got back and it
was done. What a time to be alive.
2025-05-30 15:24:04 -07:00
Mitchell Hashimoto
fd7132db71 macos: quick terminal can equalize splits
Fixes #7480
2025-05-30 15:13:30 -07:00
Leah Amelia Chen
f99c988b27 gtk(wayland): automatically bind globals 2025-05-30 23:42:48 +02:00
Leah Amelia Chen
9ded668819 gtk(wayland,x11): remove even more redundant checks 2025-05-30 23:42:42 +02:00
Leah Amelia Chen
157f50e2de gtk: request user attention on bell (#7482)
I'm not sure if this should be enabled by default like the tab
animation, but on KDE at least this is unintrusive enough for me to
always enable by default. Alacritty appears to agree with me as well.

Fixes #7124
2025-05-30 23:33:12 +02:00
Qwerasd
34f08a450e font: rework coretext discovery sorting
This should make the sorting more robust to fonts with questionable
metadata or atypical style names.

I was originally just going to change the scoring slightly to account
for fonts whose regular italic style is named "Regular Italic" - which
previously resulted in the Bold Italic or Thin Italic style being chosen
instead because they're shorter names, but I decided to do some better
inspection of the metadata and looser style name matching while I was
changing code here anyway.

Also adds a unit test to verify the sorting works correctly, though a
more comprehensive set of tests may be desirable in the future.
2025-05-30 15:27:39 -06:00
Mitchell Hashimoto
445d88346d config: more robust handling of font-family overwrite for CLI args (#7484)
Fixes #7481

We unfortunately don't have a great way to unit test this since our
logic relies on argv and I'm too lazy to extract it out right now.

The core issue is that we previously detected if font-families changed
by comparing lengths. This doesn't work because the CLI args can reset
and add families back to a lesser length. This caused an integer
overflow.

We can fix this by not being clever and introducing the overwrite logic
directly into the config type. I unit tested that.
2025-05-30 14:26:56 -07:00
Mitchell Hashimoto
8be5a78585 config: more robust handling of font-family overwrite for CLI args
Fixes #7481

We unfortunately don't have a great way to unit test this since our
logic relies on argv and I'm too lazy to extract it out right now.

The core issue is that we previously detected if font-families changed
by comparing lengths. This doesn't work because the CLI args can reset
and add families back to a lesser length. This caused an integer
overflow.

We can fix this by not being clever and introducing the overwrite logic
directly into the config type. I unit tested that.
2025-05-30 14:15:24 -07:00
Leah Amelia Chen
bdcbb9fd42 gtk(wayland): customize keyboard interactivity for quick terminal (#7477)
Fixes #7476
2025-05-30 22:50:56 +02:00
Leah Amelia Chen
90f431005b gtk: request user attention on bell
I'm not sure if this should be enabled by default like the tab
animation, but on KDE at least this is unintrusive enough for me to
always enable by default. Alacritty appears to agree with me as well.
2025-05-30 22:43:07 +02:00
Mitchell Hashimoto
2ad86cde69 OSC: allow multiple set/reset/report operations per OSC (#7429) 2025-05-30 13:16:57 -07:00
Leah Amelia Chen
6959fa8438 gtk(wayland): explicitly set layer name
Even though gtk4-layer-shell's documentation claims that "nobody quite
knows what it's for", some compositors (like Niri) can define custom
rules based on the layer name and it's beneficial in those cases to
define a distinct name just for our quick terminals.
2025-05-30 19:26:18 +02:00
Leah Amelia Chen
dee7c835de gtk(wayland): remove redundant check 2025-05-30 19:26:18 +02:00
Leah Amelia Chen
71a1ece7e9 gtk(wayland): gtk4-layer-shell -> layer-shell
It was getting a bit too unwieldy.
2025-05-30 19:26:18 +02:00
Leah Amelia Chen
6fac355363 gtk(wayland): fallback when on-demand mode isn't supported
This shouldn't be a real problem anymore since as of now (May 2025)
all major compositors support at least version 4, but let's do this
just in case.
2025-05-30 19:26:18 +02:00
Leah Amelia Chen
4d18c06804 gtk(wayland): customize keyboard interactivity for quick terminal
Fixes #7476
2025-05-30 19:26:11 +02:00
Mitchell Hashimoto
2f88b3bcfa GTK: add action to show the GTK inspector (#7468)
The default keybinds for showing the GTK inspector (`ctrl+shift+i` and
`ctrl+shift+d`) don't work reliably in Ghostty due to the way Ghostty
handles input. You can show the GTK inspector by setting the environment
variable `GTK_DEBUG` to `interactive` before starting Ghostty but that's
not always convenient.

This adds a keybind action that will show the GTK inspector. Due to API
limitations toggling the GTK inspector using the keybind action is
impractical because GTK does not provide a convenient API to determine
if the GTK inspector is already showing. Thus we limit ourselves to
strictly showing the GTK inspector. To close the GTK inspector the user
must click the close button on the GTK inspector window. If the GTK
inspector window is already visible but is hidden, calling the keybind
action will not bring the GTK inspector window to the front.
2025-05-30 07:13:34 -07:00
Mitchell Hashimoto
c4088f0c73 terminal: bring alt screen behaviors much closer in line with xterm (#7471)
This brings the behavior of mode 47, 1047, and 1049 much closer to
xterm's behavior. I found that our prior implementation had many
deficiencies.

For example, we weren't properly copying the cursor state back to the
primary screen from the alternate screen for modes 47 and 1047. And we
weren't saving/restoring cursor state unconditionally for mode 1049 even
if we were already in the alternate screen.

I also found that we were dangling hyperlink state on the primary screen
when we switched to alternate. xterm doesn't support hyperlinks but we
did the opposite behavior for going from alternate to primary. So one
way or the other its a bug. I'm worried this one could've maybe led to
memory corruption under the right circumstances but I wasn't able to
prove it.

These are weird, edgy behaviors that I don't think anyone expected
(evidence by there being no bug reports about them), but they are bugs
nontheless.

Many tests added.

(Btw: this flew under the radar of our "xterm audit" because that only
included sequences and not modes. I noted this in the audit issue itself
but just an FYI.)
2025-05-29 20:33:40 -07:00
Mitchell Hashimoto
9b45638c15 input: "ignore" binding action are still be processed by the OS/GUI (#7474)
Related to #7468

This changes the behavior of "ignore". Previously, Ghostty would
consider "ignore" actions consumed but do nothing. They were like a
black hole. Now, Ghostty returns `ignored` which lets the apprt forward
the event to the OS/GUI.

This enables keys that would otherwise be pty-encoded to be processed
later, such as for GTK to show the GTK inspector.
2025-05-29 16:34:03 -07:00
Mitchell Hashimoto
891b23917b input: "ignore" binding action are still be processed by the OS/GUI
Related to #7468

This changes the behavior of "ignore". Previously, Ghostty would
consider "ignore" actions consumed but do nothing. They were like a
black hole. Now, Ghostty returns `ignored` which lets the apprt forward
the event to the OS/GUI.

This enables keys that would otherwise be pty-encoded to be processed
later, such as for GTK to show the GTK inspector.
2025-05-29 16:03:03 -07:00
Mitchell Hashimoto
c5e5d61438 terminal: bring alt screen behaviors much closer in line with xterm
This brings the behavior of mode 47, 1047, and 1049 much closer to
xterm's behavior. I found that our prior implementation had many
deficiencies.

For example, we weren't properly copying the cursor state back to the
primary screen from the alternate screen for modes 47 and 1047. And we
weren't saving/restoring cursor state unconditionally for mode 1049 even
if we were already in the alternate screen.

These are weird, edgy behaviors that I don't think anyone expected
(evidence by there being no bug reports about them), but they are bugs
nontheless.

Many tests added.
2025-05-29 15:43:27 -07:00
Mitchell Hashimoto
d94bcda778 build: use a libc txt file to point to correct Apple SDK (#7469)
This fixes an issue where Ghostty would not build against the macOS 15.5
SDK.

What was happening was that Zig was adding its embedded libc paths to
the clang command line, which included old headers that were
incompatible with the latest (macOS 15.5) SDK. Ghostty was adding the
newer paths but they were being overridden by the embedded libc paths.

The reason this was happening is because Zig was using its own logic to
find the libc paths and this was colliding with the paths we were
setting manually. To fix this, we now use a `libc.txt` file that
explicitly tells Zig where to find libc, and we base this on our own SDK
search logic.
2025-05-29 15:20:42 -07:00
Mitchell Hashimoto
0f1860f066 build: use a libc txt file to point to correct Apple SDK
This fixes an issue where Ghostty would not build against the macOS 15.5 SDK.

What was happening was that Zig was adding its embedded libc paths to
the clang command line, which included old headers that were
incompatible with the latest (macOS 15.5) SDK. Ghostty was adding the
newer paths but they were being overridden by the embedded libc paths.

The reason this was happening is because Zig was using its own logic to
find the libc paths and this was colliding with the paths we were
setting manually. To fix this, we now use a `libc.txt` file that
explicitly tells Zig where to find libc, and we base this on our own SDK
search logic.
2025-05-29 15:04:05 -07:00
Jeffrey C. Ollie
d3cb6d0d41 GTK: add action to show the GTK inspector
The default keybinds for showing the GTK inspector (`ctrl+shift+i` and
`ctrl+shift+d`) don't work reliably in Ghostty due to the way Ghostty
handles input. You can show the GTK inspector by setting the environment
variable `GTK_DEBUG` to `interactive` before starting Ghostty but that's
not always convenient.

This adds a keybind action that will show the GTK inspector. Due to
API limitations toggling the GTK inspector using the keybind action is
impractical because GTK does not provide a convenient API to determine
if the GTK inspector is already showing. Thus we limit ourselves to
strictly showing the GTK inspector. To close the GTK inspector the user
must click the close button on the GTK inspector window. If the GTK
inspector window is already visible but is hidden, calling the keybind
action will not bring the GTK inspector window to the front.
2025-05-29 16:07:57 -05:00
Jeffrey C. Ollie
1104993c94 OSC: move some processing back inside the OSC state machine 2025-05-29 11:37:09 -05:00
Jeffrey C. Ollie
f0fc82c80f OSC: account for 32-bit systems in comptime Command size check 2025-05-29 11:37:09 -05:00
Jeffrey C. Ollie
5fb32fd8a0 OSC: add comptime check for size of OSC Command 2025-05-29 11:37:09 -05:00
Jeffrey C. Ollie
bcf4d55dad OSC: nest ColorOperation-related structs 2025-05-29 11:37:08 -05:00
Jeffrey C. Ollie
fa03115f01 OSC: don't use arena during testing 2025-05-29 11:37:08 -05:00
Jeffrey C. Ollie
35384670c4 OSC: fix typo 2025-05-29 11:37:08 -05:00
Jeffrey C. Ollie
e0ddc7a2fa OSC: clean up color_operation handling 2025-05-29 11:37:08 -05:00
Jeffrey C. Ollie
f2dfd9f677 OSC: improve formatting of ColorOperationSource 2025-05-29 11:37:07 -05:00
Jeffrey C. Ollie
bd4d1950ce OSC: remove unused code 2025-05-29 11:37:07 -05:00
Jeffrey C. Ollie
479fa9f809 OSC: use std.SegmentedList instead of custom data structure 2025-05-29 11:37:07 -05:00
Jeffrey C. Ollie
397a8b13e0 OSC: more tests 2025-05-29 11:37:07 -05:00
Jeffrey C. Ollie
1d9d253e4d OSC: fix bug with buffer disappearing 2025-05-29 11:37:07 -05:00
Jeffrey C. Ollie
04e8e52171 OSC: reflow comment 2025-05-29 11:37:06 -05:00
Jeffrey C. Ollie
1288296fdc OSC: add a datastructure to prevent some (most?) allocations 2025-05-29 11:37:06 -05:00
Jeffrey C. Ollie
5bb7492955 OSC: convert OSC 110, 111, and 112 and add more tests 2025-05-29 11:37:06 -05:00
Jeffrey C. Ollie
5ec1c15ecf OSC: add more tests 2025-05-29 11:37:06 -05:00
Jeffrey C. Ollie
9c1abf487e OSC: start adding structure to allow multiple color operations per OSC 2025-05-29 11:37:06 -05:00
Mitchell Hashimoto
b2f3c7f309 fix: properly intialize key event in GlobalEventTap (#7462)
Fixes #7215. The issue was that `GlobalEventTap` didn't fully initialize
the key event before passing it to `ghostty_app_key`. In particular, it
didn't set the `unshifted_codepoint` field, which is needed to find a
match when calling `keybind.set.getEvent`, because `keybind.set` stores
bindings by codepoint, not physical key (i.e., the trigger to match is
`ctrl+p`, not `ctrl+key_p`, et cetera).

The fix was to make `GlobalEventTap` initialize the key event using
`event.ghosttyKeyEvent`, like it's done in `SurfaceView.keyAction` and
`AppDelegate.localEventKeyDown`.

This is my first time touching either Zig or Swift, so I'm a bit green.
In particular, I don't know if it's possible to write a test covering
this, and if so, how and where to put it. Please edit or request changes
as you see fit.
2025-05-29 08:48:10 -07:00
Daniel Wennberg
d1501a4925 fix: properly intialize key event in GlobalEventTap 2025-05-27 22:33:15 -07:00
Mitchell Hashimoto
8a00aa8223 code style: use @splat where possible (#7461)
As of Zig 0.14.0, `@splat` can be used for array types, which eliminates
a lot of redundant syntax and makes things generally cleaner.

I've explicitly avoided applying this change in the renderer files for
now since it would just create rebasing conflicts in my renderer rework
branch which I'll be PR-ing pretty soon.
2025-05-27 21:30:23 -07:00
Qwerasd
6f7e9d5bea code style: use @splat where possible
As of Zig 0.14.0, `@splat` can be used for array types, which eliminates
a lot of redundant syntax and makes things generally cleaner.

I've explicitly avoided applying this change in the renderer files for
now since it would just create rebasing conflicts in my renderer rework
branch which I'll be PR-ing pretty soon.
2025-05-27 21:55:28 -06:00
Mitchell Hashimoto
ad632f1068 Add support for buffer switching with CSI ? 47 h/l (#7443)
This PR adds support for handling the escape sequences CSI ? 47 h/l,
which are related to alternate screen buffer switching. This is in
response to the issue reported in
[ghostty-org/ghostty#7386](https://github.com/ghostty-org/ghostty/issues/7386).

I'm unsure where to add tests for this change. Would it make sense to
add visual tests for this behavior, or is there a preferred approach or
location for testing such functionality? I tested it locally using the
following commands:
```bash
echo -e "\e[?47h"
echo "Printed on the alt screen"
echo -e "\e[?47l"
```
2025-05-27 11:54:28 -07:00
Jonatan Borkowski
21c97aa9d6 add support for buffer switching with CSI ? 47 h/l 2025-05-27 11:48:14 -07:00
Mitchell Hashimoto
d72a1511fe Rework mouse selection logic (#7444)
This PR fixes the problem discussed in #5058 and #7434 by reworking the
selection logic in a way that better handles edge cases as well as being
generally cleaner.

This rework does change how selection behaves slightly, especially
rectangular selection, but the new behavior of rectangular selection is
more in line with other terminals I tested (Terminal.app, Kitty).

There are some TODO comments for adding unit tests- I ran out of steam
tonight, but if this PR is still open tomorrow I'll go ahead and add
them.
2025-05-27 10:12:31 -07:00
Mitchell Hashimoto
ba02f0ae22 decl literal 2025-05-27 09:55:54 -07:00
Qwerasd
6aa84d0e92 test: introduce helper function for mouse selection tests
Removes a lot of repeated code and makes the test cases easier to
understand at a glance.
2025-05-27 09:38:36 -07:00
Qwerasd
4d11673318 unit test mouse selection logic
Adds many test cases for expected behavior of the selection logic, this
will allow changes to be made more confidently in the future without
fear of regressions.
2025-05-27 09:38:36 -07:00
Qwerasd
ecdac8c8c1 terminal: rework selection logic in core surface
This logic is cleaner and produces better behavior when selecting by
dragging the mouse outside the bounds of the surface, previously when
doing this on the left side of the surface selections would include the
first cell of the next row, this is no longer the case.

This introduces methods on PageList.Pin which move a pin left or right
while wrapping to the prev/next row, or clamping to the ends of the row.
These need unit tests.
2025-05-27 09:38:36 -07:00
Qwerasd
58592d3f65 GTK: Don't clamp cursorpos, allow negative values
Other apprts don't do this, so this should be consistent.
2025-05-27 09:38:36 -07:00
Qwerasd
1ce6544945 Wrap comment at 80 cols 2025-05-27 09:38:36 -07:00
Mitchell Hashimoto
04db2f664b Miscellaneous TODOs (#7451)
See commit messages for details.

If some of the commits in this PR have problems with them I'm perfectly
fine with the others being cherry-picked out while the problems are
addressed.

The biggest/broadest reaching changes in this PR come from converting a
lot of code to use decl literals where possible, so there are a lot of
files where only a handful of lines are modified very slightly.
2025-05-27 07:17:45 -07:00
Mitchell Hashimoto
6b1b5ca0e9 nix: update to Nix 25.05 and Zig 0.14.1 (#7447)
Update to Nix 25.05 which gets us GTK 4.18, libadwaita 1.7, and Zig
0.14.1.

Since Nix updated to Zig 0.14.1, the devshell has been switched to Zig
0.14.1 from zig-overlay as well.

Fixes #7305
2025-05-27 07:12:17 -07:00
Mitchell Hashimoto
483cb42088 Correct $XDG_CONFIG_DIR to $XDG_CONFIG_HOME (#7454)
Ghostty doesn't support `$XDG_CONFIG_DIR`, it only supports
`$XDG_CONFIG_HOME`, so the documentation was incorrect. Not to be
confused with `$XDG_CONFIG_DIRS` nor `$XDG_RUNTIME_DIR` (very
consistent…).

Furthermore, `$XDG_CONFIG_HOME` is the correct XDG path:

> <ins>$XDG_CONFIG_HOME</ins> defines the base directory relative to
which user-specific configuration files should be stored. If
<ins>$XDG_CONFIG_HOME</ins> is either not set or empty, a default equal
to <ins>$HOME</ins>/.config should be used.
> […]
> <ins>$XDG_CONFIG_DIRS</ins> defines the preference-ordered set of base
directories to search for configuration files in addition to the
<ins>$XDG_CONFIG_HOME</ins> base directory. The directories in
<ins>$XDG_CONFIG_DIRS</ins> should be separated with a colon ':'.

— [XDG Base Directory Specification § Environment variables][xdgvars]

Cross-reference:
https://github.com/ghostty-org/ghostty/discussions/7431#discussioncomment-13283139.

[xdgvars]:
https://specifications.freedesktop.org/basedir-spec/latest#variables
2025-05-27 07:10:17 -07:00
Kat
468bfce091 Correct $XDG_CONFIG_DIR to $XDG_CONFIG_HOME in theme documentation. 2025-05-27 22:40:01 +10:00
Qwerasd
2384bd69cc style: use decl literals
This commit changes a LOT of areas of the code to use decl literals
instead of redundantly referring to the type.

These changes were mostly driven by some regex searches and then manual
adjustment on a case-by-case basis.

I almost certainly missed quite a few places where decl literals could
be used, but this is a good first step in converting things, and other
instances can be addressed when they're discovered.

I tested GLFW+Metal and building the framework on macOS and tested a GTK
build on Linux, so I'm 99% sure I didn't introduce any syntax errors or
other problems with this. (fingers crossed)
2025-05-26 21:50:14 -06:00
Qwerasd
2fe2ccdbde font/sprite: use decl literals in box drawing code
Cleaner and less visual noise, easy change to make, there are many other
areas in the code which would benefit from decl literals as well, but
this is an area that benefits a lot from them and is self-contained.
2025-05-26 19:56:35 -06:00
Qwerasd
2905b47279 font: use labeled switch continue pattern for feature string parser
In this case it does result in a little repeated code for reading bytes,
but I find the control flow easier to follow, so it's worth it IMO.
2025-05-26 19:39:39 -06:00
Jeffrey C. Ollie
695e0b3e57 nix: temporarily remove snapcraft from the devshell 2025-05-26 11:43:52 -05:00
Jeffrey C. Ollie
48b6807ac9 nix: fix typos 2025-05-26 11:12:30 -05:00
Jeffrey C. Ollie
98309e3226 nix: update to Nix 25.05 and Zig 0.14.1
Update to Nix 25.05 which gets us GTK 4.18, libadwaita 1.7, and Zig 0.14.1.

Since Nix updated to Zig 0.14.1, the devshell has been switched to Zig 0.14.1
from zig-overlay as well.

Fixes #7305
2025-05-26 10:47:43 -05:00
Qwerasd
25a708ed98 terminal/style: compare packed styles directly, no cast needed
Woohoo, Zig 0.14!
2025-05-25 22:53:50 -06:00
Qwerasd
19db2e2755 CircBuf: non-allocating rotateToZero
We can call `std.mem.rotate` for this.
2025-05-25 22:25:23 -06:00
Jeffrey C. Ollie
3f6c02b49e gtk: improve app id validation (#7442)
'g_application_id_is_valid' doesn't allow empty elements or elements
that start with digits.
This commit updates 'isValidAppId' to be more consistant with
'g_application_id_is_valid' avoiding the app id defaulting to 'GTK
Application' for app ids like '0foo.bar' or 'foo..bar'.
2025-05-25 16:11:26 -05:00
alex-huff
113c196078 gtk: use 'gio.Application.idIsValid' instead of 'isValidAppId' 2025-05-25 15:23:13 -05:00
Mitchell Hashimoto
6697dc6642 Add new and update Norwegian split translations (#7423)
This change changes the wording on the split pane functionality. The new
wording is taken from the macOS terminal app when the whole system is
translated to Norwegian.

macOS uses "Del opp vindu" and "Lukk delt vindu" for "Split Pane" and
"Close Split Pane". So instead of using "split" the verb in question is
always "del". Personally I find this translation to be better rooted in
Norwegian.

When looking at the German translation, which is often a good indicator
for Norwegian as well, one can see the same wording being used.
2025-05-25 12:27:40 -07:00
Mitchell Hashimoto
731d0f0444 Update iTerm2 colorschemes (#7435)
Upstream revision:
273a780bcd
2025-05-25 12:21:17 -07:00
alex-huff
0415a65083 gtk: improve app id validation
'g_application_id_is_valid' doesn't allow empty elements or elements
that start with digits.
This commit updates 'isValidAppId' to be more consistant with
'g_application_id_is_valid' avoiding the app id defaulting to 'GTK
Application' for app ids like '0foo.bar' or 'foo..bar'.
2025-05-25 11:43:40 -05:00
mitchellh
b94d2da567 deps: Update iTerm2 color schemes 2025-05-25 00:15:05 +00:00
Mitchell Hashimoto
034c1c12ef add cut/copy/paste keys (#7430)
The origin of these keys are old sun keyboards.
They are getting picked up by the custom (progammable) keyboard scene
(see https://github.com/manna-harbour/miryoku for a popular layout).
Support in ghosty is quite handy because it allows to bind copy/paste in
a way that doesn't overlap with ctrl-c/ctrl-v, which can have special
bindings in some terminal applications.
2025-05-24 07:17:49 -07:00
Jörg Thalheim
a8651882a7 add cut/copy/paste keys
The origin of these keys are old sun keyboards.
They are getting picked up by the custom (progammable) keyboard scene
(see https://github.com/manna-harbour/miryoku for a popular layout).
Support in ghosty is quite handy because it allows to bind copy/paste in
a way that doesn't overlap with ctrl-c/ctrl-v, which can have special
bindings in some terminal applications.
2025-05-24 00:29:53 +02:00
Alan Moyano
cf7e76d8f2 Adding Argentinian Spanish to CODEOWNERS 2025-05-23 17:25:14 -03:00
Alan Moyano
7bf01b97ca Merge branch 'ghostty-org:main' into main 2025-05-23 17:21:00 -03:00
Mitchell Hashimoto
26a42fac0e Update Turkish translations (#7408) 2025-05-23 07:15:46 -07:00
Mitchell Hashimoto
5eb32a3c47 synthetic package (#7409)
This introduces a new package `src/synthetic` for generating synthetic
data, currently primarily for benchmarking but other use cases can
emerge.

The synthetic package exports a runtime-dispatched type `Generator` that
can generate data of various types. To start, we have a bytes, utf8, and
OSC generator. The goal of each generator is to expose knobs to tune the
probabilities of various outcomes. For example, the UTF-8 generator has
a knob to tune the probability of generating 1, 2, 3, or 4-byte UTF-8
sequences.

Ultimately, the goal is to be able to collect probability data
empirically that we can then use for benchmarks so we can optimize
various parts of the codebase on real-world data shape distributions.
2025-05-23 07:15:33 -07:00
Christoffer Tønnessen
ab25600b2d Add new and update Norwegian split translations
This change changes the wording on the split pane functionality. The new
wording is taken from the macOS terminal app when the whole system is
translated to Norwegian.

macOS uses "Del opp vindu" and "Lukk delt vindu" for "Split Pane" and
"Close Split Pane". So instead of using "split" the verb in question is
always "del". Personally I find this translation to be better rooted in
Norwegian.

When looking at the German translation, which is often a good indicator
for Norwegian as well, one can see the same wording being used.
2025-05-23 10:46:24 +02:00
Mitchell Hashimoto
a2f52b08e5 build(deps): bump cachix/cachix-action from 15 to 16 (#7412)
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action)
from 15 to 16.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/cachix-action/releases">cachix/cachix-action's
releases</a>.</em></p>
<blockquote>
<h2>v16</h2>
<h2>What's Changed</h2>
<ul>
<li>Add a small delay to allow post-build hooks to flush through by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/cachix-action/pull/196">cachix/cachix-action#196</a></li>
<li>Upgraded dependencies</li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/cachix-action/compare/v15...v16">https://github.com/cachix/cachix-action/compare/v15...v16</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="0fc020193b"><code>0fc0201</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/201">#201</a>
from cachix/bump-deps</li>
<li><a
href="9ff160dfdf"><code>9ff160d</code></a>
dist: build</li>
<li><a
href="43208f1165"><code>43208f1</code></a>
deps: pnpm update</li>
<li><a
href="177fc8ba87"><code>177fc8b</code></a>
ci: run private cache tests when secrets are available</li>
<li><a
href="9bb3a15fdb"><code>9bb3a15</code></a>
deps: devenv update</li>
<li><a
href="be5295a636"><code>be5295a</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/cachix-action/issues/197">#197</a>
from cachix/dev-restructure</li>
<li><a
href="dbbedb8579"><code>dbbedb8</code></a>
ci: split build and test scripts</li>
<li><a
href="a3f805d988"><code>a3f805d</code></a>
ci: build once with devenv</li>
<li><a
href="c48cfdb2ec"><code>c48cfdb</code></a>
ci: switch out yarn</li>
<li><a
href="9af815036c"><code>9af8150</code></a>
dist: rebuild</li>
<li>Additional commits viewable in <a
href="https://github.com/cachix/cachix-action/compare/v15...v16">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/cachix-action&package-manager=github_actions&previous-version=15&new-version=16)](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-05-21 15:22:34 -07:00
Mitchell Hashimoto
7dae4d287c build(deps): bump namespacelabs/nscloud-cache-action from 1.2.0 to 1.2.7 (#7411)
Bumps
[namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action)
from 1.2.0 to 1.2.7.
<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.7</h2>
<h2>What's Changed</h2>
<ul>
<li>Print a warning in post if cached paths do not exist at the end. by
<a
href="https://github.com/nichtverstehen"><code>@​nichtverstehen</code></a>
in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/19">namespacelabs/nscloud-cache-action#19</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1...v1.2.7">https://github.com/namespacelabs/nscloud-cache-action/compare/v1...v1.2.7</a></p>
<h2>v1.2.6</h2>
<p>No release notes provided.</p>
<h2>v1.2.5</h2>
<p>No release notes provided.</p>
<h2>v1.2.4</h2>
<p>No release notes provided.</p>
<h2>v1.2.3</h2>
<p>No release notes provided.</p>
<h2>v1.2.2</h2>
<p>No release notes provided.</p>
<h2>Add UV cache mode</h2>
<p>No release notes provided.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2f50e7d0f7"><code>2f50e7d</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/19">#19</a>
from namespacelabs/kirill/post</li>
<li><a
href="e9d413737a"><code>e9d4137</code></a>
Print a warning in post if cached paths do not exist at the end.</li>
<li><a
href="1d016dd6d4"><code>1d016dd</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/18">#18</a>
from namespacelabs/niklas-handle-all-warnings</li>
<li><a
href="13f8bc947a"><code>13f8bc9</code></a>
Ensure all PNPM warnings are skipped.</li>
<li><a
href="7779b07b57"><code>7779b07</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/17">#17</a>
from namespacelabs/niklas-run-on-merge</li>
<li><a
href="ea5a8440c9"><code>ea5a844</code></a>
run checks on merge queue</li>
<li><a
href="20b0b2d55d"><code>20b0b2d</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/16">#16</a>
from namespacelabs/niklas-skip-stderr</li>
<li><a
href="6d893e3fdc"><code>6d893e3</code></a>
Skip PNPM warnings in parsing.</li>
<li><a
href="17d0a826e6"><code>17d0a82</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/15">#15</a>
from namespacelabs/niklas-pnpm-only-errors</li>
<li><a
href="1bc91188ef"><code>1bc9118</code></a>
skip all PNPM warnings.</li>
<li>Additional commits viewable in <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1.2.0...v1.2.7">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.0&new-version=1.2.7)](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-05-21 15:22:24 -07:00
dependabot[bot]
9079561300 build(deps): bump cachix/cachix-action from 15 to 16
Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 15 to 16.
- [Release notes](https://github.com/cachix/cachix-action/releases)
- [Commits](https://github.com/cachix/cachix-action/compare/v15...v16)

---
updated-dependencies:
- dependency-name: cachix/cachix-action
  dependency-version: '16'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-21 21:15:50 +00:00
Mitchell Hashimoto
4a8c3df814 build(deps): bump cachix/install-nix-action from 30 to 31 (#7410)
Bumps
[cachix/install-nix-action](https://github.com/cachix/install-nix-action)
from 30 to 31.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/releases">cachix/install-nix-action's
releases</a>.</em></p>
<blockquote>
<h2>v31</h2>
<p>Starting with v31, this action will use semantic versioning for
releases.
Major tags, like v31, will be bumped to point to the latest minor/patch
release.
This is in line with how most GitHub actions manage releases.</p>
<h2>What's Changed</h2>
<ul>
<li>nix: 2.26.3 -&gt; 2.28.2 by <a
href="https://github.com/Mic92"><code>@​Mic92</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/232">cachix/install-nix-action#232</a></li>
<li>nix: 2.24.9 -&gt; 2.25.2 by <a
href="https://github.com/Mic92"><code>@​Mic92</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/218">cachix/install-nix-action#218</a></li>
<li>ci: fix latest installer tests by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/220">cachix/install-nix-action#220</a></li>
<li>ci: add ubuntu-24.04-arm to matrix by <a
href="https://github.com/msgilligan"><code>@​msgilligan</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/221">cachix/install-nix-action#221</a></li>
<li>nix: 2.25.2 -&gt; 2.26.2 by <a
href="https://github.com/Mic92"><code>@​Mic92</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/226">cachix/install-nix-action#226</a></li>
<li>nix: 2.26.2 -&gt; 2.26.3 by <a
href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/228">cachix/install-nix-action#228</a></li>
<li>feat: Pin actions to hashes by <a
href="https://github.com/l0b0"><code>@​l0b0</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/201">cachix/install-nix-action#201</a></li>
<li>chore(deps): bump actions/checkout from 4.1.1 to 4.2.2 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/234">cachix/install-nix-action#234</a></li>
<li>docs: document how to provide AWS credentials to the nix-daemon by
<a href="https://github.com/sandydoo"><code>@​sandydoo</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/235">cachix/install-nix-action#235</a></li>
<li>nix: 2.28.2 -&gt; 2.28.3 by <a
href="https://github.com/Mic92"><code>@​Mic92</code></a> in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/236">cachix/install-nix-action#236</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/msgilligan"><code>@​msgilligan</code></a> made
their first contribution in <a
href="https://redirect.github.com/cachix/install-nix-action/pull/221">cachix/install-nix-action#221</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/cachix/install-nix-action/compare/v30...v31">https://github.com/cachix/install-nix-action/compare/v30...v31</a></p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/cachix/install-nix-action/blob/master/RELEASE.md">cachix/install-nix-action's
changelog</a>.</em></p>
<blockquote>
<h1>Release</h1>
<p>As of v31, releases of this action follow Semantic Versioning.</p>
<h3>Publishing a new release</h3>
<h4>Publish the release</h4>
<p>Draft <a
href="https://github.com/cachix/install-nix-action/releases">a new
release on GitHub</a>:</p>
<ul>
<li>In <code>Choose a tag</code>, create a new tag, like
<code>v31.2.1</code>, following semver.</li>
<li>Click <code>Generate release notes</code>.</li>
<li><code>Set as the latest release</code> should be selected
automatically.</li>
<li>Publish release</li>
</ul>
<h4>Update the major tag</h4>
<p>The major tag, like <code>v31</code>, allows downstream users to
opt-in to automatic non-breaking updates.</p>
<p>This process follows GitHub's own guidelines:
<a
href="https://github.com/actions/toolkit/blob/main/docs/action-versioning.md">https://github.com/actions/toolkit/blob/main/docs/action-versioning.md</a></p>
<h5>Fetch the latest tags</h5>
<pre><code>git pull --tags --force
</code></pre>
<h5>Move the tag</h5>
<pre><code>git tag -fa v31
</code></pre>
<pre><code>git push origin v31 --force
</code></pre>
<h4>Update the release notes for the major tag</h4>
<p>Find the release on GitHub: <a
href="https://github.com/cachix/install-nix-action/releases">https://github.com/cachix/install-nix-action/releases</a></p>
<p>Edit the release and click <code>Generate release notes</code>.
Edit the formatting and publish.</p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="5261181216"><code>5261181</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/236">#236</a>
from Mic92/nix-2.28.3</li>
<li><a
href="b2b89c6cb1"><code>b2b89c6</code></a>
nix: 2.28.2 -&gt; 2.28.3</li>
<li><a
href="0c65bbe3c1"><code>0c65bbe</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/235">#235</a>
from cachix/docs-aws-creds</li>
<li><a
href="4f800b725c"><code>4f800b7</code></a>
docs: document how to provide AWS credentials to the nix-daemon</li>
<li><a
href="80f8d94dab"><code>80f8d94</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/234">#234</a>
from cachix/dependabot/github_actions/actions/checkou...</li>
<li><a
href="83772d105a"><code>83772d1</code></a>
chore(deps): bump actions/checkout from 4.1.1 to 4.2.2</li>
<li><a
href="48cf9b5849"><code>48cf9b5</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/201">#201</a>
from l0b0/feat/pin-actions</li>
<li><a
href="eafea807c1"><code>eafea80</code></a>
remove unused gitignores</li>
<li><a
href="9b4ef2ff2d"><code>9b4ef2f</code></a>
docs: add release notes</li>
<li><a
href="754537aaed"><code>754537a</code></a>
Merge pull request <a
href="https://redirect.github.com/cachix/install-nix-action/issues/232">#232</a>
from Mic92/nix-update</li>
<li>Additional commits viewable in <a
href="https://github.com/cachix/install-nix-action/compare/v30...v31">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cachix/install-nix-action&package-manager=github_actions&previous-version=30&new-version=31)](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-05-21 14:14:50 -07:00
dependabot[bot]
56fb1cbaaf build(deps): bump namespacelabs/nscloud-cache-action from 1.2.0 to 1.2.7
Bumps [namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action) from 1.2.0 to 1.2.7.
- [Release notes](https://github.com/namespacelabs/nscloud-cache-action/releases)
- [Commits](https://github.com/namespacelabs/nscloud-cache-action/compare/v1.2.0...v1.2.7)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-21 17:40:28 +00:00
dependabot[bot]
adbf834c36 build(deps): bump cachix/install-nix-action from 30 to 31
Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 30 to 31.
- [Release notes](https://github.com/cachix/install-nix-action/releases)
- [Changelog](https://github.com/cachix/install-nix-action/blob/master/RELEASE.md)
- [Commits](https://github.com/cachix/install-nix-action/compare/v30...v31)

---
updated-dependencies:
- dependency-name: cachix/install-nix-action
  dependency-version: '31'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-21 17:40:25 +00:00
Mitchell Hashimoto
f1c42c9f8c synthetic package
This introduces a new package `src/synthetic` for generating synthetic
data, currently primarily for benchmarking but other use cases can
emerge.

The synthetic package exports a runtime-dispatched type `Generator` that
can generate data of various types. To start, we have a bytes, utf8,
and OSC generator. The goal of each generator is to expose knobs to tune the
probabilities of various outcomes. For example, the UTF-8 generator has
a knob to tune the probability of generating 1, 2, 3, or 4-byte UTF-8
sequences.

Ultimately, the goal is to be able to collect probability data
empirically that we can then use for benchmarks so we can optimize
various parts of the codebase on real-world data shape distributions.
2025-05-21 10:20:09 -07:00
Emir SARI
81647bfae6 Update Turkish translations 2025-05-21 20:06:07 +03:00
Mitchell Hashimoto
4c50a4d487 nix: don't strip if we are building a debug version of the package (#7395) 2025-05-20 06:47:27 -07:00
Mitchell Hashimoto
362d026dba flatpak: Add --device=all permission (#7401)
Without --device=all, the sandbox gets a dedicated PTY namespace.
Commands run on the host via the HostCommand D-Bus interface receive the
file descriptors from the namespaced PTY but cannot determine its path
via ttyname(3). This breaks commands like tty(1), ps(1) and
emacsclient(1).

Add --device=all so the host PTY namespace is used when allocating TTYs.
Applications with access to org.freedesktop.Flatpak can already give
themselves arbitrary permissions, so the sandboxing benefits of
restricted device access are limited. For terminal emulators, the
consistency provided by a cross-distribution runtime and ability to
distribute directly to users is the primary benefit of shipping as a
Flatpak rather than sandboxing.
2025-05-19 21:46:06 -07:00
Liam Hupfer
ae095d2262 flatpak: Add --device=all permission
Without --device=all, the sandbox gets a dedicated PTY namespace.
Commands run on the host via the HostCommand D-Bus interface receive the
file descriptors from the namespaced PTY but cannot determine its path
via ttyname(3). This breaks commands like tty(1), ps(1) and
emacsclient(1).

Add --device=all so the host PTY namespace is used when allocating TTYs.
Applications with access to org.freedesktop.Flatpak can already give
themselves arbitrary permissions, so the sandboxing benefits of
restricted device access are limited. For terminal emulators, the
primary benefit of Flatpak is the predictability of the
distro-independent target runtime rather than sandboxing.
2025-05-19 22:50:07 -05:00
Mitchell Hashimoto
e2df9fa759 build: add unwind tables and frame pointers to debug/test builds (#7398)
This fixes an issue where stack traces were unreliable on some platforms
(namely aarch64-linux in a MacOS VM). I'm unsure if this is a bug in Zig
(defaults should be changed?) or what, because this isn't necessary on
other platforms, but this works around the issue.

I've unconditionally enabled this for all platforms, depending on build
mode (debug/test) and not the target. This is because I don't think
there is a downside for other platforms but if thats wrong we can fix
that quickly.

Some binaries have this unconditionally enabled regardless of build mode
(e.g. the Unicode tables generator) because having symbols in those
cases is always useful.

Some unrelated GTK test fix is also included here. I'm not sure why CI
didn't catch this (perhaps we only run tests for none-runtime) but all
tests pass locally and we can look into that elsewhere.

I also updated all our build API calls to be non-deprecated fields.
2025-05-19 19:56:22 -07:00
Mitchell Hashimoto
3d2bc3dca1 build: add unwind tables and frame pointers to debug/test builds
This fixes an issue where stack traces were unreliable on some platforms
(namely aarch64-linux in a MacOS VM). I'm unsure if this is a bug in Zig
(defaults should be changed?) or what, because this isn't necessary on
other platforms, but this works around the issue.

I've unconditionally enabled this for all platforms, depending on build
mode (debug/test) and not the target. This is because I don't think
there is a downside for other platforms but if thats wrong we can fix
that quickly.

Some binaries have this unconditionally enabled regardless of build mode
(e.g. the Unicode tables generator) because having symbols in those
cases is always useful.

Some unrelated GTK test fix is also included here. I'm not sure why CI
didn't catch this (perhaps we only run tests for none-runtime) but all
tests pass locally and we can look into that elsewhere.
2025-05-19 17:12:39 -07:00
Jeffrey C. Ollie
9ad0e4675b nix: keep symbols if we're building a debug package
also add CI tests to make sure debug symbols exist

Co-authored-by: Mitchell Hashimoto <m@mitchellh.com>
2025-05-19 18:52:51 -05:00
Alan Moyano
5f3e5afb88 Add Argentinian Spanish translation and locale support 2025-05-19 20:32:30 -03:00
Mitchell Hashimoto
dd5d2c5d0b Add selection-clear-on-typing (#7394)
Fixes #7392

Docs:

> Whether to clear selected text when typing. This defaults to `true`.
> This is typical behavior for most terminal emulators as well as
> text input fields. If you set this to `false`, then the selected text
> will not be cleared when typing.
>
> "Typing" is specifically defined as any non-modifier (shift, control,
> alt, etc.) keypress that produces data to be sent to the application
> running within the terminal (e.g. the shell). Additionally, selection
> is cleared when any preedit or composition state is started (e.g.
> when typing languages such as Japanese).
>
> If this is `false`, then the selection can still be manually
> cleared by clicking once or by pressing `escape`.
2025-05-19 15:37:25 -07:00
Mitchell Hashimoto
ac6aa8d395 Add selection-clear-on-typing
Fixes #7392

Docs:

> Whether to clear selected text when typing. This defaults to `true`.
> This is typical behavior for most terminal emulators as well as
> text input fields. If you set this to `false`, then the selected text
> will not be cleared when typing.
>
> "Typing" is specifically defined as any non-modifier (shift, control,
> alt, etc.) keypress that produces data to be sent to the application
> running within the terminal (e.g. the shell). Additionally, selection
> is cleared when any preedit or composition state is started (e.g.
> when typing languages such as Japanese).
>
> If this is `false`, then the selection can still be manually
> cleared by clicking once or by pressing `escape`.
2025-05-19 13:56:26 -07:00
Mitchell Hashimoto
af293830f3 Update iTerm2 colorschemes (#7378)
Upstream revision:
f979d8b195
2025-05-19 07:13:21 -07:00
Leah Amelia Chen
60d8c42509 gtk: implement global shortcuts (#7083) 2025-05-19 08:18:28 +02:00
Leah Amelia Chen
6827dc0964 config: document global: support on Linux
Compiling this list of known supported and unsupported platforms has been
amazingly painful. Never change, Linux desktop.
2025-05-18 22:40:31 +02:00
Leah Amelia Chen
54dbd1990a gtk: implement global shortcuts
It's been a lot of D-Bus related pain and suffering, but here it is.

I'm not sure about how well this is integrated inside App, but I'm fairly
proud of the standalone logic.
2025-05-18 22:40:31 +02:00
mitchellh
8a0ca1b573 deps: Update iTerm2 color schemes 2025-05-18 00:14:40 +00:00
Leah Amelia Chen
b1af4a597f gtk: implement command palette (#7167)
Closes #7156
2025-05-16 22:16:48 +02:00
Mitchell Hashimoto
a6466c5ca0 macOS: use file parent dir for openTerminal service cwd (#7286) (#7292)
Fixes #7286

Previously, when using the "New Ghostty Window/Tab Here" macOS service
on a file, the new terminal window/tab would incorrectly open in the
user's home directory. This was because the service handler only
expected directory paths.

This commit updates the service handler to check if the provided path is
a file. If it is, the handler now uses the file's parent
directory as the working directory for the new Ghostty window or tab,
aligning with user expectations. If the path is a directory, it's used
directly as before.
2025-05-15 20:20:59 -07:00
Mitchell Hashimoto
2d29fe0494 bench: add --mode=gen-osc to generate synthetic OSC sequences (#7359)
cc @qwerasd205 

This commit adds a few new mode flags to the `bench-stream` program to
generator synthetic OSC sequences. The new modes are `gen-osc`,
`gen-osc-valid`, and `gen-osc-invalid`. The `gen-osc` mode generates
equal parts valid and invalid OSC sequences, while the suffixed variants
are for generating only valid or invalid sequences, respectively.

This commit also fixes our build system to actually be able to build the
benchmarks. It turns out we were just rebuilding the main Ghostty binary
for `-Demit-bench`. And, our benchmarks didn't run under Zig 0.14, which
is now fixed.

An important new design I'm working towards in this commit is to split
out synthetic data generation to a dedicated package in
`src/bench/synth` although I'm tempted to move it to `src/synth` since
it may be useful outside of benchmarks.

The synth package is a work-in-progress, but it contains a hint of
what's to come. I ultimately want to able to generate all kinds of
synthetic data with a lot of knobs to control dimensionality (e.g. in
the case of OSC sequences: valid/invalid, length, operation types,
etc.).
2025-05-15 20:19:37 -07:00
Mitchell Hashimoto
e1de7a99e8 macos: add "Check for Updates" action, menu item & key-binding support (#7361)
Resolve #7325
2025-05-15 15:45:24 -07:00
Mitchell Hashimoto
5826b8b142 Gamma correct image scaling (#7368)
Fixes the gamma error noted in #7367 for both Metal and OpenGL by using
sRGB image formats for the textures.

This branch also includes the commits from #7367, so it'd probably be
best to review and merge that first.
2025-05-15 15:36:12 -07:00
Qwerasd
ea79fdea11 fix(OpenGL): use sRGB texture format for gamma correct interpolation
otherwise images will be too dark when scaled
2025-05-15 12:44:44 -06:00
Qwerasd
e2f3b6211f fix(Metal): use sRGB texture format for gamma correct interpolation
otherwise images will be too dark when scaled
2025-05-15 12:44:44 -06:00
Mitchell Hashimoto
1d0cb1a9b0 fix(renderer): Don't force images to grid/cell sizes. (#7367)
Also fixed Metal not interpolating scaled images.

See commit message for more details.

|`main` (Metal)|`main` (OpenGL)|Kitty|fixed (Metal)|fixed (OpenGL)|
|-|-|-|-|-|

|![image](https://github.com/user-attachments/assets/bfe09451-0a41-4952-8a55-5d7a9e5b2813)|![image](https://github.com/user-attachments/assets/70ec6775-ba00-40b7-a32d-dcaaa70671b1)|![image](https://github.com/user-attachments/assets/6d03729b-9b8e-4b25-850d-913e76f6183b)|![image](https://github.com/user-attachments/assets/aedfccf0-220c-4575-b5e4-8b467de6d5df)|![image](https://github.com/user-attachments/assets/300a080a-73f0-4c69-9603-df342767a83f)|

<sup>(Zoom in for details.)</sup>

> [!NOTE]
> This comparison reveals a separate problem we have with image scaling,
which Kitty gets right but we don't -- the interpolation is too dark
because of gamma error, we need to be interpolating in linear space but
instead we're interpolating in gamma compressed space. I'll try to
figure out the best way to resolve this.
2025-05-15 11:42:05 -07:00
Qwerasd
ed207514e9 typo 2025-05-15 11:59:17 -06:00
Qwerasd
709b0214a0 fix(renderer): Don't force images to grid/cell sizes
This problem was introduced by f091a69 (PR #6675).

I've gone ahead and overhauled the placement positioning logic as well;
it was doing a lot of expensive calls before, I've significantly reduced
that.

Clipping partially off-screen images is now handled entirely by the
renderer, rather than while preparing the placement, and as such the
grid position passed to the image shader is now signed.
2025-05-15 11:41:12 -06:00
Leah Amelia Chen
d6dea79bde gtk: add option to always display the tab bar
Also fixes crashes in both vanilla GTK and Adwaita implementations of
`closeTab`, which erroneously close windows twice when there are no
more tabs left (we probably already handle it somewhere else).
2025-05-15 19:05:46 +02:00
Aaron Ruan
f343e1ba46 Fix comma typo 2025-05-16 00:40:25 +08:00
Leah Amelia Chen
cc65dfc90e gtk(command_palette): focus fixes 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
2800e0c99b gtk(command_palette): address feedback related to selections
See #7173, #7175
2025-05-15 18:11:19 +02:00
Leah Amelia Chen
7293d91f10 translations(zh_CN): update 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
91f811bfbf translations: update 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
e97dfc2e19 gtk(command_palette): filter out certain actions 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
3b013b1174 gtk: add command palette to titlebar menu 2025-05-15 18:11:19 +02:00
Leah Amelia Chen
048e4acb2c gtk: implement command palette 2025-05-15 18:11:19 +02:00
Aaron Ruan
f6d56f4f03 Handle check_for_updates as unimplemented action 2025-05-15 23:26:47 +08:00
Jeffrey C. Ollie
9ff43cd345 gtk: implement custom audio bell (#5326)
Fixes #2710 

Adds support for custom audio bell notifications.
2025-05-15 10:09:39 -05:00
Aaron Ruan
7ccc181332 macos: add "Check for Updates" action, menu item & key-binding support 2025-05-15 13:34:44 +08:00
Qwerasd
55c1ef779f fix(Metal): interpolate kitty images
uint textures can't be interpolated apparently
2025-05-14 21:12:20 -06:00
Mitchell Hashimoto
a74e352726 bench: add --mode=gen-osc to generate synthetic OSC sequences
This commit adds a few new mode flags to the `bench-stream` program
to generator synthetic OSC sequences. The new modes are `gen-osc`,
`gen-osc-valid`, and `gen-osc-invalid`. The `gen-osc` mode generates
equal parts valid and invalid OSC sequences, while the suffixed variants
are for generating only valid or invalid sequences, respectively.

This commit also fixes our build system to actually be able to build the
benchmarks. It turns out we were just rebuilding the main Ghostty binary
for `-Demit-bench`. And, our benchmarks didn't run under Zig 0.14, which
is now fixed.

An important new design I'm working towards in this commit is to split
out synthetic data generation to a dedicated package in
`src/bench/synth` although I'm tempted to move it to `src/synth` since
it may be useful outside of benchmarks.

The synth package is a work-in-progress, but it contains a hint of
what's to come. I ultimately want to able to generate all kinds of
synthetic data with a lot of knobs to control dimensionality (e.g. in
the case of OSC sequences: valid/invalid, length, operation types,
etc.).
2025-05-14 12:26:31 -07:00
Mitchell Hashimoto
a090e8eeed url: restrict file paths regex to one slash (#7355)
Fixes https://github.com/ghostty-org/ghostty/discussions/7351.

This restricts the valid path prefixes to prevent false matches caused
by literal dot.
2025-05-14 10:32:08 -07:00
Weizhao Ouyang
528814da79 url: restrict file paths regex to one slash
This restricts the valid path prefixes to prevent false matches caused
by literal dot.

Signed-off-by: Weizhao Ouyang <o451686892@gmail.com>
2025-05-14 23:20:09 +08:00
Jeffrey C. Ollie
ba08b0cce5 gtk custom bell audio: optional -> required 2025-05-13 10:01:54 -05:00
Jeffrey C. Ollie
0e8b266662 Use std.math.clamp
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
2025-05-13 10:01:54 -05:00
Jeffrey C. Ollie
8d0c3c7b7c gtk: implement custom audio for bell 2025-05-13 10:01:54 -05:00
Mitchell Hashimoto
6984b1ec48 input: add backwards compatible alias for plus to + (#7342)
From #7320
Discussion #7340

There isn't a `physical` alias because there is no physical plus key
defined for the W3C keycode spec.
2025-05-12 15:39:39 -07:00
Mitchell Hashimoto
507e808a7c input: add backwards compatible alias for plus to +
From #7320
Discussion #7340

There isn't a `physical` alias because there is no physical plus key
defined for the W3C keycode spec.
2025-05-12 15:32:32 -07:00
Mitchell Hashimoto
7dc65adb1f snap: Build with cpu=baseline as documented in PACKAGING.md (#7341)
Ensures baseline instruction set
2025-05-12 15:07:03 -07:00
Ken VanDine
e2daf04cba snap: Build with cpu=baseline as documented in PACKAGING.md 2025-05-12 17:40:48 -04:00
Mitchell Hashimoto
00829ca2cc macos: do not send UTF-8 PUA codepoints to key events (#7338)
Fixes #7337

AppKit encodes functional keys as PUA codepoints. We don't want to send
that down as valid text encoding for a key event because KKP uses that
in particular to change the encoding with associated text.

I think there may be a more specific solution to this by only doing this
within the KKP encoding part of KeyEncoder but that was filled with edge
cases and I didn't want to risk breaking anything else.
2025-05-12 11:45:04 -07:00
Mitchell Hashimoto
ecda5ec327 macos: do not send UTF-8 PUA codepoints to key events
Fixes #7337

AppKit encodes functional keys as PUA codepoints. We don't want to send
that down as valid text encoding for a key event because KKP uses that
in particular to change the encoding with associated text.

I think there may be a more specific solution to this by only doing this
within the KKP encoding part of KeyEncoder but that was filled with edge
cases and I didn't want to risk breaking anything else.
2025-05-12 11:42:05 -07:00
Mitchell Hashimoto
6723c308be input: bracket right was mapped to left, a typo (#7334)
From #7320
2025-05-12 10:00:17 -07:00
Mitchell Hashimoto
6c6cdf4c4f input: bracket right was mapped to left, a typo 2025-05-12 09:57:10 -07:00
Mitchell Hashimoto
3f54601df0 Use W3C key code specification for keybindings (Breaking Change) (#7320)
Fixes #7315
Fixes #7314 
Fixes #7310 
Fixes #7309

**This PR has breaking changes, noted later.**

This changes our internal key events to match the [W3C key event code
specification](https://www.w3.org/TR/uievents-code/). With these
changes, apprts are expected to produce key codes within that spec and
everything follows from there. This gives us a standard cross-platform
keycode behavior.

Previously, due to our history, we based our key codes on GLFW and Linux
more generally (since Ghostty was on Linux first). This served us
surprisingly well through today, but has been riddled with various
issues (many fixed, but note how many bugs this PR is fixing). From a
user experience perspective, it also caused confusion about how
Ghostty's keybinds interact with keyboard layouts which led to various
complicated features like `physical:` (which is removed in this PR).

## Overview of Changes

* `physical:` is now gone. Physical keys are now specified by the W3C
key codes. Example: `ctrl+KeyA` will always match the "a" key on a US
physical layout (the name `KeyA` lining up with US keyboards is mandated
by the spec, not us). Note when we say "physical" here we mean the
keycode sent by the OS or GUI framework; these can often be overridden
using programs to remap keys at the "hardware" level but software
layouts do not do this.

* All single codepoint characters match the character produced by the
keyboard layout (i.e. are layout-dependent). So `ctrl+c` matches the
physical "c" key on a US standard keyboard with a US layout, but matches
the "i" key on a Dvorak layout. This also works for international
characters. Codepoints are case-insensitive and match via Unicode case
folding (this is how both Windows and macOS treat keyboard shortcuts).

* W3C key names replace all previous non-character names and always
match _physical keys_. For example, `ctrl+grave_accent` (Ghostty 1.1x)
is now `ctrl+backquote` to match the W3C spec. This PR maintains
backwards compatibility so the old values are aliased to the new values.

* W3C key names can be both snake case and match the spec exactly. e.g.
`KeyA` and `key_a` are both valid. This is an aesthetic choice, because
I think the capitalization is really ugly. We have tests to verify this
mapping so its officially supported.

* Because we support W3C keys, we now support significantly more media
keys such as `context_menu`, `browser_home` and so many more. These work
as long as your OS and keyboard can produce the valid key codes.

## Breaking Changes

* Key names have changed, e.g. `grave_accent` is now `backquote`. The
new names are all W3C standard. There are backwards compatible aliases,
so **old configurations will still work.** But the `+list-keybinds` CLI
will always output the new versions.

* `physical:` is gone, all W3C names are always physical and all code
points are always logical. There are backwards compatible aliases for
unambiguous keys, so **most old configurations will still work.** If
there is ambiguity, old configurations will error, but I don't expect
this to be common at all.

* Physical keybinds always take priority over logical keybinds. This was
_inconsistent_ before. Physical keybinds are relatively rare so I don't
think this will impact people but just noting this is not an explicit,
tested, documented behavior.
2025-05-12 09:18:28 -07:00
Mitchell Hashimoto
8f40d1331e ensure ctrl++ parses, clarify case folding docs 2025-05-12 09:08:00 -07:00
Mitchell Hashimoto
0eebebb75e Update iTerm2 colorschemes (#7326)
Upstream revision:
93eb37fadd
2025-05-11 14:45:30 -07:00
Mitchell Hashimoto
c4f1c78fcf macOS: treat C-/ specially again to prevent beep
Fixes #7310
2025-05-11 07:15:46 -07:00
mitchellh
db1608ff16 deps: Update iTerm2 color schemes 2025-05-11 00:14:21 +00:00
Mitchell Hashimoto
ed1194cd75 fix tests 2025-05-10 08:51:08 -07:00
Mitchell Hashimoto
1752edd9eb input: implement case folding for binding matching 2025-05-10 07:22:44 -07:00
Mitchell Hashimoto
ca2ead9647 input: kitty add missing numpad keycodes since we support those now 2025-05-09 11:09:22 -07:00
Mitchell Hashimoto
ebabdb322c input: ignore control characters for backspace/enter/escape special case 2025-05-09 11:05:42 -07:00
Mitchell Hashimoto
a26310e83f macOS: app key is binding check should include utf-8 chars 2025-05-09 10:45:43 -07:00
Mitchell Hashimoto
293a67cd01 input: control-encode right control properly 2025-05-09 10:16:21 -07:00
Mitchell Hashimoto
54bd701ba9 input: bindings should match on single-codepoint utf-8 text too 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
5dc88bda6a macOS: send proper UTF-8 text for more key events 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
d015efc87d clean up bindings so that they match macOS menus 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
5962696c3b input: remove physical_key from the key event (all keys are physical) 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
11a623aa17 docs 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
cc748305fb input: w3c names for keys 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
1e76222f19 update docs 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
7983e0d62c input: backwards compatibility 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
ffdf86374a apprt/gtk: build 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
b991d36343 macOS: build 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
24d433333b apprt/glfw: builds 2025-05-09 10:01:06 -07:00
Mitchell Hashimoto
a3462dd2bd input: remove translated 2025-05-09 10:01:05 -07:00
Mitchell Hashimoto
91d15c89bc input: key enum is now aligned with W3C keyboard codes 2025-05-09 10:01:05 -07:00
Mitchell Hashimoto
7f9bb3c0e5 update PACKAGING.md to be explicit about source vs. git (#7317)
Related to #7316

I'm not going to close the issue yet because I want to also update the
website, but this should help clarify things more. I noticed the README
already makes a distinction, thankfully.
2025-05-09 08:54:02 -07:00
Mitchell Hashimoto
201ea050bd update PACKAGING.md to be explicit about source vs. git
Related to #7316
2025-05-09 08:27:15 -07:00
Bryan Lee
800054874e macOS: switch to using URL instead of String 2025-05-09 10:52:18 +08:00
Bryan Lee
3043012c1b macOS: simplify path handling in openTerminal 2025-05-08 08:34:02 +08:00
Bryan Lee
a8b450f03d macOS: use file parent dir for openTerminal service cwd (#7286) 2025-05-08 08:34:02 +08:00
Mitchell Hashimoto
bcff488095 core: add context menu key (#5162)
I have this key on a cheap Lenovo keyboard at work and would like to put
it to some use.
2025-05-07 13:25:18 -07:00
Jeffrey C. Ollie
9c70f8aee1 core: add context menu key 2025-05-07 13:08:38 -07:00
Jeffrey C. Ollie
73ec7e5f10 docs: fix minor grammatical error (#7295)
Fixes a small grammatical error in the config docs.
2025-05-07 14:18:50 -05:00
tangowithfoxtrot
69a744b521 docs: fix minor grammatical error 2025-05-07 11:46:36 -07:00
Jeffrey C. Ollie
0ed4b5d9c6 gtk: only allow one config error dialog at a time (#7293)
This fixes a problem introduced by #7241 that would cause multiple error
dialogs to be shown.
2025-05-07 13:36:17 -05:00
Mitchell Hashimoto
c36314ca98 Allow struct/union/enum binding types to have default values (#7291)
This allows for `keybind = super+d=new_split` to now work (defaults to
"auto"). This will also let us convert void types to union/enum/struct
types in the future without breaking existing bindings.
2025-05-07 09:50:44 -07:00
Jeffrey C. Ollie
5d81a31a49 gtk: remove dead code 2025-05-07 11:12:07 -05:00
Jeffrey C. Ollie
00a2d54420 gtk: only allow one config error dialog at a time
This fixes a problem introduced by #7241 that would cause multiple error
dialogs to be shown.
2025-05-07 10:46:46 -05:00
Mitchell Hashimoto
362c5cb05f Allow struct/union/enum binding types to have default values
This allows for `keybind = super+d=new_split` to now work (defaults to
"auto"). This will also let us convert void types to union/enum/struct
types in the future without breaking existing bindings.
2025-05-07 08:18:28 -07:00
Mitchell Hashimoto
f6bb1f5e34 core: fixup callconv(.C) -> callconv(.c) (#7289)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
2025-05-07 08:08:51 -07:00
Jeffrey C. Ollie
e8c845b758 core: fixup callconv(.C) -> callconv(.c)
https://ziglang.org/download/0.14.0/release-notes.html#Calling-Convention-Enhancements-and-setAlignStack-Replaced
2025-05-07 08:41:09 -05:00
Mitchell Hashimoto
35c9d32e69 Add "Scroll to Selection" command (#7265)
This is mostly intended for implementing the "Jump to Selection"
(<kbd>⌘</kbd> <kbd>J</kbd>) command on macOS (but as per the TODO, the
pin still needs to be centered)

Demo: (Selected text is "10")

<table><tr>
<td><img width="965" alt="Screenshot 2025-05-03 at 9 21 55 AM"
src="https://github.com/user-attachments/assets/c37ba0b7-f622-48d2-b598-4151e85377ef"
/></td>
<td><img width="965" alt="Screenshot 2025-05-03 at 9 21 58 AM"
src="https://github.com/user-attachments/assets/650f44f9-3125-4a2a-b264-a6e8476e4fcb"
/></td>
</tr></table>
2025-05-06 16:44:21 -07:00
fn ⌃ ⌥
071531c5c5 Add "Scroll to Selection" command 2025-05-06 16:26:22 -07:00
Mitchell Hashimoto
eb7368699b macOS: move window title handling fully to AppKit, fix command palette losing title (#7283)
Fixes #7236
Supersedes #7249

This removes all of our `focusedValue`-based tracking of the surface
title and moves it completely to the window controller. The window
controller now sets up event listeners (via Combine) when the focused
surface changes and updates the window title accordingly.

There is some complicated logic here to handle when we lose focus to
something other than a surface. In this case, we want our title to be
the last focused surface so long as it exists.

The prior `focusedValue`-based code was a relic of when Ghostty was a
full SwiftUI app. Now that we have AppKit in the mix (and have for a
couple years), we shouldn't bolt on fixes to that cruft if we can help
it.
2025-05-06 15:13:04 -07:00
Mitchell Hashimoto
2caa8a3fe1 macOS: move window title handling fully to AppKit
Fixes #7236
Supersedes #7249

This removes all of our `focusedValue`-based tracking of the surface
title and moves it completely to the window controller. The window
controller now sets up event listeners (via Combine) when the focused
surface changes and updates the window title accordingly.

There is some complicated logic here to handle when we lose focus to
something other than a surface. In this case, we want our title to be
the last focused surface so long as it exists.
2025-05-06 14:57:19 -07:00
Jeffrey C. Ollie
27cdd6d79c gtk: require blueprint-compiler 0.16 for building (#6827)
Changes:

1. Require `blueprint-compiler` 0.16.0 (or newer) for building from a
git checkout. With #6822 distributions that can't meet that requirement
can use generated source tarballs to build.
2. Remove all `.ui` files as they are unnecessary.
3. Simplify the `Builder` interface since raw `.ui` files are no longer
used.
4. Removed build-time check of raw `.ui` files.
2025-05-06 16:06:53 -05:00
Mitchell Hashimoto
5f8a0dc4a0 termio, flatpak: support spawning terminals in cwd (#6915)
Implements path access testing for Flatpak via test spawning. This is
required since Flatpak reserves certain paths from being accessible
regardless of permissions.

Opened mostly as an RFC, this approach seems to work without any
noticeable performance impact.

Ref:
https://docs.flatpak.org/en/latest/sandbox-permissions.html#reserved-paths
2025-05-06 13:59:48 -07:00
Mitchell Hashimoto
732500b418 feat: implement toggleMaximize for macOS (#7191)
Resolve #7030
2025-05-06 13:43:57 -07:00
Leorize
b6f120a749 termio, flatpak: support spawning terminals in cwd
Implements path access testing for Flatpak via test spawning. This is
required since Flatpak reserves certain paths from being accessible
regardless of permissions.

Ref: https://docs.flatpak.org/en/latest/sandbox-permissions.html#reserved-paths
2025-05-06 13:42:14 -07:00
Mitchell Hashimoto
e5765dfa79 macOS: save/restore firstResponder on non-native fullscreen (#7279)
Fixes #6999
Supersedes #7201 

It appears that at some point one of the operations causes focus to move
away for non-native fullscreen. We previously relied on the delegate
method to restore this but a better approach appears to handle this
directly in the fullscreen implementations. This fixes the linked issue.

I still think long term all the `Ghostty.moveFocus` stuff is a code
smell and we should be auditing all that code to see if we can eliminate
it. But this is a step in the right direction, and removes one of those
uses.
2025-05-06 13:32:33 -07:00
Mitchell Hashimoto
e2a0f439c6 macOS: save/restore firstResponder on non-native fullscreen
Fixes #6999

It appears that at some point one of the operations causes focus to move
away for non-native fullscreen. We previously relied on the delegate
method to restore this but a better approach appears to handle this
directly in the fullscreen implementations. This fixes the linked issue.

I still think long term all the `Ghostty.moveFocus` stuff is a code
smell and we should be auditing all that code to see if we can
eliminate it. But this is a step in the right direction, and removes one
of those uses.
2025-05-06 12:59:31 -07:00
Mitchell Hashimoto
d0a8cb671b macOS: handle scenario cgWindowId is nil (#7277)
Fixes #7114
Supercedes #7271

This fixes a crash that could occur with non-native fullscreen and
`fullscreen = true` set at once.

The "windowNumber" can be `<= 0` if the window "doesn't have a window
device." I don't fully know all the scenarios this is true but it is
true when the window is not visible, at least.
2025-05-06 10:50:14 -07:00
Mitchell Hashimoto
9b78917246 macOS: handle scenario cgWindowId is nil
Fixes #7114
Supercedes #7271

This fixes a crash that could occur with non-native fullscreen and
`fullscreen = true` set at once.

The "windowNumber" can be `<= 0` if the window "doesn't have a
window device." I don't fully know all the scenarios this is true but it
is true when the window is not visible, at least.
2025-05-06 10:33:56 -07:00
Mitchell Hashimoto
a4bd6efcbf ci: add flatpak JSON for iterm2 theme updates (#7275)
I forgot to add the path in the GitHub action.
2025-05-06 09:51:08 -07:00
Mitchell Hashimoto
9221d392de ci: add flatpak JSON for iterm2 theme updates
I forgot to add the path in the GitHub action.
2025-05-06 07:20:56 -07:00
Mitchell Hashimoto
3c405a591a update flatpak cache 2025-05-06 07:19:40 -07:00
Mitchell Hashimoto
702c3f58d9 font/freetype: introduce mutexes to ensure thread safety of Library and Face (#7238)
tl;dr: FT_New_Face and FT_Done_Face require the Library to be locked for
thread safety, and FT_Load_Glyph and FT_Render_Glyph and friends need
the face to be locked for thread safety, since we're sharing faces
across threads.

For details see comments and FreeType docs @
-
https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library
-
https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_face

---

This might resolve the issue discussed in #7016 but I wasn't able to
reliably reproduce it in a way I could debug, so someone who was
experiencing it should probably test this PR.

Additionally I can still semi-reliably produce a crash with the GTK
apprt by setting an `all:` keybind to adjust font sizes and changing the
font size rapidly with many surfaces open with emojis on them.
Unfortunately I can't really tell what the root cause is because the
debug info is broken in QEMU.

However, I do think this is a good idea for us to be thread safe with
this stuff even if it isn't related to that problem.
2025-05-06 07:18:11 -07:00
Mitchell Hashimoto
f73f7c805d Fix removed GDK_DEBUG gl-no-fractional (#7233)
`gl-no-fractional` is removed from GTK v4.17.5
2025-05-06 07:17:28 -07:00
Mitchell Hashimoto
050e40a29d Implement dark/light theme filtering in theme preview (#7248)
This pr closes https://github.com/ghostty-org/ghostty/issues/7235

Demo:


https://github.com/user-attachments/assets/88366ac7-fcdb-49e9-bed7-8deb0eebeb9e
2025-05-06 07:16:46 -07:00
Mitchell Hashimoto
7ce828253a bash: explicitly request a login shell (#7253)
Prior to #7044, on macOS, our shell integrated command line would be
executed under `exec -l`, which caused bash to be started as a login
shell. Now that we're using direct command execution, add `--login` to
our bash command's arguments on macOS to get that same behavior.
2025-05-06 07:16:09 -07:00
Mitchell Hashimoto
e2b5bfb5b0 gtk: fix comment about adwaita version (#7274) 2025-05-06 07:04:32 -07:00
Mitchell Hashimoto
f13d74bcf0 improvements to the Issue Triage Discussion template (#7266)
After some time with the initial template and Discussions being created,
there are some improvements we should make to the Issue Triage template.

Most of these changes were discussed in #7012 and among helpers in the
Discord.

~~I've marked this as a Draft for now as I work with the helpers to
confirm how we want to approach a few of the outstanding changes, mostly
minor updates.~~

As always, you can test these out by [opening an Issue Triage Discussion
post on my
fork](https://github.com/taylrfnt/ghostty/discussions/new?category=issue-triage).
2025-05-06 06:57:36 -07:00
Mitchell Hashimoto
b346f06a51 Update iTerm2 colorschemes (#7268)
Upstream revision:
1e4957e650
2025-05-06 06:56:49 -07:00
Jeffrey C. Ollie
1bf686d324 gtk: fix comment about adwaita version 2025-05-06 08:44:52 -05:00
taylrfnt
ac11ebbb4a update applied label to proper name
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 21:37:49 -05:00
taylrfnt
ad0d426bba consistent spacing with tip & important highlights
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 21:36:38 -05:00
taylrfnt
d0b9242f49 replace dashes with code block backticks for additional config
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 21:34:33 -05:00
taylrfnt
f9c1b6b7cf fixup markdown in additional config field
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 19:28:31 -05:00
taylrfnt
ad16f984cf remove smart quotes in favor of ascii
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 19:27:08 -05:00
taylrfnt
f84367880b Properly enclose code block backticks
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-05 19:23:40 -05:00
Jon Parise
37974dba06 bash: explicitly request a login shell
Prior to #7044, on macOS, our shell integrated command line would be
executed under `exec -l`, which caused bash to be started as a login
shell. Now that we're using direct command execution, add `--login` to
our bash command's arguments on macOS to get that same behavior.
2025-05-05 10:26:37 -04:00
taylrfnt
11db0ed8ae re-apply formatting & overwrite, not append 2025-05-04 12:17:29 -05:00
taylrfnt
8dfa6beb15 add acknowledgement for previewing format before submitting
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-04 12:04:09 -05:00
taylrfnt
431116c9d8 do not ask users for a summary 2025-05-04 12:01:22 -05:00
taylrfnt
46d3de26fc remove renderers prone to jailbreak 2025-05-04 11:59:57 -05:00
taylrfnt
233ef4f782 more updates to expected behavior placeholder
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-04 11:58:50 -05:00
taylrfnt
050375cbb6 make minimum configuration more explicit
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-03 21:56:08 -05:00
taylrfnt
cc95475ae9 update placeholder text
remove the 'example:' prefixes and make them sound less like it's AI-generated
2025-05-03 21:48:59 -05:00
taylrfnt
1f9a4e6794 more direct naming of minimal configuration
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-03 21:38:19 -05:00
taylrfnt
0bf168c834 terminal inspector no longer proper noun 2025-05-03 21:38:19 -05:00
taylrfnt
6ffb6207e7 split out expected & actual behavior fields 2025-05-03 21:38:19 -05:00
taylrfnt
9c2f8d8ad3 cleanup the input issue hint
Co-authored-by: trag1c <dev@jakubr.me>
2025-05-03 21:38:19 -05:00
taylrfnt
51b6925322 add Linux log hint 2025-05-03 21:38:19 -05:00
taylrfnt
41e3c8830f change VT to terminal emulation
Co-authored-by: Leah Amelia Chen <hi@pluie.me>
2025-05-03 21:37:50 -05:00
taylrfnt
71f52fd198 re-order ghostty logs field 2025-05-03 20:53:00 -05:00
taylrfnt
4d27fc18eb use log stream command instead of link to discussion
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-05-03 20:50:04 -05:00
mitchellh
abf5f18598 deps: Update iTerm2 color schemes 2025-05-04 00:14:51 +00:00
Mitchell Hashimoto
b6f338065e ci: workaround broken lxd start with snap builder (#7267)
https://discourse.ubuntu.com/t/lxd-doesn-t-start-snap-lxd-device-directory-nonexistent/59785
https://github.com/canonical/lxd-pkg-snap/pull/789

This is required until Namespace or further upstream fixes are made.
2025-05-03 15:05:33 -07:00
Mitchell Hashimoto
e174599533 ci: workaround broken lxd start with snap builder
https://discourse.ubuntu.com/t/lxd-doesn-t-start-snap-lxd-device-directory-nonexistent/59785
https://github.com/canonical/lxd-pkg-snap/pull/789

This is required until Namespace or further upstream fixes are made.
2025-05-03 13:20:00 -07:00
taylrfnt
60e1a73c04 update log textarea render to display inputs in codeblock 2025-05-03 14:45:53 -05:00
taylrfnt
10dcf1dfe9 fix most of the feedback from 7012 2025-05-03 14:40:34 -05:00
Mitchell Hashimoto
040cdba707 flatpak: update GNOME runtime to 48 (#7261)
Notable dependencies updates:

- GTK 4.16.13 -> 4.18.4
- Libadwaita 1.6.6 -> 1.7.2
2025-05-03 06:57:33 -07:00
Leorize
c0f41aba45 flatpak: update GNOME runtime to 48
Notable dependencies updates:

- GTK 4.16.13 -> 4.18.4
- Libadwaita 1.6.6 -> 1.7.2
2025-05-02 14:24:02 -05:00
Mitchell Hashimoto
464b85b64c codeowners: correct shell_integration.zig filename (#7255) 2025-05-02 08:25:27 -07:00
Jon Parise
b2138eeaf0 codeowners: correct shell_integration.zig filename 2025-05-02 10:59:52 -04:00
Qwerasd
5319d38366 fix(tests): correctly deinit font faces 2025-05-01 18:37:47 -06:00
Qwerasd
cfedd477b2 font/freetype: introduce mutexes to ensure thread safety of Library and Face
For details see comments and FreeType docs @
https://freetype.org/freetype2/docs/reference/ft2-library_setup.html#ft_library
https://freetype.org/freetype2/docs/reference/ft2-face_creation.html#ft_face

tl;dr: FT_New_Face and FT_Done_Face require the Library to be locked for
thread safety, and FT_Load_Glyph and FT_Render_Glyph and friends need
the face to be locked for thread safety, since we're sharing faces
across threads.
2025-05-01 18:22:37 -06:00
Maciej Bartczak
418c46538c use enum for the color scheme args 2025-05-01 19:41:02 +02:00
Maciej Bartczak
0b5160e9f0 implement dark/light theme filtering in theme preview 2025-05-01 19:02:34 +02:00
Mitchell Hashimoto
e79bf71f23 Binding for toggling window float on top (macOS only) (#7246)
This adds a keybinding and apprt action for #7237.
2025-05-01 09:51:09 -07:00
Mitchell Hashimoto
6e11d947e7 Binding for toggling window float on top (macOS only)
This adds a keybinding and apprt action for #7237.
2025-05-01 09:47:17 -07:00
Mitchell Hashimoto
a6fd499019 macos: add float on top feature for terminal windows (#7237)
Closes #5188

**See:** 

-
https://github.com/ghostty-org/ghostty/discussions/5188#discussioncomment-12607781
-
https://github.com/ghostty-org/ghostty/discussions/5188#discussioncomment-12984898
2025-05-01 09:24:15 -07:00
Martin Hettiger
f83729ba48 macos: add float on top feature for terminal windows 2025-05-01 09:13:33 -07:00
Mitchell Hashimoto
4b3a49a56e apprt/gtk: ensure configuration is loaded on startup (#7241)
Restores the app configuration code removed in
https://github.com/ghostty-org/ghostty/pull/6792.

The was unnoticed due to `colorSchemeEvent` triggering a configuration
reload if `window-theme` deviates from the default (i.e. dark mode is
used).

Fixes https://github.com/ghostty-org/ghostty/discussions/7206
2025-05-01 08:30:22 -07:00
Leorize
0af5a291ac apprt/gtk: ensure configuration is loaded on startup
Restores the app configuration code removed in
https://github.com/ghostty-org/ghostty/pull/6792.

The was unnoticed due to `colorSchemeEvent` triggering a
configuration reload if `window-theme` deviates from the default
(i.e. dark mode is used).

Fixes https://github.com/ghostty-org/ghostty/discussions/7206
2025-05-01 01:59:36 -05:00
Leah Amelia Chen
2b4f1f8b84 Improve the documentation for gtk-custom-css (#7190)
Recently when answering [a Discussion], I was reminded of when Tristan
once linked the GTK CSS documentation and said “Perhaps good to add this
to the docs of the GTK custom CSS config option”, so I decided to do
that now. I also added a few random things that I found helpful when
attempting to modify Ghostty's CSS; this information was mostly stolen
from random people on Discord or accidentally discovered.

I really do not care if this is merged or not, nor do I care if the
strings are changed considerably[^1], so I am going straight for a Pull
Request without bothering to open a Discussion, get that converted to an
Issue after a few years, then finally remember to open a Pull Request.

I only tested what this looks like in `ghostty +show-config --default
--docs`, the manpage and the HTML output; I notably did not try seeing
how it renders on the website. The links have to be in angle brackets
for the HTML output to have it rendered as URLs, but it looks odd
everywhere else; manpages have them with mathematical angle brackets,
⟨like this⟩. I also refrained from using an em (—) or en (–) dash
instead of a normal dash (-) as that does not seem to be common in the
rest of the documentation.

[a Discussion]: https://github.com/ghostty-org/ghostty/discussions/7189

[^1]: I didn't see any guidelines or standards for these strings, so
presumably these would be contested as I didn't know what to adhere to
when writing them.
2025-04-30 22:33:11 +02:00
Morgan
6f4fe56b93 Add comment about gl-no-fractional 2025-04-30 23:50:11 +09:00
Mitchell Hashimoto
ff536e34d6 i18n: fixed the translation for Russian (#7218)
The problem was highlighted in
https://github.com/ghostty-org/ghostty/pull/7127#discussion_r2051223171

In Russian, the words
[`затем`](https://ru.wiktionary.org/wiki/%D0%B7%D0%B0%D1%82%D0%B5%D0%BC)
and [`либо`](https://ru.wiktionary.org/wiki/%D0%BB%D0%B8%D0%B1%D0%BE)
are written separately.

@zeshi09 @TicClick take a look?
2025-04-30 07:02:21 -07:00
Morgan
5291292047 Add runtimeUntil, fix remove GDK_DEBUG gl-no-fractional 2025-04-30 15:58:21 +09:00
Tim Culverhouse
b3edc88010 terminal(dcs): convert all xtgettcap queries to upper (#7230)
XTGETTCAP queries are a semicolon-delimited list of hex encoded terminfo
capability names. Ghostty encodes a map using upper case hex encodings,
meaning when an application uses a lower case encoding the capability is
not found. To fix, we convert the entire list we receive in the query to
upper case prior to processing further.

Fixes: #7229
2025-04-29 19:06:25 -05:00
Tim Culverhouse
2c1ade763f terminal(dcs): convert all xtgettcap queries to upper
XTGETTCAP queries are a semicolon-delimited list of hex encoded terminfo
capability names. Ghostty encodes a map using upper case hex encodings,
meaning when an application uses a lower case encoding the capability is
not found. To fix, we convert the entire list we receive in the query to
upper case prior to processing further.

Fixes: #7229
2025-04-29 18:42:16 -05:00
Mitchell Hashimoto
533354480a ci: drop l10n review workflow (#7228)
*better things are coming*
2025-04-29 14:13:33 -07:00
trag1c
87107a7934 ci: drop l10n review workflow 2025-04-29 18:32:59 +02:00
Kat
4e39756501 Link to GTK CSS docs and add some useful tips to gtk-custom-css' docs.
It may not be immediately obvious how to style Ghostty despite knowing
of the existence of that configuration option; one who is more
accustomed to web development would likely be very reliant on their
browser's inspector for modifying and debugging the style of their
application. GTK CSS also differs in some important ways from the CSS
found in browsers, and hence linking to the GTK CSS documentation would
save time for anyone new to styling GTK applications.
2025-04-29 22:56:23 +10:00
Mitchell Hashimoto
9a4419ce85 macos: key input that clears preedit without text shouldn't encode (#7226)
Fixes #7225
2025-04-28 14:58:19 -07:00
Mitchell Hashimoto
e5e89bcbe4 macos: key input that clears preedit without text shouldn't encode
Fixes #7225
2025-04-28 14:01:17 -07:00
Aaron Ruan
13f776d483 Rename maximize notification and refine handler 2025-04-28 10:20:29 +08:00
Danil Ovchinnikov
42913c7830 i18n: fixed the translation for Russian
Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-28 04:08:04 +03:00
Mitchell Hashimoto
7daabdddef ci: iTerm2 colorscheme update should update flatpak deps (#7214) 2025-04-27 07:50:18 -07:00
Mitchell Hashimoto
99db6b59be Add config color palette C bindings (#7195)
C bindings to expose the color palette to Swift for macOS. Returns the
full 256 colors from the current color scheme. After fetching the
palette with `ghostty_config_get`, you can access the desired color by
its index in the list.

### Usage

Here is one way to get the palette in Swift.

```swift
import GhosttyKit

private(set) var config: ghostty_config_t? = nil {
    didSet {
        // Free the old value whenever we change
        guard let old = oldValue else { return }
        ghostty_config_free(old)
    }
}

var paletteColors: [Color] {
    var paletteList: ghostty_config_palette_s = .init()
    let key = "palette"
    
    if (!ghostty_config_get(config, &paletteList, key, UInt(key.count))) {
        return []
    }
    
    var colors: [Color] = []
    let mirror = Mirror(reflecting: paletteList.colors)
    
    for (_, element) in mirror.children {
        if let color = element as? ghostty_config_color_s {
            colors.append(Color(
                red: Double(color.r) / 255,
                green: Double(color.g) / 255,
                blue: Double(color.b) / 255
            ))
        }
    }
    
    print("Palette Colors: ", colors)
    return colors
}
```
Result (GruvboxDarkHard theme)
![CleanShot 2025-04-25 at 14 21
39](https://github.com/user-attachments/assets/a282fd8d-3e5e-4281-819c-dff00b84318f)
2025-04-27 07:14:26 -07:00
Mitchell Hashimoto
f0339d5e5b ci: iTerm2 colorscheme update should update flatpak deps 2025-04-27 07:01:52 -07:00
Mitchell Hashimoto
c7b8fd1354 flatpak: update dependencies 2025-04-27 07:00:24 -07:00
Mitchell Hashimoto
17441de37f Update iTerm2 colorschemes (#7210)
Upstream revision:
5233095e44
2025-04-27 06:53:06 -07:00
Mitchell Hashimoto
d4acdf44a9 z2d 0.6.0 -> 0.6.1 for security fix (#7211)
version 0.6.0 of z2d has a security vulnerability and the author
suggests upgrading (randomly saw this in the zig discord)

https://github.com/vancluever/z2d/security/advisories/GHSA-mm4c-p35v-7hx3

I don't know enough about how ghostty uses to it to say if it could be
affected

also updates that Context no longer returns an error type this says it
was in the 0.6.0 changes which ghostty was already pinned to (it seems
like that the tag might have been updated or something im not sure) you
can see it listed as a change in 0.6.0 below
https://github.com/vancluever/z2d/blob/main/CHANGELOG.md

I'm not sure if any other changes are required I ran a `zig build` and
`zig build test` and things seem to be fine on my end

~~I'm not sure I updated the zon nix stuff correctly I just ran the
command in jcollie readme
`nix run github:jcollie/zon2nix#zon2nix -- --nix=build.zig.zon.nix
build.zig.zon`~~ looks like I should have just ran the script

ps: sorry for the direct ping mitchell (I thought this might be
important that you look at it)
2025-04-27 06:51:23 -07:00
rhodes-b
ba5c773f0f update flatpak packages 2025-04-27 00:05:10 -05:00
rhodes-b
b1561112d0 run the nix cache script 2025-04-27 00:03:00 -05:00
rhodes-b
bbbe81efc5 z2d context no longer has err return 2025-04-26 23:51:04 -05:00
rhodes-b
0c8339d2da update z2d to 0.6.1 2025-04-26 23:39:02 -05:00
Aaron Ruan
1ec3e331de Refactor toggleMaximize to use notifications 2025-04-27 08:48:06 +08:00
mitchellh
12f48419b6 deps: Update iTerm2 color schemes 2025-04-27 00:14:50 +00:00
Mitchell Hashimoto
38445dca2a feat: beautify macOS command palette (#7179)
Resolve 1. of #7173
<img width="1126" alt="image"
src="https://github.com/user-attachments/assets/8904b09f-42f6-4f26-a722-c92dad8e2933"
/>

Changes made:
1. Change shortcut from `String` to `[String]` so its easier to iterate
over it.
2. Overlay background color on top of an `ultraThinMaterial` for better
aesthetic.
3. Reorganize and beautify the spacings and paddings.
4. Unhide the scrollbar.
5. Reorder the modifier keys to Control, Option, Shift and then Command.
<https://leancrew.com/all-this/2017/11/modifier-key-order/>
6. Style shortcut keys to resemble macOS menu bar items, using
corresponding symbols and fixed-width for alignment.
2025-04-25 12:01:01 -07:00
Mitchell Hashimoto
2b4d89e11f macOS: scheme doesn't need to be state 2025-04-25 11:42:12 -07:00
Friedrich Stoltzfus
77f5fc34f1 Add config color palette C bindings
C bindings to expose the color palette to Swift for macOS.
2025-04-25 14:10:35 -04:00
Aaron Ruan
334093a9ea feat: implement toggleMaximize for macOS 2025-04-25 15:59:44 +08:00
Aaron Ruan
1acb1715c3 replace NSVisualEffectView with ultraThinMaterial plus a background color 2025-04-25 10:42:22 +08:00
Aaron Ruan
3827ce9e4c feat: beautify command palette 2025-04-24 12:46:38 +08:00
Mitchell Hashimoto
4e91d11a60 macOS: add descriptions for PgUp, PgDown, End, and Home keys (#7177)
Resolves #7174. The PgUp, PgDown, End, and Home keys were not being
assigned a description in the `KeyboardShortcut` extension.
2025-04-23 13:32:51 -07:00
Friedrich Stoltzfus
f58fba54a0 macOS: add descriptions for PgUp, PgDown, End, and Home keys
These keys were not being assigned a description in the KeyboardShortcut
extension. This caused problems for the macOS command pallete.
2025-04-23 16:05:51 -04:00
Mitchell Hashimoto
afd8d10b82 macOS: Command palette has no selection by default, selection wraps (#7175)
#7173

(1) The command palette no longer has any selection by default. If and
when we introduce most recently used commands, defaulting to that would
make sense. A selection only appears when the arrow keys are used or the
user starts typing.

(2) The selection with arrow keys now wraps, so if you press "down" on
the last option, it will wrap to the first option, and if you press "up"
on the first option, it will wrap to the last option. This matches both
VSCode and Zed.
2025-04-23 10:50:13 -07:00
Mitchell Hashimoto
9bfe4544bf macOS: Command palette has no selection by default, selection wraps
#7173

(1) The command palette no longer has any selection by default.
If and when we introduce most recently used commands, defaulting to that
would make sense. A selection only appears when the arrow keys are used
or the user starts typing.

(2) The selection with arrow keys now wraps, so if you press "down" on
the last option, it will wrap to the first option, and if you press "up"
on the first option, it will wrap to the last option. This matches both
VSCode and Zed.
2025-04-23 10:37:20 -07:00
Mitchell Hashimoto
f2c798d319 macOS: Command Pallete Improvements (#7171)
As discussed in #7165, this PR resolves two issues with the command
pallete on macOS.
1. The flashing of a command passing out of view was caused by the
`withAnimation` function. Removing this closure resolved this issue.
2. The current implementation kept the selected command anchored to the
middle of the pallete. However, most command pallates allow you to key
through the visible options, only scrolling when your selection hits the
boundary. I resolved this by removing the `anchor: .center` parameter
for the `scrollTo` command.
2025-04-23 08:35:33 -07:00
Jeffrey C. Ollie
75cc4b29fd gtk: require blueprint-compiler 0.16 for building
Changes:

1. Require `blueprint-compiler` 0.16.0 (or newer) for building from
   a git checkout. With #6822 distributions that can't meet that
   requirement can use generated source tarballs to build.
2. Remove all `.ui` files as they are unnecessary.
3. Simplify the `Builder` interface since raw `.ui` files are no
   longer used.
4. Removed build-time check of raw `.ui` files.
2025-04-23 10:35:10 -05:00
Mitchell Hashimoto
ba6ed1f3c5 snap: build from source tarball (#6831)
Eliminates the need for `blueprint-compiler`, which isn't quite new
enough on the snap builder.
2025-04-23 06:58:14 -07:00
Jeffrey C. Ollie
6bd9e35cd6 snap: build from source tarball 2025-04-23 08:10:01 -05:00
Friedrich Stoltzfus
b4b2b10328 macOS: command pallete scroll improvements
Removes the withAnimation closure which caused flashing when scrolling
up or down with arrow keys. Also removes the center anchor to behave
more like other command palletes (e.g., Zed, Raycast).
2025-04-22 16:12:09 -04:00
Mitchell Hashimoto
f5b5a36835 Fix flatpak packaging to a working state (#6678)
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
2025-04-22 12:19:55 -07:00
Mitchell Hashimoto
e6c2105a2b ci: fix up flatpak deps 2025-04-22 12:02:24 -07:00
Mitchell Hashimoto
946cf5a375 update flatpak build hash 2025-04-22 10:57:17 -07:00
Mitchell Hashimoto
d7256c71c4 ci: flatpak 2025-04-22 10:56:10 -07:00
Mitchell Hashimoto
3e81006eaa prettier 2025-04-22 10:56:09 -07:00
Leorize
7c1e68293e flatpak: use archive for gtk4-layer-shell 2025-04-22 10:56:09 -07:00
Leorize
0473b0c3f4 metainfo: update with extra data
* Added URLs to more resources
* Fixed developer ID
* Added device compatibility information
2025-04-22 10:56:09 -07:00
Leorize
9de1aadbab flatpak: add development variant
This variant is built in Debug mode and is given a different desktop
file so it could be installed side-by-side with regular Ghostty.
2025-04-22 10:56:09 -07:00
Leorize
3232cfe138 flatpak: keep debug info for ghostty itself
Flatpak will strip them out on its own into an extension package, useful
for debugging
2025-04-22 10:56:09 -07:00
Leorize
ebc169dbaf Fix flatpak packaging to a working state
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
2025-04-22 10:56:09 -07:00
Mitchell Hashimoto
17b0bf585d apprt/gtk: add menu to new tab button to create splits (#7137)
Closes: https://github.com/ghostty-org/ghostty/discussions/6828
2025-04-22 09:07:10 -07:00
Mitchell Hashimoto
f36729de39 mark new strings as untranslated 2025-04-22 08:57:29 -07:00
Mitchell Hashimoto
ba67c506f2 ci: extract translation check to script so we can run standalone 2025-04-22 08:55:03 -07:00
Mitchell Hashimoto
74e1c47623 macOS: Command Palette (#7153)
This introduces a command palette (inspired by @pluiedev's work in
#5681, but not using it as a base) for macOS.

The command palette is available in the `View` menu and also bindable
via `toggle_command_palette`, default binding is `cmd+shift+p` to match
VSCode.

The commands in the command palette must map to a _bindable_ action,
though they may not have an associated keybinding. This means that any
new binding actions we add in the future can be represented here and
also makes it easy in the future to add configuration to add new custom
entries to the command palette. For this initial PR, the available
commands are hardcoded (`src/input/commands.zig`).

I've noticed in other programs (VSCode, Zed), the command palette
contains pretty much _all available actions_ even if they're basically
useless in the context of a command palette. For example, Zed has the
"toggle command palette" action in the command palette and it... does
nothing (it probably should hide the palette). I followed @pluiedev's
lead and made this subjective in this PR but I wonder if we should
actually force all binding actions to be available.

There are various other improvements I'd like to make but omitted from
this PR for the sake of limiting scope:

* Instead of an entry with no matches doing nothing, we can allow users
to manually input _any_ configurable binding.
* Localization, since macOS doesn't have any yet. But for Linux when we
port this we probably have to change our strings extraction.

## Demo


https://github.com/user-attachments/assets/a2155cfb-d86b-4c1a-82b5-74ba927e4d69
2025-04-22 08:52:27 -07:00
Mitchell Hashimoto
ce987ba56d macOS: Add dock badge notification for bell events (#7118)
Resolves #7108

This PR adds visual notification badges to the Ghostty dock icon when
bell events are triggered while the application is in the background.
This complements the existing dock bounce notification, making it easier
for users to notice when a terminal needs attention.


https://github.com/user-attachments/assets/b54c881f-fea8-4085-8614-432d9e5847b9
2025-04-22 08:39:49 -07:00
Mitchell Hashimoto
5427b0b507 macOS: add description as hover tooltip 2025-04-22 08:36:17 -07:00
Mitchell Hashimoto
3e5fe5de9a move command filtering into apprt 2025-04-22 08:33:32 -07:00
Mitchell Hashimoto
28404e946b order commands alphabetically and preserve capitalization 2025-04-21 17:13:12 -07:00
Mitchell Hashimoto
7ef9c24e3f renderer/opengl: reduce flickering/stretching on resize (#7155)
Fixes #2446
Supersedes #7144

Two separate issues:

1. Ensure that our screen size matches the viewport size when drawFrame
is called. By the time drawFrame is called, GTK will have updated the
OpenGL context, but our deferred screen size may still be incorrect
since we wait for the pty to update the screen size.

2. Do not clear our cells buffer when the screen size changes, instead
changing to a mechanism that only clears the buffers when we have over
50% wasted space.

/cc @adlr I added you as a coauthor.
2025-04-21 14:39:48 -07:00
Mitchell Hashimoto
e5e9d43d52 renderer/opengl: reduce flickering/stretching on resize
Fixes #2446

Two separate issues:

  1. Ensure that our screen size matches the viewport size when
     drawFrame is called. By the time drawFrame is called, GTK will have
     updated the OpenGL context, but our deferred screen size may still
     be incorrect since we wait for the pty to update the screen size.

  2. Do not clear our cells buffer when the screen size changes, instead
     changing to a mechanism that only clears the buffers when we have
     over 50% wasted space.

Co-authored-by: Andrew de los Reyes <adlr@rivosinc.com>
2025-04-21 14:02:55 -07:00
Tristan Partin
1c62ddffc4 apprt/gtk: add menu to new tab button to create splits
Closes: https://github.com/ghostty-org/ghostty/discussions/6828
Signed-off-by: Tristan Partin <tristan@partin.io>
2025-04-21 13:01:37 -05:00
Mitchell Hashimoto
a732bb272d fix CI 2025-04-21 10:54:23 -07:00
Mitchell Hashimoto
e33eed0216 macOS: command palette visual tweaks 2025-04-21 10:40:30 -07:00
Leah Amelia Chen
3e9b5d491c apprt/gtk: fix typo (#7152) 2025-04-22 01:30:49 +08:00
Mitchell Hashimoto
baad082438 macOS: command palette selection tweaks 2025-04-21 10:26:29 -07:00
Mitchell Hashimoto
6dad763e69 input: omit commands that are platform-specific 2025-04-21 10:20:32 -07:00
Mitchell Hashimoto
63b4cb4ead macOS: fix responder chain 2025-04-21 10:17:02 -07:00
Tristan Partin
f2fa47bca7 apprt/gtk: fix typo
I had a copy-paste error when I used right instead of up.

Signed-off-by: Tristan Partin <tristan@partin.io>
2025-04-21 12:12:54 -05:00
Mitchell Hashimoto
6d2685b5a2 add toggle command palette binding 2025-04-21 10:05:30 -07:00
Mitchell Hashimoto
8bd91e7104 macOS: hook up full action execution 2025-04-21 09:40:08 -07:00
Mitchell Hashimoto
afd4ec6de2 macOS: command palette "enter" works 2025-04-21 09:32:51 -07:00
Mitchell Hashimoto
0915a7af46 macOS: extract TerminalCommandPalette 2025-04-21 09:18:46 -07:00
Mitchell Hashimoto
5fab6faf04 macOS: hook up command palette C API to actual command palette 2025-04-21 08:32:42 -07:00
Mitchell Hashimoto
8615dfb73d libghostty: add API for getting commands 2025-04-21 08:32:05 -07:00
Mitchell Hashimoto
a34134e643 input: defind Command struct and default commands 2025-04-21 08:32:05 -07:00
Mitchell Hashimoto
be7fb45e9f command palette SwiftUI view 2025-04-21 08:32:05 -07:00
Mitchell Hashimoto
40c3dbbb31 macOS: remove "r" & "c" from resize overlay (#7142)
as per [#6013](https://github.com/ghostty-org/ghostty/pull/6013) and
[#6040](https://github.com/ghostty-org/ghostty/pull/6040) but for macOS
2025-04-21 08:13:49 -07:00
Asadullah Shaikh
9709d934f0 remove "r" & "c" from resize overlay on macOS 2025-04-21 20:25:25 +05:30
Mitchell Hashimoto
8c02eea48b macOS: get proper unshifted codepoint with ctrl pressed (#7150)
Fixes a regression where `C-S-c` stopped working properly in both legacy
and Kitty modes (although the Kitty mode side only affected alternates
and not the key itself so it probably worked fine in most programs).

The issue is that `charactersIgnoringModifiers` changes behavior if
`control` is pressed, so it doesn't really ignore all modifiers. We have
to use `characters(byApplyingModifiers:)` to get the proper unshifted
codepoint when `control` is pressed.
2025-04-21 07:52:39 -07:00
Mitchell Hashimoto
643c882597 macOS: use KeyboardShortcut rather than homegrown KeyEquivalent (#7139)
This replaces the use of our custom `Ghostty.KeyEquivalent` with the
SwiftUI `KeyboardShortcut` type. This is a more standard way to
represent keyboard shortcuts and lets us more tightly integrate with
SwiftUI/AppKit when necessary over our custom type.

This PR should have no user impact. This is just some cleanup for future
work.

Note that not all Ghostty triggers can be represented as
KeyboardShortcut values because macOS itself does not support binding
keys such as function keys (e.g. F1-F12) to KeyboardShortcuts.

This isn't an issue since all input also passes through a lower level
libghostty API which can handle all key events, we just can't show these
keyboard shortcuts on things like the menu bar. This was already true
before this commit.
2025-04-21 07:26:34 -07:00
Mitchell Hashimoto
fe3b0e0ef6 Correct change_title_promptprompt_surface_title (#7149)
This was changed pretty late at
https://github.com/ghostty-org/ghostty/pull/4217#issuecomment-2660307923,
and I don't think anybody saw my comment at
https://github.com/ghostty-org/ghostty/pull/4217#discussion_r2045783050;
I have no idea if this change is correct and have no way to test it
either as I don't use macOS, but I'm quite suspicious of that line
having not been changed.
2025-04-21 07:25:09 -07:00
Mitchell Hashimoto
7e00f2fb7f macOS: get proper unshifted codepoint with ctrl pressed
Fixes a regression where `C-S-c` stopped working properly in both legacy
and Kitty modes (although the Kitty mode side only affected alternates
and not the key itself so it probably worked fine in most programs).

The issue is that `charactersIgnoringModifiers` changes behavior if
`control` is pressed, so it doesn't really ignore all modifiers. We have
to use `characters(byApplyingModifiers:)` to get the proper unshifted codepoint
when `control` is pressed.
2025-04-21 07:23:24 -07:00
Mitchell Hashimoto
7d4dddb94e Update iTerm2 colorschemes (#7140)
Upstream revision:
c5e4212e76
2025-04-21 07:11:58 -07:00
Leah Amelia Chen
b13b6465f2 Remove note about default from bell-features→system's description (#7148) 2025-04-21 11:53:48 +08:00
Kat
d4525f2c57 Correct remaining instances of change_title_prompt to prompt_surface_title. 2025-04-21 03:41:52 +00:00
Kat
160b26708c Remove note about default from bell-features→system's description. 2025-04-21 03:24:05 +00:00
mitchellh
48cba761b9 deps: Update iTerm2 color schemes 2025-04-20 00:14:26 +00:00
Mitchell Hashimoto
b05826ac9d macOS: use KeyboardShortcut rather than homegrown KeyEquivalent
This replaces the use of our custom `Ghostty.KeyEquivalent` with
the SwiftUI `KeyboardShortcut` type. This is a more standard way to
represent keyboard shortcuts and lets us more tightly integrate with
SwiftUI/AppKit when necessary over our custom type.

Note that not all Ghostty triggers can be represented as
KeyboardShortcut values because macOS itself does not support
binding keys such as function keys (e.g. F1-F12) to KeyboardShortcuts.

This isn't an issue since all input also passes through a lower level
libghostty API which can handle all key events, we just can't show these
keyboard shortcuts on things like the menu bar. This was already true
before this commit.
2025-04-19 14:39:48 -07:00
Mitchell Hashimoto
4e10f972df macOS: Do not send control characters as UTF8 keyboard text (#7136)
Fixes a regression where `ctrl+enter` was not encoding properly since
our input stack changes.
2025-04-19 07:06:39 -07:00
Mitchell Hashimoto
9beaed45f8 Revert "apprt/gtk: add menu to new tab button to create splits (#7127)"
This reverts commit 14134d61fb4b1bbf4ce80bb9b3ed849908bf9344, reversing
changes made to 6a876ef8ec3e2aeb3d15df0dfb0e07677e49ff03.

This causes translation failures, this should be reintroduced when the
CI check passes.
2025-04-19 07:05:38 -07:00
Mitchell Hashimoto
31b2ac4b79 macOS: Do not send control characters as UTF8 keyboard text
Fixes a regression where `ctrl+enter` was not encoding properly since
our input stack changes.
2025-04-19 06:54:36 -07:00
Tristan Partin
14134d61fb apprt/gtk: add menu to new tab button to create splits (#7127)
Closes: https://github.com/ghostty-org/ghostty/discussions/6828
2025-04-19 01:23:18 -05:00
Tristan Partin
410761d4e3 apprt/gtk: add menu to new tab button to create splits
Closes: https://github.com/ghostty-org/ghostty/discussions/6828
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
Signed-off-by: Tristan Partin <tristan@partin.io>
2025-04-19 01:04:57 -05:00
Mitchell Hashimoto
6a876ef8ec macOS: A couple input regressions from 7121 (#7132)
Fixes #7131 

See individual commit messages.

I'm running them through the same tests as #7121 to verify manually that
behavior.
2025-04-18 15:35:12 -07:00
Mitchell Hashimoto
e4a37dd383 macOS: only set unshifted codepoint on keyDown/Up events
Other event types trigger an AppKit assertion that doesn't crash the app
but logs some nasty stuff.
2025-04-18 15:14:38 -07:00
Mitchell Hashimoto
18d6faf597 macOS: translation mods should never have "control"
This also lets us get rid of our `C-/` special handling to prevent a
system beep.
2025-04-18 15:10:57 -07:00
Mitchell Hashimoto
edb8616341 macos: translationMods should be used for consumed mods calculation
Fixes #7131
Regression from #7121

Our consumed mods should not include "alt" if `macos-option-as-alt` is
set. To do this, we need to calculate our consumed mods based on the
actual translation event mods (if available, only available during
keyDown).
2025-04-18 14:28:26 -07:00
Mitchell Hashimoto
65356c25da macOS/libghostty: rework keyboard input handling (#7121)
This is a large refactor of the keyboard input handling code in
libghostty and macOS. Previously, libghostty did a lot of things that
felt out of scope or was repeated work due to lacking context. For
example, libghostty would do full key translation from key event to
character (including unshifted translation) as well as managing dead key
states and setting the proper preedit text.

This is all information the apprt can and should have on its own.
NSEvent on macOS already provides us with all of this information,
there's no need to redo the work. The reason we did in the first place
is mostly historical: libghostty powered our initial macOS port years
ago when we didn't have an AppKit runtime yet.

This cruft has already practically been the source of numerous issues,
e.g.
https://github.com/ghostty-org/ghostty/issues/5558, but many other hacks
along the way, too.

This commit pushes all preedit (e.g. dead key) handling and key
translation
including unshifted keys up into the caller of libghostty.

Besides code cleanup, a practical benefit of this is that key event
handling on macOS is now about 10x faster on average. That's because
we're avoiding repeated key translations as well as other unnecessary
work. This should have a meaningful impact on input latency but I didn't
measure the full end-to-end latency.

A scarier part of this commit is that key handling is not well tested
since its a GUI component. I suspect we'll have some fallout for certain
keyboard layouts or input methods, but I did my best to run through
everything I could think of.

This also fixes one bug where preedit state didn't properly clear when
changing keyboard layouts. This now does and matches the behavior
of native apps like TextEdit and Terminal.app
2025-04-18 12:06:32 -07:00
Tristan Partin
85268d4f82 apprt/gtk: refactor action callbacks to reduce code duplication (#7126)
It was getting very monotonous reading the code.
2025-04-18 13:11:12 -05:00
Tristan Partin
793c727986 apprt/gtk: refactor action callbacks to reduce code duplication
It was getting very monotonous reading the code.

Signed-off-by: Tristan Partin <tristan@partin.io>
2025-04-18 12:54:36 -05:00
Leah Amelia Chen
773506fe82 Improve Chinese (zh_CN) Translations for Natural Phrasing (#7125) 2025-04-18 23:56:12 +08:00
Bryan Lee
34ddd3d9e5 Refine Chinese translations for daily usage consistency 2025-04-18 23:34:18 +08:00
Mitchell Hashimoto
03a1c04a6e i18n: fix spelling inconsistencies for Japanese Translations (#7122)
This pr fix spelling inconsistencies for Japanese Translations
2025-04-18 07:17:46 -07:00
Mitchell Hashimoto
b63fa7dfa1 vim: fix syntax highlight on scratch buffer (#7119)
Sometimes we need detect ghostty filetype on scratch buffer.
In this case `set iskeyword` in ftplugin is not loaded.

Screenshot:
https://github.com/ibhagwan/fzf-lua/pull/1913#issuecomment-2813289819.

e.g.
```sh
nvim +'0r ~/.config/ghostty/config' +'se syntax=ghostty'
```
2025-04-18 07:17:30 -07:00
phanium
9bab900c75 vim: fix syntax highlight on scratch buffer 2025-04-18 21:50:24 +08:00
Bryan Lee
90499f0749 macOS: Add dock badge notification for bell events 2025-04-18 09:43:48 +08:00
ekusiadadus
bef0d5d88e fix: spelling inconsistencies for Japanese Translations 2025-04-18 07:22:40 +09:00
Mitchell Hashimoto
ded9be39c0 macOS: handle preedit text changes outside of key event 2025-04-17 14:24:12 -07:00
Mitchell Hashimoto
b3cb38c3fa macOS/libghostty: rework keyboard input handling
This is a large refactor of the keyboard input handling code in
libghostty and macOS. Previously, libghostty did a lot of things that
felt out of scope or was repeated work due to lacking context. For
example, libghostty would do full key translation from key event to
character (including unshifted translation) as well as managing dead key
states and setting the proper preedit text.

This is all information the apprt can and should have on its own.
NSEvent on macOS already provides us with all of this information,
there's no need to redo the work. The reason we did in the first place
is mostly historical: libghostty powered our initial macOS port years
ago when we didn't have an AppKit runtime yet.

This cruft has already practically been the source of numerous issues, e.g.
#5558, but many other hacks along the way, too.

This commit pushes all preedit (e.g. dead key) handling and key translation
including unshifted keys up into the caller of libghostty.

Besides code cleanup, a practical benefit of this is that key event
handling on macOS is now about 10x faster on average. That's because
we're avoiding repeated key translations as well as other unnecessary
work. This should have a meaningful impact on input latency but I didn't
measure the full end-to-end latency.

A scarier part of this commit is that key handling is not well tested
since its a GUI component. I suspect we'll have some fallout for certain
keyboard layouts or input methods, but I did my best to run through
everything I could think of.
2025-04-17 14:24:12 -07:00
Mitchell Hashimoto
2bcd76c3d9 macOS: Implement basic bell features (no sound) (#7101)
Fixes #7099

This adds basic bell features to macOS to conceptually match the GTK
implementation. When a bell is triggered, macOS will do the following:

  1. Bounce the dock icon once, if the app isn't already in focus.
2. Add a bell emoji (🔔) to the title of the surface that triggered the
bell. This emoji will be removed after the surface is focused or a
keyboard event if the surface is already focused. This behavior matches
iTerm2.

Note that neither of these respect the `system` `bell-features` config
because they're both unobtrusive (the dock icon bounces only once, the
title change is silent and similar to GTK tab attention) and unrelated
to system settings.

This doesn't add an icon badge because macOS's dockTitle.badgeLabel API
wasn't doing anything for me and I wasn't able to fully figure out
why...
2025-04-15 13:24:20 -07:00
Mitchell Hashimoto
cc690eddb5 macOS: Implement basic bell features (no sound)
Fixes #7099

This adds basic bell features to macOS to conceptually match the GTK
implementation. When a bell is triggered, macOS will do the following:

  1. Bounce the dock icon once, if the app isn't already in focus.
  2. Add a bell emoji (🔔) to the title of the surface that triggered
     the bell. This emoji will be removed after the surface is focused
     or a keyboard event if the surface is already focused. This
     behavior matches iTerm2.

This doesn't add an icon badge because macOS's dockTitle.badgeLabel API
wasn't doing anything for me and I wasn't able to fully figure out
why...
2025-04-15 10:41:15 -07:00
Mitchell Hashimoto
392aab2e4a macos: quick terminal uses padded notch mode if notch is visible (#7098)
Fixes #6612
2025-04-15 09:04:44 -07:00
Mitchell Hashimoto
b77c5634f0 macos: quick terminal uses padded notch mode if notch is visible
Fixes #6612
2025-04-15 08:52:20 -07:00
Mitchell Hashimoto
62af0c0ec0 terminal: clear correct row on index operation in certain edge cases (#7093)
Fixes #7066

This fixes an issue where under certain conditions (expanded below), we
would not clear the correct row, leading to the screen having duplicate
data.

This was triggered by a page state of the following:

```
      +----------+ = PAGE 0
  ... :          :
 4305 |1ABCD00000|
 4306 |2EFGH00000|
      :^         : = PIN 0
     +-------------+ ACTIVE
 4307 |3IJKL00000| | 0
      +----------+ :
      +----------+ : = PAGE 1
    0 |          | | 1
    1 |          | | 2
      +----------+ :
     +-------------+
```

Namely, the cursor had to NOT be on the last row of the first page, but
somewhere on the first page. Then, when an `index` (LF) operation was
performed the result would look like this:

```
      +----------+ = PAGE 0
  ... :          :
 4305 |1ABCD00000|
 4306 |2EFGH00000|
     +-------------+ ACTIVE
 4307 |3IJKL00000| | 0
      :^         : : = PIN 0
      +----------+ :
      +----------+ : = PAGE 1
    0 |3IJKL00000| | 1
    1 |          | | 2
      +----------+ :
     +-------------+
```

The `3IJKL` line was duplicated. What was happening here is that we
performed the index operation correctly but failed to clear the cursor
line as expected.

This is because we were always clearing the first row in the page
instead of the row of the cursor.

Test added.
2025-04-15 07:09:18 -07:00
Mitchell Hashimoto
4aa875bbf6 ci: add logging to localization-review script (#7094)
An example of the new output (this very PR as an example):

<img
src="https://github.com/user-attachments/assets/0136238c-75d1-4bc6-8a3f-cb4b80daa512"
width="80%">

I also performed a couple of small refactors.
2025-04-14 15:56:15 -07:00
Mitchell Hashimoto
da6b478fbe terminal: clear correct row on index operation in certain edge cases
Fixes #7066

This fixes an issue where under certain conditions (expanded below), we
would not clear the correct row, leading to the screen having duplicate
data.

This was triggered by a page state of the following:

```
      +----------+ = PAGE 0
  ... :          :
 4305 |1ABCD00000|
 4306 |2EFGH00000|
      :^         : = PIN 0
     +-------------+ ACTIVE
 4307 |3IJKL00000| | 0
      +----------+ :
      +----------+ : = PAGE 1
    0 |          | | 1
    1 |          | | 2
      +----------+ :
     +-------------+
```

Namely, the cursor had to NOT be on the last row of the first page,
but somewhere on the first page. Then, when an `index` (LF) operation
was performed the result would look like this:

```
      +----------+ = PAGE 0
  ... :          :
 4305 |1ABCD00000|
 4306 |2EFGH00000|
     +-------------+ ACTIVE
 4307 |3IJKL00000| | 0
      :^         : : = PIN 0
      +----------+ :
      +----------+ : = PAGE 1
    0 |3IJKL00000| | 1
    1 |          | | 2
      +----------+ :
     +-------------+
```

The `3IJKL` line was duplicated. What was happening here is that we
performed the index operation correctly but failed to clear the cursor
line as expected.

This is because we were always clearing the first row in the page
instead of the row of the cursor.

Test added.
2025-04-14 15:54:00 -07:00
trag1c
8bc91933cd ci: add logging to localization-review script 2025-04-14 23:58:29 +02:00
Mitchell Hashimoto
8bab8f7d64 macOS: fix quick terminal fullscreen issues (#7091)
Supersedes #7075 
Fixes #7070 

This fixes a few separate fullscreen issues with the quick terminal:

1. If we're on a fullscreen space, we can't reliably set the
`autoHideMenuBar` presentation option because macOS itself is managing
it. The fix is to use private APIs to detect we're on a fullscreen space
and avoid this.

2. If our quick terminal is fullscreen when we move spaces, we must exit
and re-enter fullscreen because the frame may change (e.g. due to
menubar changes).

3. If we aren't the frontmost app, we must avoid hiding the menu because
it has no effect and our fullscreen frame would be wrong.
2025-04-14 11:29:04 -07:00
Mitchell Hashimoto
21d09fe2e0 i18: fix minor Norwegian grammar issues (#7085)
Changes the translation of 'clipboard' to definite singular form, and
removes a misplaced verb.
2025-04-14 11:22:40 -07:00
Mitchell Hashimoto
c23b389cf1 gtk: implement bell (#7087)
This PR implements a more lightweight alternative to #5326 that contains
features that I personally think Just Make Sense for the bell.

No configs, no GStreamer stuff, just sane defaults to get us started.
2025-04-14 11:19:19 -07:00
Mitchell Hashimoto
d1c15dbf07 macOS: quick terminal should retain menu if not frontmost
This is a bug I noticed in the following scenario:

  1. Open Ghostty
  2. Fullscreen normal terminal window (native fullscreen)
  3. Open quick terminal
  4. Move spaces, QT follows
  5. Fullscreen the quick terminal

The result was that the menu bar would not disappear since our app is
not frontmost but we set the fullscreen frame such that we expected it.
2025-04-14 11:17:11 -07:00
Mitchell Hashimoto
453e6590e8 macOS: non-native fullscreen should not hide menu on fullscreen space
Fixes #7075

We have to use private APIs for this, I couldn't find a reliable way
otherwise.
2025-04-14 10:38:54 -07:00
Leah Amelia Chen
3a973c692a gtk(bell): add bell-features config option
Co-authored-by: Jeffrey C. Ollie <jeff@ocjtech.us>
2025-04-15 00:18:05 +08:00
Leah Amelia Chen
abd7d9202b gtk(bell): mark tab as needing attention on bell 2025-04-14 23:44:13 +08:00
Leah Amelia Chen
10a591fba2 gtk(bell): use gdk.Surface.beep for bell
Co-authored-by: Jeffrey C. Ollie <jeff@ocjtech.us>
2025-04-14 23:44:13 +08:00
Leah Amelia Chen
a0760cabd6 gtk: implement bell
Co-authored-by: Jeffrey C. Ollie <jeff@ocjtech.us>
2025-04-14 23:44:13 +08:00
cryptocode
b932d35526 i18: fix minor Norwegian grammar issues
Changes the translation of 'clipboard' to definite singular form,
and removes a misplaced verb.
2025-04-14 16:29:59 +02:00
Mitchell Hashimoto
9d9d781a0b Mouse drag while clicked should cancel any mouse link actions (#7080)
Fixes #7077

This follows pretty standard behavior across native or popular
applications on both platforms macOS and Linux. The basic behavior is
that if you do a mouse down event and then drag the mouse beyond the
current character, then any mouse up actions are canceled (beyond
emiting the event itself).

This fixes a specific scenario where you could do the following:

  1. Click anywhere (mouse down)
  2. Drag over a valid link
  3. Press command/control (to activate the link)
  4. Release the mouse button (mouse up)
  5. The link is triggered

Now, step 3 and step 5 do not happen. Links are not even highlighted in
this scenario. This matches iTerm2 on macOS which has a similar
command-to-activate-links behavior.

## Demo


https://github.com/user-attachments/assets/f79767b1-78fd-432b-af46-28194b816747
2025-04-13 19:37:13 -07:00
Mitchell Hashimoto
f7394c00c1 macOS: only emit a mouse exited position if we're not dragging (#7077)
Fixes #7071

When the mouse is being actively dragged, AppKit continues to emit
mouseDragged events which will update our position appropriately. The
mouseExit event we were sending sends a synthetic (-1, -1) position
which was causing a scroll up.
2025-04-13 14:58:31 -07:00
Mitchell Hashimoto
6d3f97ec1e Mouse drag while clicked should cancel any mouse link actions
Fixes #7077

This follows pretty standard behavior across native or popular applications
on both platforms macOS and Linux. The basic behavior is that if you
do a mouse down event and then drag the mouse beyond the current
character, then any mouse up actions are canceled (beyond emiting the
event itself).

This fixes a specific scenario where you could do the following:

  1. Click anywhere (mouse down)
  2. Drag over a valid link
  3. Press command/control (to activate the link)
  4. Release the mouse button (mouse up)
  5. The link is triggered

Now, step 3 and step 5 do not happen. Links are not even highlighted in
this scenario. This matches iTerm2 on macOS which has a similar
command-to-activate-links behavior.
2025-04-13 14:56:40 -07:00
Mitchell Hashimoto
6d80388155 macOS: only emit a mouse exited position if we're not dragging
Fixes #7071

When the mouse is being actively dragged, AppKit continues to emit
mouseDragged events which will update our position appropriately. The
mouseExit event we were sending sends a synthetic (-1, -1) position
which was causing a scroll up.
2025-04-13 12:46:39 -07:00
Mitchell Hashimoto
66636195f1 Introduce Issue Triage Template (#7012)
The helper team has been discussing some common issues we see with
Discussion submissions (missing info, duplicates, etc.), and pluie's
#6937 has been a huge step forward - this PR introduces a template for
the Issue Triage Discussion type.

The template has gone through a few revisions prior to this PR, but I am
certain there are probably a few places to be cleaned up. You can test
it out by [opening a new "Issue Triage" Discussion in my
fork](https://github.com/taylrfnt/ghostty/discussions/new?category=issue-triage).

~~Creating this as a draft for now, since I may not be able to respond
to any review comments in a timely manner.~~
2025-04-11 14:17:41 -07:00
Mitchell Hashimoto
f777138590 mk_MK localization (#6902) 2025-04-11 12:52:51 -07:00
Mitchell Hashimoto
deed2707a5 CODEOWNERS 2025-04-11 12:50:12 -07:00
Andrej Daskalov
dcc2e9eaf8 Merge branch 'main' into mk-localization 2025-04-11 21:47:07 +02:00
Mitchell Hashimoto
74b17f68b5 i18n: add catalan translations (#6841)
Hi there!
This PR adds the Catalan translations (ca_ES.UTF-8).

Salut
2025-04-11 10:22:54 -07:00
Francesc Arpi Roca
d749e1b87e i18n: fix the "deny" catalan translation 2025-04-11 10:20:53 -07:00
Francesc Arpi Roca
e30feb3bfb i18n: fix string length 2025-04-11 10:20:44 -07:00
Francesc Arpi Roca
a092d7ae42 i18n: add catalan translations 2025-04-11 10:20:44 -07:00
Mitchell Hashimoto
9233413126 i18n: add pt-BR (Brazilian Portuguese) translation (#6966)
With this PR now it supports the brazilian portuguese language for
ghostty, native speaker and resident, want to bring this language to
this new terminal that is starting to become very fondly to me! Any
questions about it i am free to answer.
2025-04-11 10:14:47 -07:00
Mitchell Hashimoto
24847293f2 update CODEOWNERS 2025-04-11 10:12:19 -07:00
g
7e67312c61 grammar fix and correct form for some phrases 2025-04-11 10:12:06 -07:00
g
11f5797a91 fix in lower case when required 2025-04-11 10:12:06 -07:00
Gustavo
e31c8e09ed Update po/pt_BR.UTF-8.po
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-04-11 10:12:06 -07:00
g
f794afe2d8 standard file extension name 2025-04-11 10:12:06 -07:00
g
63ccdf2cff fix in capital letters 2025-04-11 10:12:06 -07:00
g
c19f2aa1bc Add pt-BR translations to ghostty 2025-04-11 10:12:06 -07:00
Mitchell Hashimoto
9751f43529 Add Spanish translations (419 = Latin America) (#6940)
Hi!
I have followed the instructions and added translations for Spanish,
Country Latin America 419 according to
[this](https://localizely.com/locale-code/es-419/) and other online
sources.
In the provided links there was no references to 419, but I created it
via the suggested command:
`msginit -i po/com.mitchellh.ghostty.pot -l es_419.UTF-8 -o
"po/es_419.UTF-8.po" `
Glad to be able to contribute to this excellent product!
Cheers!
2025-04-11 10:11:26 -07:00
MiguelElGallo
5bbed046f6 add Spanish (Bolivia) translations and locale support 2025-04-11 10:09:05 -07:00
MiguelElGallo
a9f9abd615 add Spanish (Latin America) locale support 2025-04-11 10:08:44 -07:00
MiguelElGallo
e5de000895 add Spanish translations (419 = Latin America) for com.mitchellh.ghostty package 2025-04-11 10:08:22 -07:00
Mitchell Hashimoto
9cd3d3826a feat: Add Turkish translations (#6898) 2025-04-11 10:01:29 -07:00
Emir SARI
913c6dc7df feat: Add Turkish translations 2025-04-11 09:57:19 -07:00
Mitchell Hashimoto
17b7920f65 Add nl_NL (Dutch) translations (#6894) 2025-04-11 09:52:33 -07:00
Mitchell Hashimoto
14cac67b98 CODEOWNERS 2025-04-11 09:51:18 -07:00
Nico Geesink
b0b09bf034 Fix spell errors 2025-04-11 09:51:04 -07:00
Nico Geesink
059caef118 Use informal 'you' and change verander to wijzig 2025-04-11 09:51:04 -07:00
Nico Geesink
960fcc275f Fix typos and make sentences more fluent 2025-04-11 09:51:04 -07:00
Nico Geesink
e415b6db42 Merge branch 'main' into main 2025-04-11 09:51:04 -07:00
Nico Geesink
cd6a8f6a65 Fix typo 2025-04-11 09:50:44 -07:00
Nico Geesink
7db64b8e34 Add name and don't use title case 2025-04-11 09:50:44 -07:00
Nico Geesink
e52aad5dea Add nl_NL (Dutch) translations 2025-04-11 09:50:44 -07:00
Mitchell Hashimoto
6899e9d984 Added Russian translation for Ghostty (#6889) 2025-04-11 09:48:50 -07:00
Mitchell Hashimoto
52ac670913 CODEOWNERS 2025-04-11 09:47:11 -07:00
blackzeshi
077ae6a098 Update po/ru_RU.UTF-8.po
Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-11 09:45:55 -07:00
blackzeshi
0d226d139b Update po/ru_RU.UTF-8.po
Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-11 09:45:55 -07:00
blackzeshi
d0403021a4 Update po/ru_RU.UTF-8.po
2 line fixed

Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-11 09:45:55 -07:00
blackzeshi
f4054daf0d Update po/ru_RU.UTF-8.po
262 line about debug build fixed

Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-11 09:45:55 -07:00
blackzeshi
0d23f7af31 Update po/ru_RU.UTF-8.po
248 line changed

Co-authored-by: TicClick <ya@ticclick.ch>
2025-04-11 09:45:55 -07:00
blackzeshi
2b0a81d982 Merge branch 'main' into add_russian 2025-04-11 09:45:55 -07:00
blackzeshi
91f9fdb1be some fixes to adding russian translation (i.e. emoji) 2025-04-11 09:45:37 -07:00
blackzeshi
df5dd1858a add russian translation 2025-04-11 09:45:37 -07:00
Mitchell Hashimoto
444352418c i18n: Add French translation (#6868)
Hi ! 
This is just to add a first version of a french translation !
2025-04-11 09:44:38 -07:00
Mitchell Hashimoto
5be4b0de6b CODEOWNERS 2025-04-11 09:42:48 -07:00
Nicolas G
ca336f5310 Merge branch 'main' into main 2025-04-11 09:42:12 -07:00
Kirwiisp
5ca5afb13d fix: spelling and typo 2025-04-11 09:41:49 -07:00
Kirwiisp
930079ca01 fix: spelling mistakes 2025-04-11 09:41:49 -07:00
Nicolas G
1aa16cdf6b Fix ponctuation and Warning translation
Fix: missing ponctuations on various lines.

Change "Warning" to "Attention", might change in the futur if it does not perfectly match  common practice.

Fix: Multiline on config errors dialog
2025-04-11 09:41:49 -07:00
Kirwiisp
e2a8a3243c i18n: Add French translation 2025-04-11 09:41:49 -07:00
Mitchell Hashimoto
8d1a57cde3 i18n: Add Japanese translations (#6866)
This pull request adds Japanese(ja_JP.UTF-8) translations.
2025-04-11 09:39:51 -07:00
Lon Sagisawa
10a90b5b67 fix: inconsistency around space 2025-04-11 09:38:37 -07:00
Lon Sagisawa
20ef2150de i18n: Add Japanese translations 2025-04-11 09:38:37 -07:00
Mitchell Hashimoto
028759e8f6 Add Indonesian id_ID translations. (#6836)
Add the Indonesian id_ID translations.
2025-04-11 09:33:40 -07:00
Mitchell Hashimoto
7adc2954c3 update CODEOWNERS 2025-04-11 09:27:04 -07:00
halosatrio
561a0e3897 i18n: fix capitalization and some translation 2025-04-11 09:26:00 -07:00
halosatrio
1222e80eb1 i18n: add id_ID code locale 2025-04-11 09:26:00 -07:00
halosatrio
d903cc9827 i18n: fix translation 2025-04-11 09:25:35 -07:00
halosatrio
02bb81ad44 i18n: add indonesian translation 2025-04-11 09:25:35 -07:00
Mitchell Hashimoto
b16324ef0b ci: add a script and workflow for requesting i18n review (#7053)
From #7052, but for some reason I couldn't push there:

> This helps get around the `CODEOWNERS` file requiring that
contributors need to have write access to the repo in order to be
requested for review. The mechanism is (for any new PR):
> 1. List the changed files
> 2. Fetch and parse the CODEOWNERS file to get a path:owner mapping
> 3. See if any changed file matches the CODEOWNERS mapping
> 4. Fetch team members for affected localization teams
> 5. Request review from individual accounts
2025-04-10 19:46:27 -04:00
trag1c
f0ade53fd2 ci: add a script and workflow for requesting i18n review 2025-04-10 16:40:28 -07:00
taylrfnt
49a97a589c fix typo - exiting to existing
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
2025-04-10 17:45:35 -05:00
Mitchell Hashimoto
d7f75b348d config: allow commands to specify whether they shell expand or not (#7044)
Fixes #7032 

This introduces a syntax for `command` and `initial-command` that allows
the user to specify whether it should be run via `/bin/sh -c` or not.
The syntax is a prefix `direct:` or `shell:` prior to the command, with
no prefix implying a default behavior as documented.

Previously, we unconditionally ran commands via `/bin/sh -c`, primarily
to avoid having to do any shell expansion ourselves. We also leaned on
it as a crutch for PATH-expansion but this is an easy problem compared
to shell expansion.

For the principle of least surprise, this worked well for configurations
specified via the config file, and is still the default. However, these
configurations are also set via the `-e` special flag to the CLI, and it
is very much not the principle of least surprise to have the command run
via `/bin/sh -c` in that scenario since a shell has already expanded all
the arguments and given them to us in a nice separated format. But we
had no way to toggle this behavior.

This commit introduces the ability to do this, and changes the defaults
so that `-e` doesn't shell expand. Further, we also do PATH lookups
ourselves for the non-shell expanded case because thats easy (using
execvpe style extensions but implemented as part of the Zig stdlib). We
don't do path expansion (e.g. `~/`) because thats a shell expansion.

So to be clear, there are no two polar opposite behavioes here with
clear semantics:

1. Direct commands are passed to `execvpe` directly, space separated.
This will not handle quoted strings, environment variables, path
expansion (e.g. `~/`), command expansion (e.g. `$()`), etc.

2. Shell commands are passed to `/bin/sh -c` and will be shell expanded
as per the shell's rules. This will handle everything that `sh`
supports.

In doing this work, I also stumbled upon a variety of smaller
improvements that could be made:

- A number of allocations have been removed from the startup path that
only existed to add a null terminator to various strings. We now have
null terminators from the beginning since we are almost always on a
system that's going to need it anyways.

- For bash shell integration, we no longer wrap the new bash command in
a shell since we've formed a full parsed command line.

- The process of creating the command to execute by termio is now unit
tested, so we can test the various complex cases particularly on macOS
of wrapping commands in the login command.

- `xdg-terminal-exec` on Linux uses the `direct:` method by default
since it is also assumed to be executed via a shell environment.
2025-04-10 16:32:18 -04:00
Mitchell Hashimoto
d4a5e5f88e elvish: use kitty-shell-cwd:// to report pwd (#7033)
OSC 7's standard body is a percent-encoded file:// URL. There isn't an
easy way for us to percent-encode the path ($pwd) component here without
implementing a custom function.

Instead, switch to the kitty-shell-cwd:// scheme, which Kitty introduced
to ease this implementation challenge in shell scripts. It accepts the
path string verbatim, without an encoding.

In Ghostty, we accept both the file:// and kitty-shell-cwd:// schemes,
and we attempt to URI-decode them both, so in practice this is more
about the "correctness" of this protocol than a functional change. It's
also possible we might decide to treat these schemes differently in the
runtime, like Kitty does.

Also, fix the `platform:hostname` function call syntax.
2025-04-10 16:19:26 -04:00
Mitchell Hashimoto
722d41a359 config: allow commands to specify whether they shell expand or not
This introduces a syntax for `command` and `initial-command` that allows
the user to specify whether it should be run via `/bin/sh -c` or not.
The syntax is a prefix `direct:` or `shell:` prior to the command,
with no prefix implying a default behavior as documented.

Previously, we unconditionally ran commands via `/bin/sh -c`, primarily
to avoid having to do any shell expansion ourselves. We also leaned on
it as a crutch for PATH-expansion but this is an easy problem compared
to shell expansion.

For the principle of least surprise, this worked well for configurations
specified via the config file, and is still the default. However, these
configurations are also set via the `-e` special flag to the CLI, and it
is very much not the principle of least surprise to have the command run via
`/bin/sh -c` in that scenario since a shell has already expanded all the
arguments and given them to us in a nice separated format. But we had no
way to toggle this behavior.

This commit introduces the ability to do this, and changes the defaults
so that `-e` doesn't shell expand. Further, we also do PATH lookups
ourselves for the non-shell expanded case because thats easy (using
execvpe style extensions but implemented as part of the Zig stdlib). We don't
do path expansion (e.g. `~/`) because thats a shell expansion.

So to be clear, there are no two polar opposite behavioes here with
clear semantics:

  1. Direct commands are passed to `execvpe` directly, space separated.
     This will not handle quoted strings, environment variables, path
     expansion (e.g. `~/`), command expansion (e.g. `$()`), etc.

  2. Shell commands are passed to `/bin/sh -c` and will be shell expanded
     as per the shell's rules. This will handle everything that `sh`
     supports.

In doing this work, I also stumbled upon a variety of smaller
improvements that could be made:

  - A number of allocations have been removed from the startup path that
    only existed to add a null terminator to various strings. We now
    have null terminators from the beginning since we are almost always
    on a system that's going to need it anyways.

  - For bash shell integration, we no longer wrap the new bash command
    in a shell since we've formed a full parsed command line.

  - The process of creating the command to execute by termio is now unit
    tested, so we can test the various complex cases particularly on
    macOS of wrapping commands in the login command.

  - `xdg-terminal-exec` on Linux uses the `direct:` method by default
    since it is also assumed to be executed via a shell environment.
2025-04-10 13:15:14 -07:00
Leah Amelia Chen
046e92865b gtk: fix forcing the window theme to light or dark (#7039)
Fixes #7038
2025-04-09 08:32:50 +08:00
Jeffrey C. Ollie
cb1b447e8c gtk: fix forcing the window theme to light or dark
Fixes #7038
2025-04-08 18:33:12 -05:00
Jon Parise
5b4976f6ef elvish: fix platform:hostname function call syntax 2025-04-08 10:54:26 -04:00
Jon Parise
b213c157f0 elvish: use kitty-shell-cwd:// to report pwd
OSC 7's standard body is a percent-encoded file:// URL. There isn't an
easy way for us to percent-encode the path ($pwd) component here without
implementing a custom function.

Instead, switch to the kitty-shell-cwd:// scheme, which Kitty introduced
to ease this implementation challenge in shell scripts. It accepts the
path string verbatim, without an encoding.

In Ghostty, we accept both the file:// and kitty-shell-cwd:// schemes,
and we attempt to URI-decode them both, so in practice this is more
about the "correctness" of this protocol than a functional change. It's
also possible we might decide to treat these schemes differently in the
runtime, like Kitty does.
2025-04-08 10:38:57 -04:00
Mitchell Hashimoto
17ba0252e8 Update iTerm2 colorschemes (#7007)
Upstream revision:
4c57d8c11d
2025-04-07 20:31:54 -07:00
Mitchell Hashimoto
dc0b9a703d fix(kittygfx): accept commands with no control data (#7023)
This sort of command is treated as valid by Kitty so we should too. In
fact, it occurs with the example `send-png` script provided in the docs
for the protocol.
2025-04-07 20:31:41 -07:00
taylrfnt
6d36eeef3c add the verbosity
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-04-07 21:41:29 -05:00
taylrfnt
8a446b7776 remove the verbosity
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-04-07 21:41:09 -05:00
taylrfnt
279a6b6f58 fix typos & make it read more naturally 2025-04-07 21:27:01 -05:00
taylrfnt
9440dbba1a add notes abotu minimum config 2025-04-07 21:25:26 -05:00
taylrfnt
a6123c0447 fix trailing whitespace 2025-04-07 20:41:48 -05:00
taylrfnt
92959bc09c fix typo
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-04-07 20:39:22 -05:00
taylrfnt
b3c61d90f3 add note about commits 2025-04-07 20:37:57 -05:00
Jon Parise
f1472362af Use built-in functions for elvish (#7025)
Currently the elvish shell integration uses the `hostname` command, this
may not exist on all systems and is somewhat redundant to rely on when
elvish has an
[`platform:hostname`](https://elv.sh/ref/platform.html#platform:hostname)
function that can be used and will work across platform regardless of
command availability. On top of this instead of directly calling the
`pwd` function we can simply use the built-in
[`$pwd`](https://elv.sh/ref/builtin.html#$pwd) variable that elvish
gives us. This should prevent the shell integration from breaking due to
external function availability.
2025-04-07 18:09:09 -04:00
taylrfnt
d3b7fe3473 make following into these for better readability 2025-04-07 15:28:31 -05:00
taylrfnt
ddb85ca1b1 better discussion & issue callout in the important note
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-04-07 15:25:54 -05:00
taylrfnt
c7635d5f41 remove the please
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-04-07 15:19:38 -05:00
Hanna
a8f760c6d2 fix: undo accidental replace 2025-04-07 16:10:50 -04:00
Hanna
77f5fe2560 fix: parenthesis are unneeded around builtins 2025-04-07 16:09:43 -04:00
Hanna
9808c13796 refactor: use builtin hostname function 2025-04-07 16:02:53 -04:00
Jon Parise
e73970533a shell-integration: Fix condition for sudo (#7021)
A missing ";" meant the check for $TERMINFO was never executed.
2025-04-07 15:53:50 -04:00
Qwerasd
b64f49a0d7 fix(kittygfx): accept commands with no control data
This sort of command is treated as valid by Kitty so we should too. In
fact, it occurs with the example `send-png` script provided in the docs
for the protocol.
2025-04-07 13:31:51 -06:00
Fabian Boehm
df174a74f8 shell-integration: Fix condition for sudo
A missing ";" meant the check for $TERMINFO was never executed.
2025-04-07 21:20:21 +02:00
Mitchell Hashimoto
3878e46707 Fix macOS shortcut binding for close_window action (#7020)
Fixes #7003
2025-04-07 10:04:26 -07:00
Bryan Lee
9144f4db58 Fix macOS shortcut binding for close_window action 2025-04-08 00:44:53 +08:00
taylrfnt
9643e9c7a6 introduce issue triage template 2025-04-06 19:29:58 -05:00
mitchellh
f6ec39a5d8 deps: Update iTerm2 color schemes 2025-04-06 00:13:30 +00:00
Mitchell Hashimoto
6f7977fef1 macos: replay control+key events that go to doCommand (#7001)
Fixes #7000

Related to #6909, the same mechanism, but it turns out some control+keys
are also handled in this same way (namely control+esc leads to "cancel"
by default, which is not what we want).
2025-04-04 22:28:20 -04:00
Mitchell Hashimoto
fe0536aaaf macos: replay control+key events that go to doCommand
Fixes #7000

Related to #6909, the same mechanism, but it turns out some control+keys
are also handled in this same way (namely control+esc leads to "cancel"
by default, which is not what we want).
2025-04-04 22:09:04 -04:00
Mitchell Hashimoto
c0eaa4b158 macos: left mouse click while not focused doesn't encode to pty (#6998)
Fixes #2595

This fixes an issue where a left mouse click on a terminal while not
focused would subsequently be encoded to the pty as a mouse event. This
is atypical for macOS applications in general and wasn't something we
wanted to do.

We do, however, want to ensure our terminal gains focus when clicked
without focus. Specifically, a split. This matches iTerm2 behavior and
is rather nice. We had this behavior before but our logic to make this
work before caused the issue this commit is fixing.

I also tested this with command+click which is a common macOS shortcut
to emit a mouse event without raising the focus of the target window. In
this case, we will properly focus the split but will not encode the
mouse event to the pty. I think we actually do a _better job_ here tha
iTerm2 (but, subjective) because we do encode the pty event properly if
the split is focused whereas iTerm2 never does.
2025-04-04 19:31:22 -04:00
Mitchell Hashimoto
f228933955 macos: left mouse click while not focused doesn't encode to pty
Fixes #2595

This fixes an issue where a left mouse click on a terminal while not
focused would subsequently be encoded to the pty as a mouse event. This
is atypical for macOS applications in general and wasn't something we
wanted to do.

We do, however, want to ensure our terminal gains focus when clicked
without focus. Specifically, a split. This matches iTerm2 behavior and
is rather nice. We had this behavior before but our logic to make this
work before caused the issue this commit is fixing.

I also tested this with command+click which is a common macOS shortcut
to emit a mouse event without raising the focus of the target window. In
this case, we will properly focus the split but will not encode the
mouse event to the pty. I think we actually do a _better job_ here tha
iTerm2 (but, subjective) because we do encode the pty event properly if
the split is focused whereas iTerm2 never does.
2025-04-04 19:17:03 -04:00
Mitchell Hashimoto
60da3cf6a0 shell-integration: switch to $GHOSTTY_SHELL_FEATURES (#6871)
This change consolidates all three opt-out shell integration environment
variables into a single opt-in $GHOSTTY_SHELL_FEATURES variable. Its
value is a comma-delimited list of the enabled shell feature names (e.g.
"cursor,title").

$GHOSTTY_SHELL_FEATURES is set at runtime and automatically added to the
shell environment. Its value is based on the shell-integration-features
configuration option.

$GHOSTTY_SHELL_FEATURES is only set when at least one shell feature is
enabled. It won't be set when 'shell-integration-features = false'.

$GHOSTTY_SHELL_FEATURES lists only the enabled shell feature names. We
could have alternatively gone in the opposite direction and listed the
disabled features, letting the scripts assume each feature is on by
default like we did before, but I think this explicit approach is a
little safer and easier to reason about / debug.

It also doesn't support the "no-" negation prefix used by the config
system (e.g. "cursor,no-title"). This simplifies the implementation
requirements of our (multiple) shell integration scripts, and because
$GHOSTTY_SHELL_FEATURES is derived from shell-integration-features, the
user-facing configuration interface retains that expressiveness.

$GHOSTTY_SHELL_FEATURES is intended to primarily be an internal concern:
an interface between the runtime and our shell integration scripts. It
could be used by people with particular use cases who want to manually
source those scripts, but that isn't the intended audience.

... and because the previous $GHOSTTY_SHELL_INTEGRATION_NO_* variables
were also meant to be an internal concern, this change does not include
backwards compatibility support for those names.

One last advantage of a using a single $GHOSTTY_SHELL_FEATURES variable
is that it can be easily forwarded to e.g. ssh sessions or other shell
environments.

See: #5070
2025-04-04 17:05:37 -04:00
Mitchell Hashimoto
17a19e4837 docs: use Command instead of super for macOS (#6987)
Command is the name Apple uses for this key and that's printed on the
keyboard 😉
2025-04-03 21:31:05 -04:00
Mitchell Hashimoto
970fcdf671 libghostty: Action CValue should be untagged extern union (#6992)
Fixes #6962

I believe this is an upstream bug
(https://github.com/ziglang/zig/issues/23454), where Zig is allowing
extern unions to be tagged when created via type reification. This
results in a CValue that has an extra trailing byte (the tag).

This wasn't causing any noticeable issues for Ghostty for some reason
but others using our pattern were seeing issues. And I did confirm that
our CValue was indeed tagged and was the wrong byte size. I assume Swift
was just ignoring it because it was extra data. I don't know, but we
should fix this in general for libghostty.
2025-04-03 21:14:01 -04:00
Mitchell Hashimoto
e19b5a150a libghostty: Action CValue should be untagged extern union
Fixes #6962

I believe this is an upstream bug
(https://github.com/ziglang/zig/issues/23454), where Zig is allowing
extern unions to be tagged when created via type reification. This
results in a CValue that has an extra trailing byte (the tag).

This wasn't causing any noticeable issues for Ghostty for some reason
but others using our pattern were seeing issues. And I did confirm that
our CValue was indeed tagged and was the wrong byte size. I assume Swift
was just ignoring it because it was extra data. I don't know, but we
should fix this in general for libghostty.
2025-04-03 20:57:31 -04:00
Simon Olofsson
af0004eb52 docs: use Command instead of super for macOS
Command is the name Apple uses for this key and that's printed on the keyboard 😉
2025-04-03 11:03:48 +02:00
Leah Amelia Chen
6f1b22aca5 gtk(x11): fix blur regions when using >200% scaling (#6978)
See #6957

We were not considering GTK's internal scale factor that converts
between "surface coordinates" and actual device coordinates, and that
worked fine until the scale factor reached 2x (200%).

Since the code is now dependent on the scale factor (which could change
at any given moment), we also listen to scale factor changes and then
unconditionally call `winproto.syncAppearance`. Even though it's
somewhat overkill, I don't expect people to change their scale factor
dramatically all the time anyway...
2025-04-02 17:38:27 +02:00
Leah Amelia Chen
969839acf3 gtk(x11): fix blur regions when using >200% scaling
See #6957

We were not considering GTK's internal scale factor that converts between
"surface coordinates" and actual device coordinates, and that worked fine
until the scale factor reached 2x (200%).

Since the code is now dependent on the scale factor (which could change
at any given moment), we also listen to scale factor changes and then
unconditionally call `winproto.syncAppearance`. Even though it's somewhat
overkill, I don't expect people to change their scale factor dramatically
all the time anyway...
2025-04-02 17:21:28 +02:00
RubenRME
a92e761c09 fix: added locale to il8n.zig 2025-03-31 12:51:19 +02:00
RubenRME
62bbad96b1 fix: fixed missing translation key at line 250 2025-03-31 12:48:51 +02:00
RubenRME
1c73f757df lang: added Korean language file 2025-03-31 03:46:41 +02:00
Jeffrey C. Ollie
1067cd3d8a core: update libvaxis and zf for transitive zigimg dependency (#6947) 2025-03-28 14:55:28 -05:00
Jeffrey C. Ollie
9f57a03926 core: update libvaxis and zf for transitive zigimg dependency 2025-03-28 14:31:57 -05:00
Mitchell Hashimoto
0afb922375 macos: reset the last command key state when keyDown event (#6933)
Fixes a regression from #6909
See #6887

In certain scenarios, the last command key state would linger around (I
could only see this happen with global keybinds for unknown reasons
yet). This state is only meant to have an effect within the cycle of a
single keybind and only so we can ensure an event reaches keyDown so it
should be reset if keyDown is ever sent (since, by definition at that
point, keyDown has been reached).

I'm still not happy that this is necessary and I suspect there is a
better root cause to resolve, but I'd rather get this fix in now and
figure out the root cause later.
2025-03-27 07:50:33 -07:00
Mitchell Hashimoto
99843cf54d macos: reset the last command key state when keyDown event
Fixes a regression from #6909
See #6887

In certain scenarios, the last command key state would linger around (I
could only see this happen with global keybinds for unknown reasons
yet). This state is only meant to have an effect within the cycle of a
single keybind and only so we can ensure an event reaches keyDown so it should
be reset if keyDown is ever sent (since, by definition at that point,
keyDown has been reached).

I'm still not happy that this is necessary and I suspect there is a
better root cause to resolve, but I'd rather get this fix in now and
figure out the root cause later.
2025-03-27 07:22:05 -07:00
Jeffrey C. Ollie
1c3693c383 version bump for development (#6928) 2025-03-26 23:46:59 -05:00
Jeffrey C. Ollie
27978ef4d0 version bump for development 2025-03-26 23:29:15 -05:00
Leah Amelia Chen
494279419a gtk: use up-to-date maximized & fullscreen state in syncAppearance (#6924)
DerivedConfig's maximize and fullscreen should only ever be used during
window creation and nowhere else.
2025-03-26 20:33:55 +01:00
Leah Amelia Chen
ae3e92a3fb gtk: use up-to-date maximized & fullscreen state in syncAppearance
DerivedConfig's maximize and fullscreen should only ever be used during
window creation and nowhere else.
2025-03-26 20:15:18 +01:00
Jeffrey C. Ollie
ed4260b3c2 fix: escape characters in shell escape test (#6925)
Fix the escape.

Sorry again for the inconveniences. Let's check if the test is now green
2025-03-26 14:14:38 -05:00
Ian den Hartog
18cc119ced fix: escape characters in shell escape test 2025-03-26 19:52:36 +01:00
Jeffrey C. Ollie
613857cf7e fix: add ( and ) to escape characters when dropping files in gtk (#6922)
Currently when dropping files in gtk with file names that include ( or )
will generate a bash error.

With this change ( and ) will be escaped.
2025-03-26 13:38:10 -05:00
Ian den Hartog
447a889559 fix: add ( and ) to escape characters when dropping files in gtk 2025-03-26 19:30:07 +01:00
Mitchell Hashimoto
837cdf0556 Metal: fix crunchy constrained glyphs (#6914)
Fixes problem pointed out in discussion #6895, as well as adjusting the
constraint logic to account for the offset, since I noticed it was
wrong; the constraint logic now accounts for the x offset, so that the
glyph does not exceed the right edge of the constraint width when the
offset is added, and the offset is zeroed if the glyph is resized down
to fit the constraint width.

|**Before**|**After**|
|-|-|
|<img width="84" alt="image"
src="https://github.com/user-attachments/assets/9561ca40-cfa0-4aed-b192-ee15042d8cbb"
/>|<img width="82" alt="image"
src="https://github.com/user-attachments/assets/9a77ac61-f46d-41de-a859-2b394024f7bc"
/>|

<sup>Zoom in to images for detail if you can't see the
crunchiness.</sup>

> [!NOTE]
> It may be an issue that that glyph is rendered with the constrained
text mode in the first place - Kitty doesn't seem to apply constraint
logic to it, and it seems a little over-eager to do so on our part. This
is something to look in to.
2025-03-26 11:20:14 -07:00
Qwerasd
e96f94d8d7 fix(Metal): improve constraint width logic to account for x offset 2025-03-25 21:14:38 -06:00
Qwerasd
6f9a362a4d fix(Metal): fix crunchy appearance of constrained glyphs
We can't use nearest neighbor filtering for sampling from the atlas
because we might not actually be doing pixel perfect sampling if the
glyph has been constrained. This will change in the future, but this
will have to be set to linear for now.
2025-03-25 20:57:08 -06:00
Mitchell Hashimoto
bcff4e18f4 macos: remove special-case cmd+period handling, redispatch unhandled doCommand (#6909)
Fixes #5522

This commit re-dispatches command inputs that are unhandled by our macOS
app so they can be encoded to the pty and handled by the core libghostty
key callback system.

We've had a special case `cmd+period` handling in Ghostty for a very
long time (since well into the private beta). `cmd+period` by default
binds to "cancel" in macOS, so it doesn't encode to the pty. We don't
handle "cancel" in any meaningful way in Ghostty, so we special-cased it
to encode properly to the pty.

However, as shown in #5522, if the user rebinds `cmd+period` at the
system level to some other operation, then this is ignored and we encode
it still. This isn't desirable, we just want to work around not caring
about "cancel."

The callback path that AppKit takes for key events is a bit convoluted.
For command keys, it first calls `performKeyEquivalent`. If this returns
false (we want to continue standard processing), then it calls EITHER
`keyDown` or `doCommand(by:)`. It calls the latter if there is a
standard system command that matches the key event. For `cmd+period` by
default, this is "cancel." Unfortunately, from `doCommand` we can't say
"oops, we don't want to handle this, please continue processing." Its
too late.

So, this commit stores the last command key event from
`performKeyEquivalent` and if we reach `doCommand` for it without having
called `keyDown`, we re-dispatch the event and send it to keyDown.

I'm honestly pretty sus about this whole logic but it is scoped to only
command-keys and I couldn't trigger any adverse behavior in my testing.
It also definitely fixed #5522 as far as I could reproduce it before.
2025-03-25 15:18:54 -07:00
Mitchell Hashimoto
67f47a6e22 macos: remove special-case cmd+period handling
Fixes #5522

This commit re-dispatches command inputs that are unhandled by our macOS
app so they can be encoded to the pty and handled by the core libghostty
key callback system.

We've had a special case `cmd+period` handling in Ghostty for a very
long time (since well into the private beta). `cmd+period` by default
binds to "cancel" in macOS, so it doesn't encode to the pty. We don't
handle "cancel" in any meaningful way in Ghostty, so we special-cased it
to encode properly to the pty.

However, as shown in #5522, if the user rebinds `cmd+period` at the
system level to some other operation, then this is ignored and we encode
it still. This isn't desirable, we just want to work around not caring
about "cancel."

The callback path that AppKit takes for key events is a bit convoluted.
For command keys, it first calls `performKeyEquivalent`. If this returns
false (we want to continue standard processing), then it calls EITHER
`keyDown` or `doCommand(by:)`. It calls the latter if there is a
standard system command that matches the key event. For `cmd+period` by
default, this is "cancel." Unfortunately, from `doCommand` we can't say
"oops, we don't want to handle this, please continue processing." Its
too late.

So, this commit stores the last command key event from
`performKeyEquivalent` and if we reach `doCommand` for it without having
called `keyDown`, we re-dispatch the event and send it to keyDown.

I'm honestly pretty sus about this whole logic but it is scoped to only
command-keys and I couldn't trigger any adverse behavior in my testing.
It also definitely fixed #5522 as far as I could reproduce it before.
2025-03-25 15:03:27 -07:00
Aaron Ruan
416b617de9 fix canonicalizing some zh locales (#6885)
resolve #6870

---------

Signed-off-by: Aaron Ruan <i@ar212.com>
2025-03-25 14:46:14 +00:00
Andrej Daskalov
6c3accede8 remove extra punctuation
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-03-25 09:53:18 +01:00
Andrej Daskalov
7915ef5661 moved mk locale to bottom of list 2025-03-25 09:48:51 +01:00
Andrej Daskalov
6e6689d825 Merge branch 'main' into mk-localization 2025-03-25 09:46:56 +01:00
Mitchell Hashimoto
5d9bee98e8 pl_PL translations (#6771)
The initial take on the `pl_PL` translation.
2025-03-24 10:43:47 -07:00
Bartosz Sokorski
bf179207a1 Add pl_PL translations
Co-authored-by: chupson <chupson@chupson.dev>
Co-authored-by: trag1c <dev@jakubr.me>
2025-03-24 10:41:29 -07:00
Mitchell Hashimoto
150b7bdad1 feat: add Ukrainian translations and locale support (#6759)
Added the Ukrainian `uk_UA` translations.
2025-03-24 10:39:34 -07:00
Danylo Zalizchuk
20111048a4 fead: add new Ukrainian translations 2025-03-24 10:36:25 -07:00
Danylo Zalizchuk
36c7fda40b Merge branch 'main' of github.com:danulqua/ghostty 2025-03-24 10:36:25 -07:00
Danylo Zalizchuk
99da99cb9c Merge branch 'main' into main 2025-03-24 10:35:36 -07:00
Danylo Zalizchuk
b8b5882c75 fix: removed words capitalization in the Ukrainian translations 2025-03-24 10:35:18 -07:00
Danylo Zalizchuk
e6b77cf008 fix: update "Reloaded the configuration" translation 2025-03-24 10:35:18 -07:00
Danylo Zalizchuk
90a3719275 fix: reorder locales to ensure they follow ASCII ordering 2025-03-24 10:35:18 -07:00
Danylo Zalizchuk
c1bf301bc7 feat: add Ukrainian translations and locale support 2025-03-24 10:34:53 -07:00
Mitchell Hashimoto
7200c87326 pkg/harfbuzz: update 8.4 => 11.0 (#6897)
This updates our bundled Harfbuzz from 8.4 to 11.0. The changes from 8
to 11 include a number of correctness and performance improvements.
Packaged releases tend to dynamically link so this won't affect existing
users, but build-from-source users hopefully get an improvement.
2025-03-24 10:26:59 -07:00
Mitchell Hashimoto
89728070e9 pkg/harfbuzz: update 8.4 => 11.0
This updates our bundled Harfbuzz from 8.4 to 11.0. The changes from 8
to 11 include a number of correctness and performance improvements.
Packaged releases tend to dynamically link so this won't affect
existing users, but build-from-source users hopefully get an
improvement.
2025-03-24 10:04:11 -07:00
Mitchell Hashimoto
c1ef0c0369 pkg/glfw: update to HEAD as of 2025-03-24 (#6896)
We have always tracked a post-3.4 release, this brings us up to date.
There's no real motivation beyond this other than keeping up to date
since we're already on non-release versions anyways. The diff is
dominated by auto-generated headers from Wayland-scanner.
2025-03-24 10:01:30 -07:00
Mitchell Hashimoto
8cc5ee39d0 pkg/glfw: update to HEAD as of 2025-03-24
We have always tracked a post-3.4 release, this brings us up to date.
There's no real motivation beyond this other than keeping up to date
since we're already on non-release versions anyways.
2025-03-24 09:56:55 -07:00
Andrej Daskalov
13b94d995c added macedonian translation file 2025-03-23 14:41:07 +01:00
Jeffrey C. Ollie
c58fe676ad gtk: a couple more C cleanups (#6876) 2025-03-22 23:07:19 -05:00
Mitchell Hashimoto
68b8ba12c7 Update iTerm2 colorschemes (#6878)
Upstream revision:
8650079de4
2025-03-22 20:46:03 -07:00
mitchellh
8aab16b6e6 deps: Update iTerm2 color schemes 2025-03-23 00:13:47 +00:00
Mitchell Hashimoto
b722f537e7 apprt/gtk: make GL context current in unrealize (#6877)
Fixes #6872

This commit explicitly acquires the GL context in the `unrealize` signal
handler of the GTK Surface prior to cleaning up GPU resources.

A GLArea only guarantees that the associated GdkContext is current for
the `render` signal (see the docs[1]). This is why our OpenGL renderer
"defers" various operations such as resize, font grid changing, etc.
(see the `deferred_`-prefix fields in `renderer/OpenGL.zig`). However,
we missed a spot.

The `gtk-widget::unrealize` signal is emitted when the widget is
destroyed, and it is the last chance we have to clean up our GPU
resources. But it is not guaranteed that the GL context is current at
that point, and we weren't making it current. On the NGL GTK renderer,
this was freeing GPU resources we didn't own.

As best I can understand, the old GL renderer only ever used a handful
of GL resources that were early in the ID space, so by coincidence we
were probably freeing nothing and everything was fine. But with the new
NGL renderer uses a LOT more GL resources (make a few splits and the ID
space is already in the thousands, from GTK!), so we were freeing real
resources that we didn't own, which caused rendering issues. :)

I suspect the above also resulted in VRAM memory leaks (which would be
RAM memory leaks for unified memory GPUs). This potentially relates to
#5491.

The fix is to explicitly make the GL context current in the `unrealize`
handler.

[1]: https://docs.gtk.org/gtk4/method.GLArea.make_current.html
2025-03-22 14:48:51 -07:00
Mitchell Hashimoto
9d5ce6e47d apprt/gtk: remove gtk-gsk-renderer config
This was a hack, and is no longer required since #6877. Users can
explicitly override the GTK GSK renderer by setting the standard GTK env
var `GSK_RENDERER`.
2025-03-22 14:29:22 -07:00
Mitchell Hashimoto
36f841ee80 apprt/gtk: make GL context current in unrealize
Fixes #6872

This commit explicitly acquires the GL context in the `unrealize`
signal handler of the GTK Surface prior to cleaning up GPU resources.

A GLArea only guarantees that the associated GdkContext is current for
the `render` signal (see the docs[1]). This is why our OpenGL renderer
"defers" various operations such as resize, font grid changing, etc.
(see the `deferred_`-prefix fields in `renderer/OpenGL.zig`).
However, we missed a spot.

The `gtk-widget::unrealize` signal is emitted when the widget is
destroyed, and it is the last chance we have to clean up our GPU
resources. But it is not guaranteed that the GL context is current at
that point, and we weren't making it current. On the NGL GTK renderer,
this was freeing GPU resources we didn't own.

As best I can understand, the old GL renderer only ever used a handful
of GL resources that were early in the ID space, so by coincidence we
were probably freeing nothing and everything was fine. But with the new
NGL renderer uses a LOT more GL resources (make a few splits and the ID
space is already in the thousands, from GTK!), so we were freeing real
resources that we didn't own, which caused rendering issues. :)

I suspect the above also resulted in VRAM memory leaks (which would be
RAM memory leaks for unified memory GPUs). This potentially relates to
#5491.

The fix is to explicitly make the GL context current in the `unrealize`
handler.

[1]: https://docs.gtk.org/gtk4/method.GLArea.make_current.html
2025-03-22 14:20:01 -07:00
Jeffrey C. Ollie
1317e62722 gtk: a couple more C cleanups 2025-03-22 16:13:08 -05:00
Jon Parise
cd6b850758 shell-integration: minor documentation updates 2025-03-22 15:57:55 -04:00
Jon Parise
0caba3e19f shell-integration: comptime buffer capacity 2025-03-22 15:56:05 -04:00
Jon Parise
36ff70eb7f shell-integration: use elvish's native list type
Instead of looking for individual substrings in $GHOSTTY_SHELL_FEATURES,
`str:split` it into a list of feature names and use `has-value` to
detect their presence.
2025-03-22 12:26:56 -04:00
Jon Parise
77dc5c9dd2 shell-integration: use fish's native list type
Instead of looking for individual substrings in $GHOSTTY_SHELL_FEATURES,
`string split` it into a list of feature names and use `contains` to
detect their presence.
2025-03-22 12:11:51 -04:00
Jon Parise
314d52ac3a shell-integration: switch to $GHOSTTY_SHELL_FEATURES
This change consolidates all three opt-out shell integration environment
variables into a single opt-in $GHOSTTY_SHELL_FEATURES variable. Its
value is a comma-delimited list of the enabled shell feature names (e.g.
"cursor,title").

$GHOSTTY_SHELL_FEATURES is set at runtime and automatically added to the
shell environment. Its value is based on the shell-integration-features
configuration option.

$GHOSTTY_SHELL_FEATURES is only set when at least one shell feature is
enabled. It won't be set when 'shell-integration-features = false'.

$GHOSTTY_SHELL_FEATURES lists only the enabled shell feature names. We
could have alternatively gone in the opposite direction and listed the
disabled features, letting the scripts assume each feature is on by
default like we did before, but I think this explicit approach is a
little safer and easier to reason about / debug.

It also doesn't support the "no-" negation prefix used by the config
system (e.g. "cursor,no-title"). This simplifies the implementation
requirements of our (multiple) shell integration scripts, and because
$GHOSTTY_SHELL_FEATURES is derived from shell-integration-features,
the user-facing configuration interface retains that expressiveness.

$GHOSTTY_SHELL_FEATURES is intended to primarily be an internal concern:
an interface between the runtime and our shell integration scripts. It
could be used by people with particular use cases who want to manually
source those scripts, but that isn't the intended audience.

... and because the previous $GHOSTTY_SHELL_INTEGRATION_NO_* variables
were also meant to be an internal concern, this change does not include
backwards compatibility support for those names.

One last advantage of a using a single $GHOSTTY_SHELL_FEATURES variable
is that it can be easily forwarded to e.g. ssh sessions or other shell
environments.
2025-03-22 10:16:59 -04:00
Leah Amelia Chen
747c43ffa0 gtk: clean up C remnants and @ptrCasts (#6862) 2025-03-21 21:35:11 +01:00
Leah Amelia Chen
f659e70938 gtk: clean up C remnants and @ptrCasts
Some `@ptrCast`s are unavoidable in the codebase but I've gotten rid of
every one that's unnecessary.
2025-03-21 20:15:59 +01:00
Mitchell Hashimoto
4a51643043 Mention macOS' open in the CLI help messages (#6848)
> 3. If you want to live dangerously, open a pull request and hope for
the best.

Sure, why not!

---

This is a *super common* ask in both the GitHub Discussions and on
Discord; I thus decided to add a small(ish) note to the help output
directing users to try the open command. I did not include a note to
check the man page, as the text was already getting a bit long, but I
can change that if requested. Strings open for bike-shedding, of course.

Of course, feel free to close this if this is not a desirable change for
the project; I would appreciate a note about that though, rather than a
random unexpected close without any reason, as that would prevent any
future PRs about this from others.

As I do not use macOS, I was unable to test the appearance of the string
I edited in `main_ghostty.zig`.

On a slightly related note: are there any plans to translate the CLI's
strings? I assume they're in the same boat as the configuration parsing
errors which were [discussed in #maintainers] on [the Ghostty Discord].

[discussed in #maintainers]:
https://discord.com/channels/1005603569187160125/1337443701403815999/1352390511553417327
[the Ghostty Discord]: https://discord.org/ghostty
2025-03-21 07:21:27 -07:00
Kat
9a9bc43a9b Mention macOS' open in the CLI help messages. 2025-03-21 19:16:30 +11:00
Mitchell Hashimoto
1980f9aed4 font/freetype: disable SVG glyphs, simplify color check (#6824)
We don't currently support rendering SVG glyphs so they should be
ignored when loading. Additionally, the check for whether a glyph is
colored has been simplified by just checking the pixel mode of the
rendered bitmap.

This commit also fixes a bug caused by calling the color check inside of
`renderGlyph`, which caused the bitmap to be freed creating a chance for
memory corruption and garbled glyphs. This bug was introduced by 40c1140
(#6602) and discussed in #6781.
2025-03-20 11:47:02 -07:00
Mitchell Hashimoto
141b697f9d apprt/embedded: utf8 encoding buffer lifetime must extend beyond call (#6834)
Fixes #6821

UTF8 translation using KeymapDarwin requires a buffer and the buffer was
stack allocated in the coreKeyEvent call and returned from the function.
We need the buffer to live longer than this.

Long term, we're removing KeymapDarwin (there is a whole TODO comment in
there about how to do it), but this fixes a real problem today.
2025-03-19 21:47:13 -07:00
Mitchell Hashimoto
f31f8bb782 apprt/embedded: utf8 encoding buffer lifetime must extend beyond call
Fixes #6821

UTF8 translation using KeymapDarwin requires a buffer and the buffer was
stack allocated in the coreKeyEvent call and returned from the function.
We need the buffer to live longer than this.

Long term, we're removing KeymapDarwin (there is a whole TODO comment in
there about how to do it), but this fixes a real problem today.
2025-03-19 21:36:39 -07:00
Qwerasd
f0080529c4 fix(font/shape): don't require emoji presentation for grapheme parts
Also update shaper test that fails because the run iterator can't apply
that logic since `testWriteString` doesn't do proper grpaheme clustering
so the parts are actually split across multiple cells.

Several other tests are technically incorrect for the same reason but
still pass, so I've decided not to fix them here.
2025-03-19 15:09:53 -06:00
Mitchell Hashimoto
88ff566e06 ci: simplify debian 12 check (#6825)
Debian 12 CI check now relies entirely on a source tarball.
2025-03-19 13:18:41 -07:00
Mitchell Hashimoto
75045d92b4 Tweak Norwegian Bokmål translation (#6812)
This tweak is minor and fixes some grammatical errors.

I did not change `kopier` to `kopiér`, even though that is a common way
to write the word. The language council of Norway suggest writing the
word as it is written here, without the accent, but it does read weird
and allows for misunderstanding. If this was my project I would have
added the accent. Let me know if you want the accent added.

What do you think regarding the accents @Uzaaft ?
2025-03-19 13:18:05 -07:00
Mitchell Hashimoto
41130ce25f fix: inconsistent behavior from legacy and kitty Key encoding (#5728)
this fix addresses issue occurring in nvim/vim where Backspace deletes
previous letter while in preedit state.

related to #1638

> same issue reproducible
> However, that only fixed for legacy encoding.

Unanswered Discussion
https://github.com/ghostty-org/ghostty/discussions/5312<div
type='discussions-op-text'> can be closed afterwards

tested on macos sequioa IME '2-set Korean', 'Japanese Romaji'
2025-03-19 13:03:32 -07:00
Christoffer Tønnessen
9b3bd146c6 Tweak Norwegian Bokmål translation
This tweak is minor and fixes some grammatical errors.

I did not change `kopier` to `kopiér`, even though that is a common way
to write the word. The language council of Norway suggest writing the
word as it is written here, without the accent, but it does read weird
and allows for misunderstanding. If this was my project I would have
added the accent. Let me know if you want the accent added.
2025-03-19 20:46:00 +01:00
Jeffrey C. Ollie
a7a57011f0 ci: simplify debian 12 check 2025-03-19 14:44:31 -05:00
Serim Son
d61e53d6d6 Kitty key encoding should not encode backspace if UTF-8 text is present
This applies the same logic from #1659 to Kitty encoding.
2025-03-19 12:43:42 -07:00
Mitchell Hashimoto
9c064216a2 build: distribute gresource c/h with source tarball (#6822)
Closes #6760 
Supersedes #6762

This introduces the concept of a "dist resource" (specifically a
`GhosttyDist.Resource` type). This is a resource that may be present in
dist tarballs but not in the source tree. If the resource is present and
we're not in a Git checkout, then we use it directly instead of
generating it. This is a generic concept we can apply to any
preprocessing we want to do that we don't want users/packagers to do.

This is used for the first time in this commit for the gresource c/h
files, which depend on a variety of external tools (blueprint-compiler,
glib-compile-resources, etc.) that we do not want to require downstream
users/packagers to have and we also do not want to worry about them
having the right versions.

This also adds a check for `distcheck` to ensure our distribution
contains all the expected files.

Note @jcollie that there may be elements of 6762 you'll want to bring
back after this.
2025-03-19 12:10:08 -07:00
Mitchell Hashimoto
7b8c2232d3 build: distribute gresource c/h with source tarball
This introduces the concept of a "dist resource" (specifically a
`GhosttyDist.Resource` type). This is a resource that may be present in
dist tarballs but not in the source tree. If the resource is present and
we're not in a Git checkout, then we use it directly instead of
generating it.

This is used for the first time in this commit for the gresource c/h
files, which depend on a variety of external tools (blueprint-compiler,
glib-compile-resources, etc.) that we do not want to require downstream
users/packagers to have and we also do not want to worry about them
having the right versions.

This also adds a check for `distcheck` to ensure our distribution
contains all the expected files.
2025-03-19 11:52:03 -07:00
Qwerasd
6f84a5d682 font/freetype: disable SVG glyphs, simplify color check
We don't currently support rendering SVG glyphs so they should be
ignored when loading. Additionally, the check for whether a glyph is
colored has been simplified by just checking the pixel mode of the
rendered bitmap.

This commit also fixes a bug caused by calling the color check inside of
`renderGlyph`, which caused the bitmap to be freed creating a chance for
memory corruption and garbled glyphs.
2025-03-19 12:43:18 -06:00
Mitchell Hashimoto
bd315c8394 os: Add extra sentinel for GHOSTTY_RESOURCES_DIR (#6814)
Discover resourcesdir with `terminfo/g/ghostty`
as well as existing `terminfo/x/xterm-ghostty`.
This allows either terminfo file to be installed,
notably ncurses only provides a `terminfo/g/ghostty`.

It was brought up that the `ncurses-term` package on Fedora 42 at
<https://packages.fedoraproject.org/pkgs/ncurses/ncurses-term/fedora-42.html>
now provides a `/g/ghostty` terminfo entry which conflicts with
installing the similarly named file from ghostty's build process.
However a build with `zig build -Demit-terminfo=false` won't work as the
`x/xterm-ghostty` terminfo entry is used as a sentinel to discover the
`GHOSTTY_RESOURCES_DIR` used as a reference path for finding locale and
theme files.

```
src/Surface.zig|546 col 43| .resources_dir = global_state.resources_dir,
src/cli/list_themes.zig|112 col 22| if (global_state.resources_dir == null)
src/global.zig|38 col 5| resources_dir: ?[]const u8,
src/global.zig|173 col 14| self.resources_dir = try internal_os.resourcesDir(self.alloc);
src/global.zig|174 col 27| errdefer if (self.resources_dir) |dir| self.alloc.free(dir);
src/global.zig|177 col 18| if (self.resources_dir) |v| internal_os.i18n.init(v) catch |err| {
src/global.zig|185 col 18| if (self.resources_dir) |dir| self.alloc.free(dir);
```

We also have some comments that intend to change how the terminfo
database is discovered.

https://github.com/ghostty-org/ghostty/blob/main/src/termio/Exec.zig#L776C1-L781C60
2025-03-19 09:04:17 -07:00
Mitchell Hashimoto
403b3617f7 update translations 2025-03-19 08:54:30 -07:00
Mitchell Hashimoto
39d4cc3702 update CODEOWNERS 2025-03-19 08:52:39 -07:00
Danylo Zalizchuk
55c221c572 Merge branch 'main' into main 2025-03-19 08:52:14 -07:00
Danylo Zalizchuk
15efb913bf fix: removed words capitalization in the Ukrainian translations 2025-03-19 08:51:53 -07:00
Danylo Zalizchuk
f412237106 fix: update "Reloaded the configuration" translation 2025-03-19 08:51:53 -07:00
Danylo Zalizchuk
cb7180ef77 fix: reorder locales to ensure they follow ASCII ordering 2025-03-19 08:51:53 -07:00
Danylo Zalizchuk
e93be23f68 feat: add Ukrainian translations and locale support 2025-03-19 08:51:11 -07:00
Mitchell Hashimoto
bfec219510 Regenerate translations to fix CI (#6820)
I don't see any actual changes here, just reordering. It's using the Nix
environment so I'm not sure why this happened but it seemed to stem from
the Norwegian work originally. Fixing it back.
2025-03-19 08:39:00 -07:00
Mitchell Hashimoto
e56002e149 Regenerate translations.
I don't see any actual changes here, just reordering. It's using the Nix
environment so I'm not sure why this happened but it seemed to stem from
the Norwegian work originally. Fixing it back.
2025-03-19 08:35:39 -07:00
Leah Amelia Chen
907e62aa29 Fix typo: Alejanda → Alejandra in README.md (#6817) 2025-03-19 14:03:38 +01:00
CKay9
dc21ea9998 Fix typo: Alejanda → Alejandra in README.md 2025-03-19 13:38:38 +01:00
azhn
c5b1961c6b os: Add extra sentinel for GHOSTTY_RESOURCES_DIR
Discover resourcesdir with `terminfo/g/ghostty`
as well as existing `terminfo/x/xterm-ghostty`.
This allows either terminfo file to be installed,
notably ncurses only provides a `terminfo/g/ghostty`.
2025-03-19 20:49:02 +11:00
Mitchell Hashimoto
bd7c5cc95f Add Norwegian Bokmål Translations (#6731)
Pull request to add Norwegian Bokmål translations.
Asking assistance from @Uzaaft for review and help.
2025-03-18 16:04:41 -07:00
hanna
02bfa946d5 i18n: add norwegian bokmal translations 2025-03-18 15:44:46 -07:00
Mitchell Hashimoto
f7999444eb ci: zig fmt check (#6802)
This adds a CI test to ensure that all Zig files are properly formatted.
This avoids unrelated diff noise in future PRs.

This also runs `zig fmt` once to clean up all formatting issues for
future PRs.

I also introduced a new `xsm` (extra small) runner profile to use less
resources for our tiny tasks.
2025-03-18 14:39:34 -07:00
Jeffrey C. Ollie
07ec421cd3 CI: Add checks for blueprint compiler / Nix refactors (#6801)
1. Refactored Nix devshell/package to make it easier to keep
LD_LIBRARY_PATH & buildInputs in sync (plus make it easier to re-use in
other Nix environment).
2. Added a CI job to ensure that Blueprints are formatted correctly and
that they will compile using `blueprint-compiler` 0.16.0.
3. Reformatted all Blueprints with `blueprint-compiler format`.
2025-03-18 16:37:34 -05:00
Jeffrey C. Ollie
648e0a06ab CI: Add checks for blueprint compiler / Nix refactors
1. Refactored Nix devshell/package to make it easier to keep
   LD_LIBRARY_PATH & buildInputs in sync (plus make it easier to re-use
   in other Nix environment).
2. Added a CI job to ensure that Blueprints are formatted correctly and
   that they will compile using `blueprint-compiler` 0.16.0.
3. Reformatted all Blueprints with `blueprint-compiler format`.
2025-03-18 16:12:49 -05:00
Mitchell Hashimoto
4d0bf303c6 ci: zig fmt check
This adds a CI test to ensure that all Zig files are properly formatted.
This avoids unrelated diff noise in future PRs.
2025-03-18 13:58:49 -07:00
Mitchell Hashimoto
c0f5f913c9 zig build dist and distcheck for source tarballs (#6800)
This moves the source tarball creation process into the Zig build system
and follows the autotools-standard naming conventions of `dist` and
`distcheck`.

This doesn't change any of our build process otherwise. This is the
foundation for #6760 along with other source tarball tasks I have
planned (i.e. gobject bindings too).

The `dist` target creates a source tarball in the `PREFIX/dist`
directory. The tarball is named `ghostty-VERSION.tar.gz` as expected by
standard source tarball conventions.

The `distcheck` target does the same as `dist`, but also takes the
resulting tarball, extracts it, and runs tests on the extracted source
to verify the source tarball works as expected. Distcheck currently only
runs `zig build test` but in the future we can add additional checks to
run.

This commit also updates CI:

  1. Tagged releases now use the new `zig build distcheck` command.
  2. Tip releases now use the new `zig build dist` command.
3. A new test build tests that source tarball generation works on every
commit.
2025-03-18 13:21:24 -07:00
Mitchell Hashimoto
bab8c28c8b zig build dist and distcheck for source tarballs
This moves the source tarball creation process into the Zig build system
and follows the autotools-standard naming conventions of `dist` and
`distcheck`.

The `dist` target creates a source tarball in the `PREFIX/dist`
directory. The tarball is named `ghostty-VERSION.tar.gz` as expected by
standard source tarball conventions.

The `distcheck` target does the same as `dist`, but also takes the
resulting tarball, extracts it, and runs tests on the extracted source
to verify the source tarball works as expected.

This commit also updates CI:

  1. Tagged releases now use the new `zig build distcheck` command.
  2. Tip releases now use the new `zig build dist` command.
  3. A new test build tests that source tarball generation works on
     every commit.
2025-03-18 12:41:55 -07:00
Leah Amelia Chen
69590c80a1 gtk: unify gtk/adwaita version checks, use std.SemanticVersion in all cases (#6797) 2025-03-18 20:35:34 +01:00
Jeffrey C. Ollie
5bf10dce12 c804cd3dbb0274f3271736e0b8f279795bdff394 2025-03-18 14:14:50 -05:00
Jeffrey C. Ollie
0f2f0ab69f Update Adwaita version check for Box unref (#6796)
As of Adwaita 1.5.0, the GTK Box is not being properly unref'd when the
parent window is closed. Update the conditional to account for this.

Also add a couple of missing unref()s in errdefers.

This fixes an issue where Ghostty would not properly quit after closing
the last surface.
https://github.com/ghostty-org/ghostty/discussions/3807 is related
(though I'm not sure it's the exact same problem).
2025-03-18 10:42:00 -05:00
Gregory Anders
946c0c370f Update Adwaita version check for Box unref
As of Adwaita 1.5.0, the GTK Box is not being properly unref'd when the
parent window is closed. Update the conditional to account for this.

Also add a couple of missing unref()s in errdefers.
2025-03-18 10:24:42 -05:00
Jeffrey C. Ollie
ee78a3d345 gtk: remove c.zig (#6792)
It has been done.
2025-03-18 09:59:23 -05:00
Leah Amelia Chen
72017ea4d8 translations(zh_CN): update 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
8c0ccfc5b3 translations: update 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
a773588c99 gtk: remove c.zig
It has been done.
2025-03-18 12:35:41 +01:00
Leah Amelia Chen
73341b052b gtk: port ConfigErrorsWindow to dialogs 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
1ee9c85954 gtk: port inspector & key handling to zig-gobject 2025-03-18 12:35:41 +01:00
Leah Amelia Chen
e3fbbe8fe3 ci(test/translations): ignore untranslated entries 2025-03-18 12:32:55 +01:00
Leah Amelia Chen
d75c5ec038 gtk: convert App to zig-gobject (#6787) 2025-03-18 09:14:19 +01:00
Jeffrey C. Ollie
ee95a5f3e0 gtk: convert App to zig-gobject 2025-03-17 23:39:45 -05:00
Leah Amelia Chen
742bca713d gtk: convert Window (and some related files) to zig-gobject (#6775) 2025-03-17 21:19:17 +01:00
Mitchell Hashimoto
899ab302e1 apprt/gtk: any preedit change should note a composing state (#6779)
Fixes #6772

When typing Korean with the fcitx5-hangful input method, moving between
graphemes does not trigger a preedit end/start cycle and instead just
clears the preexisting preedit and reuses the started state.

Every other input method we've tested up until now doesn't do this. We
need to mark composing set to "false" in "commit" because some input
methods on the contrary fail to ever call END.

What is the point of start/end events if they are just ignored depending
on the whim of the input method? Nothing. That's what. Its all a mess
that GTK should be protecting us from but it doesn't and now its the app
developer's problem. I'm frustrated because I feel like the point of an
app framework is to mask this kind of complexity from the app developer
and I'm playing whack-a-mole with input methods.

Well, here's another whack. Let's see if it works.
2025-03-17 11:59:33 -07:00
Mitchell Hashimoto
590eb60759 apprt/gtk: any preedit change should note a composing state
Fixes #6772

When typing Korean with the fcitx5-hangful input method, moving between
graphemes does not trigger a preedit end/start cycle and instead just
clears the preexisting preedit and reuses the started state.

Every other input method we've tested up until now doesn't do this. We
need to mark composing set to "false" in "commit" because some input
methods on the contrary fail to ever call END.

What is the point of start/end events if they are just ignored depending
on the whim of the input method? Nothing. That's what. Its all a mess
that GTK should be protecting us from but it doesn't and now its the app
developer's problem. I'm frustrated because I feel like the point of an
app framework is to mask this kind of complexity from the app developer
and I'm playing whack-a-mole with input methods.

Well, here's another whack. Let's see if it works.
2025-03-17 11:44:39 -07:00
Jeffrey C. Ollie
daa79c3598 gtk: address review comments
1. Remove usage of C header imports for gtk x11/wayland.
2. Move X11 C header imports to winproto_x11.zig
3. Clean up long line by breaking it up into multiple steps.
2025-03-17 12:35:31 -05:00
Jeffrey C. Ollie
29322535a5 gtk: convert Window (and some related files) to zig-gobject 2025-03-17 12:06:57 -05:00
Jeffrey C. Ollie
e0fe12cc05 Update Debian 12 Dockerfile (#6776)
1. Automatically detect the required Zig version rather than using a
hardcoded value.
2. Run `ghostty +version` after the build as a sanity check.
2025-03-17 11:09:47 -05:00
Jeffrey C. Ollie
1d040dd17d debian workflow: remove unused ZIG_VERSION arg 2025-03-17 10:54:44 -05:00
Jeffrey C. Ollie
7f7191dfec Update Debian 12 Dockerfile
1. Automatically detect the required Zig version rather than
using a hardcoded value.
2. Run `ghostty +version` after the build as a sanity check.
2025-03-17 10:41:17 -05:00
Jeffrey C. Ollie
a2df8e4b86 gtk: update Tab to use zig-gobject (#6729) 2025-03-17 10:39:13 -05:00
Mitchell Hashimoto
c344c320eb Update iTerm2 colorschemes (#6755)
Upstream revision:
e348884a00
2025-03-16 07:18:30 -07:00
mitchellh
291c2f541c deps: Update iTerm2 color schemes 2025-03-16 14:17:59 +00:00
Mitchell Hashimoto
f8590ce44f scroll: translate non-precision to precision (#6750)
Some wheel mice are capable of reporting fractional wheel ticks. These
mice don't necessarily report a corresponding precision scroll start
event, at least in Wayland + GTK. We can treat all discrete (ie
non-precision) events as the number of wheel ticks - for wheel mice,
yoff will be "1.0" per tick, while precision wheel mice may report
fractional values. This unifies handling of scroll events by normalizing
all events to "pixels to scroll".

We now report `mouse-scroll-multiplier` wheel or arrow events per wheel
tick (or per accumulated cell height). This means that applications
which subscribe to mouse button events will receive (by default) three
wheel events per wheel tick. For precision scrolls, they will receive
one wheel tick per line of scroll. In my opinion, this provides the best
user experience while also allowing customization of how much a
wheel tick should scroll

Reference: https://github.com/ghostty-org/ghostty/discussions/6677
2025-03-16 07:15:34 -07:00
Mitchell Hashimoto
d3424a922a update zon2nix (#6728)
Upstream is now mostly pure Zig and the build.zig.zon.* files are
generated directly by zon2nix. The JSON file is no longer used as an
intermediate file but is retained for downstream packager usage.
2025-03-16 07:13:24 -07:00
Jeffrey C. Ollie
5cd8ebdafd update zon2nix
Upstream is now mostly pure Zig and the build.zig.zon.* files are
generated directly by zon2nix. The JSON file is no longer used as an
intermediate file but is retained for downstream packager usage.
2025-03-16 01:09:52 -05:00
Jeffrey C. Ollie
3bc2b02303 build: update libvaxis and zf (#6752)
Fixes #6734
2025-03-15 23:42:49 -05:00
Jeffrey C. Ollie
ec4d110251 build: update libvaxis and zf
Fixes #6734
2025-03-15 22:06:18 -05:00
Tim Culverhouse
2018a8fd3c scroll: translate non-precision to precision
Some wheel mice are capable of reporting fractional wheel ticks. These
mice don't necessarily report a corresponding precision scroll start
event, at least in Wayland + GTK. We can treat all discrete (ie
non-precision) events as the number of wheel ticks - for wheel mice,
yoff will be "1.0" per tick, while precision wheel mice may report
fractional values. This unifies handling of scroll events by normalizing
all events to "pixels to scroll".

We now report `mouse-scroll-multiplier` wheel or arrow events per wheel
tick (or per accumulated cell height). This means that applications
which subscribe to mouse button events will receive (by default) three
wheel events per wheel tick. For precision scrolls, they will receive
one wheel tick per line of scroll. In my opinion, this provides the best
user experience while also allowing customization of how much a
wheel tick should scroll

Reference: https://github.com/ghostty-org/ghostty/discussions/6677
2025-03-15 21:35:39 -05:00
Jeffrey C. Ollie
4b1d1e0ed4 gtk: update Tab to use zig-gobject 2025-03-15 14:19:59 -05:00
Mitchell Hashimoto
644acdacdc termio, flatpak: implement process watcher with xev (#6658)
This allows `termio.Exec` to track processes spawned via
`FlatpakHostCommand`, finally allowing Ghostty to function as a Flatpak.

Alongside this is a few bug fixes:

* Don't add ghostty to PATH when running in flatpak mode since it's
unreachable.
* Correctly handle exit status returned by Flatpak. Previously this was
not processed and contains extra status bits.
* Use correct type for PID returned by Flatpak.
2025-03-15 08:09:54 -07:00
Mitchell Hashimoto
791d332a25 pkg/macos: clean up for Zig 0.14, consolidate C imports into one decl (#6736)
Fixes #6727

The major change in this commit is to consolidate all the C imports in a
single decl in main.zig. This is required for Zig 0.14. Without it, the
problem in #6727 will happen. I was never able to minimize why this
happens in order to open a Zig bug.

Beyond this, I fixed the build.zig and build.zig.zon to work with Zig
0.14 so that we can test building `pkg/macos` in isolation. There are no
downstream impacting changes in the build.zig files.
2025-03-15 07:30:05 -07:00
Leorize
009b53c45e termio, flatpak: implement process watcher with xev
This allows `termio.Exec` to track processes spawned via
`FlatpakHostCommand`, finally allowing Ghostty to function as a
Flatpak.

Alongside this is a few bug fixes:

* Don't add ghostty to PATH when running in flatpak mode since it's
  unreachable.
* Correctly handle exit status returned by Flatpak. Previously this was
  not processed and contains extra status bits.
* Use correct type for PID returned by Flatpak.
2025-03-15 07:29:13 -07:00
Mitchell Hashimoto
5ad8ea6b22 pkg/macos: clean up for Zig 0.14, consolidate C imports into one decl
Fixes #6727

The major change in this commit is to consolidate all the C imports in
a single decl in main.zig. This is required for Zig 0.14. Without it,
the problem in #6727 will happen. I was never able to minimize why this
happens in order to open a Zig bug.

Beyond this, I fixed the build.zig and build.zig.zon to work with Zig
0.14 so that we can test building `pkg/macos` in isolation. There are no
downstream impacting changes in the build.zig files.
2025-03-15 07:02:53 -07:00
Leah Amelia Chen
f8f9f7041a os: fix use of deprecated splitBackwards for Flatpak (#6733) 2025-03-15 08:02:41 +01:00
Leorize
2e6a2a148f os: fix use of deprecated splitBackwards for Flatpak 2025-03-14 23:48:59 -05:00
Mitchell Hashimoto
550edd4262 build: mark most dependencies as lazy (#6726)
Closes #6703 

Lazy dependencies are only fetched if the build script would actually
reach a usage of that dependency at runtime (when the `lazyDependency`
function is called). This can save a lot of network traffic, disk uage,
and time because we don't have to fetch and build dependencies that we
don't actually need.

Prior to this commit, Ghostty fetched almost everything for all
platforms and configurations all the time. This commit reverses that to
fetching almost nothing until it's actually needed.

There are very little downsides to doing this[1]. One downside is `zig
build --fetch` doesn't fetch lazy dependencies, but we don't rely on
this command for packaging and suggest using our custom shell script
that downloads a cached list of URLs (`build.zig.zon.txt`).

This commit doesn't cover 100% of dependencies, since some provide no
benefit to make lazy while the complexity to make them lazy is higher
(in code style typically).

Conversely, some simple dependencies are marked lazy even if they're
almost always needed if they don't introduce any real complexity to the
code, because there is very little downside to do so.

[1]: https://ziggit.dev/t/lazy-dependencies-best-dependencies/5509/5
2025-03-14 18:33:32 -07:00
Mitchell Hashimoto
cfea2ea12c build: mark most dependencies as lazy
Lazy dependencies are only fetched if the build script would actually
reach a usage of that dependency at runtime (when the `lazyDependency`
function is called). This can save a lot of network traffic, disk uage,
and time because we don't have to fetch and build dependencies that we
don't actually need.

Prior to this commit, Ghostty fetched almost everything for all
platforms and configurations all the time. This commit reverses that to
fetching almost nothing until it's actually needed.

There are very little downsides to doing this[1]. One downside is `zig
build --fetch` doesn't fetch lazy dependencies, but we don't rely on
this command for packaging and suggest using our custom shell script
that downloads a cached list of URLs (`build.zig.zon.txt`).

This commit doesn't cover 100% of dependencies, since some provide no
benefit to make lazy while the complexity to make them lazy is higher
(in code style typically).

Conversely, some simple dependencies are marked lazy even if they're
almost always needed if they don't introduce any real complexity to the
code, because there is very little downside to do so.

[1]: https://ziggit.dev/t/lazy-dependencies-best-dependencies/5509/5
2025-03-14 13:32:19 -07:00
Leah Amelia Chen
234b804872 contributing: fix link to Translator's Guide (#6712) 2025-03-14 17:29:10 +01:00
Jeffrey C. Ollie
f37d1fd7ed gtk: convert Surface to zig-gobject (#6634)
Marking this is as draft because I want to test this further before
saying that it's ready, but putting it out there for feedback.
2025-03-14 10:14:33 -05:00
Leah Amelia Chen
c2aac45848 fix: Use builtin source_env_if_exists for sourcing .envrc.local (#6717) 2025-03-14 13:33:37 +01:00
Uzair Aftab
b497400be6 fix: ignore .envrc.local 2025-03-14 13:15:29 +01:00
Uzair Aftab
ec5066988e fix: Use builtin source_env_if_exists for sourcing .envrc.local 2025-03-14 13:11:05 +01:00
Leah Amelia Chen
4ab3754a59 feat: source local .envrc if it exists (#6715) 2025-03-14 12:14:19 +01:00
Uzair Aftab
b9ea32b8ce Update .envrc
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-03-14 12:08:37 +01:00
Uzair Aftab
69dfc8870d fix: use bashism in .envrc
Co-authored-by: Leah Amelia Chen <github@acc.pluie.me>
2025-03-14 12:00:25 +01:00
Uzair Aftab
09d538b620 feat: source .envrc.local if it exists
Co-authored-by: Kat <65649991+00-kat@users.noreply.github.com>
2025-03-14 11:50:56 +01:00
Leah Amelia Chen
07b653bd71 contributing: link to po/README_CONTRIBUTORS.md 2025-03-14 08:46:06 +01:00
Leah Amelia Chen
e8101c1136 contributing: fix link to Translator's Guide
For some reason it pointed to the Contributor's Guide instead...
2025-03-14 08:44:04 +01:00
Mitchell Hashimoto
8eacde92e6 Replace mach-glfw with pkg/glfw (#6708)
Closes #6702

This removes our mach-glfw dependency and replaces it with an in-tree
pkg/glfw that includes both the source for compiling glfw as well as the
Zig bindings. This matches the pattern from our other packages.

This is based on the upstream mach-glfw work and therefore includes the
original license and copyright information.

The reasoning is stated in the issue but to summarize for the commit:

  - mach-glfw is no longer maintained, so we have to take ownership
- mach-glfw depended on some large blobs of header files to enable
cross-compilation but this isn't something we actually care about, so we
can (and do) drop the blobs
- mach-glfw blobs were hosted on mach hosts. given mach-glfw is
unmaintained, we can't rely on this hosting
- mach-glfw relied on a "glfw" package which was owned by another person
to be Zig 0.14 compatible, but we no longer need to rely on this
  - mach-glfw builds were outdated based on latest Zig practices
2025-03-13 21:18:41 -07:00
Mitchell Hashimoto
221f905a1c pkg/glfw
Closes #6702

This removes our mach-glfw dependency and replaces it with an in-tree
pkg/glfw that includes both the source for compiling glfw as well as the
Zig bindings. This matches the pattern from our other packages.

This is based on the upstream mach-glfw work and therefore includes the
original license and copyright information.

The reasoning is stated in the issue but to summarize for the commit:

  - mach-glfw is no longer maintained, so we have to take ownership
  - mach-glfw depended on some large blobs of header files to enable
    cross-compilation but this isn't something we actually care about,
    so we can (and do) drop the blobs
  - mach-glfw blobs were hosted on mach hosts. given mach-glfw is
    unmaintained, we can't rely on this hosting
  - mach-glfw relied on a "glfw" package which was owned by another
    person to be Zig 0.14 compatible, but we no longer need to rely on
    this
  - mach-glfw builds were outdated based on latest Zig practices
2025-03-13 20:52:33 -07:00
Mitchell Hashimoto
73c7943fff CODEOWNERS: add localization teams (#6704) 2025-03-13 10:19:29 -07:00
Mitchell Hashimoto
d8497d9b16 CODEOWNERS: add localization teams 2025-03-13 10:07:27 -07:00
Mitchell Hashimoto
ef0ff94c75 translations: add German translation (#6601)
This PR adds a translation for German `de_DE`.

Additionally it excludes all `*.po` files from the typos CI action.

Some comments on the decisions I made (open to discuss them):

- I choosed to use `du` instead of `Sie` as this seems appropriate
  to me.
- I added `Window` (`Fenster` in German) to all split commands
  as it appears more naturally to me.
2025-03-13 10:05:27 -07:00
Jeffrey C. Ollie
572fc8b5d7 gtk: convert Surface to zig-gobject 2025-03-13 12:04:10 -05:00
Mitchell Hashimoto
1f6b1d75eb Fix aspect ratio when rendering images with kitty protocol (#6675)
Fixes https://github.com/ghostty-org/ghostty/issues/6673

<img width="914" alt="image"
src="https://github.com/user-attachments/assets/010a1304-0d46-46ec-9a82-87a8d8fbea1b"
/>
2025-03-13 09:50:19 -07:00
Mitchell Hashimoto
aeada3f1a8 Zig 0.14 (#6699)
Closes #5744 

This gets Ghostty onto Zig 0.14. The goal of this PR is to focus only on
Zig 0.14 _compatibility_. I plan to open a number of subsequent issues
for future improvements I'd like to tackle, as noted in #5744.

I did run some basic benchmarks on a Zig 0.13 vs 0.14 build and didn't
notice any statistically significant changes. All our scrolling
benchmarks on vtebench got consistently 1 or 2ms faster but that may
just be noise. The good news is nothing got consistently slower (nothing
got slower at all on any runs!).

The Git history here is kind of nasty, I'm going to squash it.
2025-03-13 09:36:09 -07:00
Mitchell Hashimoto
f1f9db8b96 Update PACKAGING to note Zig 0.14 requirement 2025-03-13 09:18:34 -07:00
Mitchell Hashimoto
a542e63582 pkg/gtk4-layer-shell: disable ubsan 2025-03-13 09:14:37 -07:00
Mitchell Hashimoto
bdb66984b6 for iOS simulator builds for apple M1 as base CPU model 2025-03-13 07:13:13 -07:00
Mitchell Hashimoto
6613a695f0 nix 2025-03-12 16:30:22 -07:00
Mitchell Hashimoto
b96a5d702b fix mach-glfw on windows 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
66c83648c8 ci: debian 12 build should use zig 0.14 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
1dbeba7065 ci: update snap to Zig 0.14 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
fc21444f2d fix windows 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
907ed239a1 update typos 2025-03-12 16:29:17 -07:00
Mitchell Hashimoto
b123b14686 update zig2nix 2025-03-12 15:56:24 -07:00
Mitchell Hashimoto
99bde549af fix /usr/lib issues 2025-03-12 15:46:15 -07:00
Mitchell Hashimoto
1f6aa0e90d apprt/glfw: move darwin enabled const out to top-level 2025-03-12 12:53:15 -07:00
Mitchell Hashimoto
18084a3e61 update gobject, fix compiler errors 2025-03-12 12:32:50 -07:00
Mitchell Hashimoto
816ff8cef0 fix tests building on Linux 2025-03-12 11:29:13 -07:00
Mitchell Hashimoto
2e45a4c7a3 fix typos 2025-03-12 11:23:11 -07:00
Mitchell Hashimoto
3116a1b92c bundle ubsan rt 2025-03-12 11:07:15 -07:00
Mitchell Hashimoto
601acf4059 pkg/highway: upgrade to fix compilation issues on LLVM18 2025-03-12 11:03:54 -07:00
Mitchell Hashimoto
7e9be00924 working on macos 2025-03-12 10:15:14 -07:00
Mitchell Hashimoto
43467690f3 test 2025-03-12 10:04:17 -07:00
Mitchell Hashimoto
2408d4c6a9 more fixes 2025-03-12 09:59:24 -07:00
Mitchell Hashimoto
0f4d2bb237 Lots of 0.14 changes 2025-03-12 09:55:52 -07:00
Mitchell Hashimoto
86d3f18707 pkg/oniguruma: fix build 2025-03-12 09:10:17 -07:00
Bryan Lee
2f814b37e8 Add unit tests for kitty image aspect ratio calculation 2025-03-12 22:44:17 +08:00
Mitchell Hashimoto
bd848a27d2 update all packages to new hash for caching 2025-03-12 07:30:01 -07:00
Bryan Lee
f091a69790 Fix aspect ratio when rendering images with kitty protocol 2025-03-12 15:06:06 +08:00
Mitchell Hashimoto
2466de4556 pkg: update to new build.zig.zon format and hash values 2025-03-11 15:00:47 -07:00
Mitchell Hashimoto
251caeb22a Zig 0.14 fixes 2025-03-11 14:53:30 -07:00
Mitchell Hashimoto
3abbe6d3ba nix: must not inject xcrun into PATH on macOS 2025-03-11 14:49:01 -07:00
Mitchell Hashimoto
7e2286eb8c Zig 0.14 2025-03-11 14:39:04 -07:00
Leah Amelia Chen
95daca616d core: refactor RepeatablePath into separate files and add Path (#6622)
Slims down `Config.zig` and makes some of the code reusable in Path.
2025-03-10 09:14:25 +01:00
Leah Amelia Chen
14b66e93d1 pkg(gtk4-layer-shell): Enable using system-installed headers for dynamic linking (#6624)
I noticed we weren't doing system-integration against the pkgconfig for
gtk4-layer-shell. This behaviour differed from how we handled system
integration for existing deps in `pkg/` (oniguruma, fontconfig).

Refactored `pkg/gtk4-layer-shell/build.zig` referencing
`pkg/oniguruma/build.zig` to use pkgconfig names in system integration.
Previously we used to libname `libgtk4-layer-shell.so`
(`gtk4-layer-shell`) instead of pkgconfig name `gtk4-layer-shell-0.pc`
which meant system integration still relied on fetching the C-headers
via `zig fetch` instead of system C-headers.

I've tested this with a `--system` build where the relevant
`.zig-cache/p/<hash of gtk4-layer-shell>` is stubbed to an empty
directory and `pkgconfig(gtk4-layer-shell-0)` is installed instead on
fedora linux.
2025-03-10 09:11:42 +01:00
Mitchell Hashimoto
0ecee3ee92 Fix passing EnvMap for Flatpak builds (#6647)
When using -Dflatpak=true the EnvMap was passed as the incorrect type.
2025-03-09 18:39:54 -07:00
Mitchell Hashimoto
57d0a4d2e7 font(freetype): constrain emoji to cell width (#6602)
When scaling emoji (with freetype), we would unilaterally scale the
bitmap to fit within the `cell_height`. For narrow fonts, this would
result in a horizontal overflow:


![image](https://github.com/user-attachments/assets/87b9f952-6f12-40b2-bbed-5bfe948f45b4)

Modify the glyph rendering such that we scale to fit within the cell
width. After doing so, the above image looks like:


![image](https://github.com/user-attachments/assets/c75bfa51-4730-4179-b032-c3afa7840d65)

The emoji glyph is noticeably smaller because we have constrained the
height further than before, but fits perfectly within two cells. I am
using Victor Mono as my font, which is pretty narrow. The effect would
be even more pronounced on something like Iosevka.
2025-03-09 18:34:34 -07:00
Mitchell Hashimoto
480b1a9805 macOS: only set LANGUAGE for app bundle, do not inherit in termio env (#6648)
Fixes #6633

For macOS, we set LANGUAGE to the priority list of preferred languages
for the app bundle, using the GNU gettext priority list format (colon
separated list of language codes).

This previously was inherited by the termio env. At first, this was by
design, but this has inherent flaws. Namely, the priority list format is
a GNU gettext specific format, and programs that use alternate gettext
implementations (like musl or Python) do not understand it and actually
do the wrong thing (not their fault!).

This change removes the inheritance of LANGUAGE in the termio env. To
make it extra safe, we only do set and unset LANGUAGE when we know we
launch from an app bundle. That was always the desired behavior but this
makes it more explicit.
2025-03-09 17:08:55 -07:00
Mitchell Hashimoto
ebffe299ce macOS: only set LANGUAGE for app bundle, do not inherit in termio env
Fixes #6633

For macOS, we set LANGUAGE to the priority list of preferred languages
for the app bundle, using the GNU gettext priority list format (colon
separated list of language codes).

This previously was inherited by the termio env. At first, this was by
design, but this has inherent flaws. Namely, the priority list format is
a GNU gettext specific format, and programs that use alternate gettext
implementations (like musl or Python) do not understand it and actually
do the wrong thing (not their fault!).

This change removes the inheritance of LANGUAGE in the termio env. To
make it extra safe, we only do set and unset LANGUAGE when we know we
launch from an app bundle. That was always the desired behavior but this
makes it more explicit.
2025-03-09 18:17:38 -05:00
Yorick Peterse
300f4544ef Fix passing EnvMap for Flatpak builds
When using -Dflatpak=true the EnvMap was passed as the incorrect type.
2025-03-09 23:46:24 +01:00
Jeffrey C. Ollie
843cc83f42 gtk: implement quick-terminal-size (#6629)
Fixes #2384 on GTK

I'm not exactly sure how to deal with centered quick terminals so I
opted to make them similar to either top/bottom or left/right quick
terminals based on the monitor's orientation (portrait/landscape). This
may not be the right approach, so I'd like to hear more thoughts about
this.
2025-03-09 09:51:04 -05:00
Mitchell Hashimoto
78f16d040d macOS: disable setting LANGUAGE for now until bug is fixed
See: https://github.com/ghostty-org/ghostty/discussions/6633

This is temporary while we figure this out.
2025-03-09 07:25:55 -07:00
Jeffrey C. Ollie
6767493428 core: move RepeatablePath to separate file and enable Path as config type
Slim down Config.zig by moving RepeatablePath to a separate file and
enable the use of Path as it's own config type.
2025-03-09 09:18:01 -05:00
Jeffrey C. Ollie
bb3dad1309 core: all paths referenced from the CLI must be expanded 2025-03-09 09:17:57 -05:00
Mitchell Hashimoto
d3fd2b02e7 terminal: remove redundant assertIntegrity from clearPrompt (#6630)
clearCells() always asserts its page's integrity after finishing its
work (via a `defer`). We don't need to re-assert the page's integrity
immediately thereafter.
2025-03-08 14:37:23 -08:00
Mitchell Hashimoto
5efa2a6ca1 macOS: Set LANGUAGE env var based on macOS preferred language list (#6628)
Sets the LANGUAGE environment variable based on the preferred languages
as reported by NSLocale.

macOS has a concept of preferred languages separate from the system
locale. The set of preferred languages is a list in priority order of
what translations the user prefers. A user can have, for example,
"fr_FR" as their locale but "en" as their preferred language. This would
mean that they want to use French units, date formats, etc. but they
prefer English translations.

gettext uses the LANGUAGE environment variable to override only
translations and a priority order can be specified by separating the
languages with colons. For example, "en:fr" would mean that English
translations are preferred but if they are not available then French
translations should be used.

To further complicate things, Apple reports the languages in BCP-47
format which is not compatible with gettext's POSIX locale format so we
have to canonicalize them. To canonicalize the languages we use an
internal function from libintl. This isn't normally available but since
we compile from source on macOS we can use it. This isn't necessary for
other platforms.

This logic is only run if the user didn't explicitly request a specific
locale, so it should really only affect macOS app launches. From the CLI
the environment will have a locale unless the user really explicitly
clears it out.
2025-03-08 14:36:58 -08:00
Leah Amelia Chen
a0080ddad7 gtk: implement quick-terminal-size
Fixes #2384 on GTK

I'm not exactly sure how to deal with centered quick terminals so I opted
to make them similar to either top/bottom or left/right quick terminals
based on the monitor's orientation (portrait/landscape). This may not be
the right approach, so I'd like to hear more thoughts about this.
2025-03-08 22:36:24 +01:00
Jon Parise
b0b2de01f5 terminal: remove redundant assertIntegrity from clearPrompt
clearCells() always asserts its page's integrity after finishing its
work (via a `defer`). We don't need to re-assert the page's integrity
immediately thereafter.
2025-03-08 16:36:14 -05:00
Mitchell Hashimoto
b48fcf33f7 macOS: Set LANGUAGE env var based on macOS preferred language list
Sets the LANGUAGE environment variable based on the preferred languages
as reported by NSLocale.

macOS has a concept of preferred languages separate from the system
locale. The set of preferred languages is a list in priority order
of what translations the user prefers. A user can have, for example,
"fr_FR" as their locale but "en" as their preferred language. This would
mean that they want to use French units, date formats, etc. but they
prefer English translations.

gettext uses the LANGUAGE environment variable to override only
translations and a priority order can be specified by separating
the languages with colons. For example, "en:fr" would mean that
English translations are preferred but if they are not available
then French translations should be used.

To further complicate things, Apple reports the languages in BCP-47
format which is not compatible with gettext's POSIX locale format so
we have to canonicalize them. To canonicalize the languages we use
an internal function from libintl. This isn't normally available but
since we compile from source on macOS we can use it. This isn't
necessary for other platforms.
2025-03-08 12:54:39 -08:00
azhn
35aab1a302 build: use pkgconfig name for gtk4-layer-shell system integration
By linking using the pkg-config name we gain the compiler flags in pkgconf
for linking, specifically the -I <headers> to include system-installed
headers. This allows the gtk4-layer-shell pkg to not require the source
files specified in the `pkg/gtk4-layer-shell/build.zig.zon`.

pkg(gtk4-layer-shell): Refactor to allow dynamic linking

Refactored `pkg/gtk4-layer-shell/build.zig` to have similar structure
to `pkg/oniguruma/build.zig`.

Now dynamic link using pkgconfig, this adds pkgconfig compiler flags.
So we are now using system-installed headers to resolve @cInclude().
2025-03-09 02:46:33 +11:00
Robin Pfäffle
c67c7da582 translations(german): fix fuzzy translations 2025-03-08 09:24:54 +01:00
Robin Pfäffle
9d86bdfe72 translations: add de_DE to locales 2025-03-08 08:23:33 +01:00
Robin Pfäffle
abb97fa574 translations(german): update de_DE strings 2025-03-08 08:11:43 +01:00
Robin Pfäffle
7e268b9a43 ci: typos ignore *.po files 2025-03-08 08:11:43 +01:00
Robin Pfäffle
d2931b5d8f translations(german): address review comments 2025-03-08 08:11:41 +01:00
Robin Pfäffle
2ef11fb65f translations(german): add missing warning indicator 2025-03-08 08:08:51 +01:00
Robin Pfäffle
d511b3601d translations: add German translation 2025-03-08 08:08:51 +01:00
Mitchell Hashimoto
e03e98e106 Groundwork for cross-platform i18n with libintl for libghostty/macOS (#6619)
This builds on @pluiedev's excellent #6004.

## Background: The macOS (and libghostty consumer) Plan

Broadly, the decision I've come to is that for cross-platform
translations (i.e. strings shared across libghostty), we will be using
gettext and libghostty will export helper methods to call those (e.g.
`ghostty_translate` in this PR for singular forms). To be clear, **this
only applies to strings owned by libghostty**. For application-level
strings such as macOS-specific menu items and so on, we still have
choice but will likely using native features.

The reason for this is because converting gettext translations (`po`) to
native formats (Xcode String Catalog, `.strings`/`.stringsdict`) is
nightmare level, in particular for plural forms. I don't see a robust
path to doing it. And if we don't convert and don't use gettext, then
translators would have to maintain an identical translation in multiple
locations. To make matters worse, the macOS translation formats require
Apple-tooling for now unless you want to edit raw JSON.

Leveraging gettext lets us share translations across platforms and take
advantage of proven tech.

## PR Contents

**`pkg/libintl` builds and statically links libintl for macOS.** macOS
doesn't ship libintl with the system while Linux generally does with
libc, so we need to build this ourselves. This makes gettext available
to macOS. libintl is LGPL and we remain in compliance with that despite
static linking because our build process is fully open source, so
downstream consumers can modify our build scripts to replace it if they
wanted to.

~~**`src/os/locale.zig` now sets the `LANGUAGE` environment variable on
macOS based on the app's preferred languages.** macOS lets you configure
the system locale separate from preferred language. We previously relied
solely on `NSLocale.currentLocale`, but this only represents the system
locale. We now also look at `NSLocale.preferredLanguages` (a list in
priority order) and if we support a given language we set `LANGUAGE` so
gettext translates properly. Notably, the above lets us debug
translations in Xcode by setting alternate languages for debug builds
only.~~ Removed this for a future PR since it was problematic.

**`build.zig` unconditionally builds binary `mo` files** since they're
required for all apprts now.

**The macOS app bundles the translation strings.** This includes our
GTK-specific translation strings but the size of these is so small it
isn't worth the complexity of splitting up into multiple `pot`s at this
time, I think.

**i18n APIs moved to `src/os` from `src/apprt/gtk`.** Since these are
now cross-platform/cross-apprt, they're a core API. The only notable
change here is that `_` now maps to `dgettext` and explicitly specifies
our domain so that it's library-friendly. The GTK apprt calls
`initGlobalDomain` so that blueprint translations still work.

## Next Steps

This PR is all groundwork. The macOS app doesn't leverage any of this
yet, although I've verified it all works (e.g. calling the
`ghostty_translate` API from Swift).

For next steps, we need to have a use case for cross-platform
translations and the first one I was looking at was configuration error
messages and other core strings.
2025-03-07 14:51:12 -08:00
Mitchell Hashimoto
dcb8440b52 os: remove the preferredLanguages lookup 2025-03-07 13:43:00 -08:00
Mitchell Hashimoto
7eddf98269 Fix typos 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
da731e6caa typo i81n -> i18n 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
79a9ddf66f build: pure libghostty builds need to build translations 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
e8a988f6d3 os: i18n unsupported on windows 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
c7681e8fd7 apprt/gtk: use the new global i18n API 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
cff092f4c6 nix: update hashes 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
3ebd5b839f update translating readme 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
be839cb681 update our gitattributes with new generated files 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
3c49bc5086 os: locale automatically sets LANGUAGE based on macOS preferred 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
edf619205c add ghostty_translate C API 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
238573d42e i18n: export proper _ function 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
4cf127a064 build: i18n should emit mo on every platform 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
e8c20b5501 pkg/libintl: fix missing symbols 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
cb8085ab72 global state initializes i18n 2025-03-07 13:42:00 -08:00
Mitchell Hashimoto
dd95f727ec build: add libintl for macOS builds 2025-03-07 13:41:59 -08:00
Mitchell Hashimoto
67488754d5 pkg/libintl 2025-03-07 13:41:59 -08:00
Leah Amelia Chen
4a215a9518 gtk: use AdwAlertDialog for close dialogs, fix incorrect close dialogs (#5741)
AdwAlertDialog is the recommended way to do alert/message dialogs
starting from libadwaita 1.5, and is much easier to manage than
GtkMessageDialog. (The latter is also deprecated since GTK 4.10, but
this PR does not migrate it to use GtkAlertDialog, mostly because of its
obtuse interface and that we'll remove the GtkMessageDialog code anyway
in 1.2 when we remove non-Adwaita builds.)

We also had two bugs where tabs with only one split would display the
"close surface" confirmation dialog, and windows would do the same when
closed via the "Close Window" menu item or by the `close_window` keybind
action. (The "close window" dialog only appears when the user clicks on
the close button on the titlebar.) Initially I was very confused by
this, but it turns out that we don't have any apprt action related to
closing a window, and it was simply closing surfaces...
2025-03-07 20:46:23 +01:00
Leah Amelia Chen
b25da6b9c4 core: update zig2nix to use explicit Zig version from Nix (#6617)
This will avoid build breakage in the near future as Zig 0.14 is coming
to Nix.
2025-03-07 20:42:13 +01:00
Jeffrey C. Ollie
3ba4864f6c core: update zig2nix to use explicit Zig version from Nix
This will avoid build breakage in the near future as Zig 0.14 is coming
to Nix.
2025-03-07 11:46:30 -06:00
Leah Amelia Chen
77e16770cc gtk: build gtk4-layer-shell ourselves (#6614)
As of now `gtk4-layer-shell` is unavailable on recent, stable releases
of many distros (Debian 12, Ubuntu 24.04, openSUSE Leap & Tumbleweed,
etc.) and outdated on many others (Nixpkgs 24.11/unstable, Fedora 41,
etc.) This is inconvenient for our users and severely limits where the
quick terminal can be used. As a result we then build gtk4-layer-shell
ourselves by default unless `--system` or `-fsys=gtk4-layer-shell` are
specified. This also allows me to add an idiomatic Zig API on top of the
library and avoiding adding even more raw C code in the GTK apprt.

Since we now build gtk4-layer-shell it should be theoretically available
on all Linux systems we target. As such, the `-Dgtk-layer-shell` build
option has been removed. This is somewhat of an experimental change as I
don't know if gtk4-layer-shell works perfectly across all distros, and
we can always add the option back if need be.
2025-03-07 18:19:49 +01:00
Leah Amelia Chen
cd442eb9e2 gtk: build gtk4-layer-shell ourselves
As of now `gtk4-layer-shell` is unavailable on recent, stable releases
of many distros (Debian 12, Ubuntu 24.04, openSUSE Leap & Tumbleweed, etc.)
and outdated on many others (Nixpkgs 24.11/unstable, Fedora 41, etc.)
This is inconvenient for our users and severely limits where the quick
terminal can be used. As a result we then build gtk4-layer-shell ourselves
by default unless `--system` or `-fsys=gtk4-layer-shell` are specified.
This also allows me to add an idiomatic Zig API on top of the library
and avoiding adding even more raw C code in the GTK apprt.

Since we now build gtk4-layer-shell it should be theoretically available
on all Linux systems we target. As such, the `-Dgtk-layer-shell` build
option has been removed. This is somewhat of an experimental change as
I don't know if gtk4-layer-shell works perfectly across all distros, and
we can always add the option back if need be.
2025-03-07 17:52:06 +01:00
Leah Amelia Chen
6c00c36d62 config: make quick-terminal-autohide=false on Linux (#6613)
See diff for explanation
2025-03-07 17:36:05 +01:00
Leah Amelia Chen
9ed76729ab gtk: add separate close_window apprt action
For *some* reason we have a binding for close_window but it merely closes
the surface and not the entire window. That is not only misleading but
also just wrong. Now we make a separate apprt action for close_window
that would make it show a close confirmation prompt identical to as if
the user had clicked the (X) button on the window titlebar.
2025-03-06 20:32:38 +01:00
Leah Amelia Chen
b4bfdb2c44 translation: update template & zh_CN strings 2025-03-06 20:32:30 +01:00
Leah Amelia Chen
23d2d4ec70 gtk: use AdwAlertDialog for close dialogs 2025-03-06 20:32:30 +01:00
Tim Culverhouse
40c1140f7d font(freetype): constrain emoji to 2 cells wide
When scaling emoji, scale so that they entirely fit within 2 cells. The
previous behavior was to scale to fill vertically, however with fonts
which are narrow this would result in horizontal overflow.
2025-03-06 10:46:58 -06:00
Tim Culverhouse
27c4fd76f3 renderer(OpenGL): pass cell_width to glyph renderer
When adding a glyph, we didn't pass the expected width to the glyph
renderer. This can be helpful when scaling emoji, as will happen in the
next commit.
2025-03-06 09:59:24 -06:00
Tim Culverhouse
22ed08cfd8 chore: zig fmt 2025-03-06 09:59:24 -06:00
Leah Amelia Chen
260a90cbf0 config: make quick-terminal-autohide=false on Linux
See diff for explanation
2025-03-06 12:38:23 +01:00
Leah Amelia Chen
e07b6fdf6b gtk: implement quick terminal slide & autohide (#6090) 2025-03-05 23:20:03 +01:00
Leah Amelia Chen
44d4990eb2 gtk: implement quick-terminal-autohide 2025-03-05 21:51:35 +01:00
Leah Amelia Chen
58b0434092 docs: update information about quick terminal support on Linux 2025-03-05 21:37:49 +01:00
Jeffrey C. Ollie
d6bd7b56b3 gtk: implement sensitive content reveal on paste confirmation (#6054)
Fixes https://github.com/ghostty-org/ghostty/issues/4947 for gtk
This PR implements the senstive content hiding when displaying the paste
confirmation dialog in secure input mode.

Following changes are implemented:
- in the blueprint for each dialog add a show/hide button that is not
visible by default, and a Revealer that is revealed by default
- save the `secure_input` action value for each surface in the GTK apprt
- pass the value when initializing the paste confirmation dialog
- in the dialog code, alter the visibility of the content and
reveal/hide buttons based on secure input flag value

Demo:


https://github.com/user-attachments/assets/c91cbd3d-ed3b-464d-b4cf-e51fe7aa23b7

I feel like this is already a nearly full implementation, but I'm
leaving this as a draft for now, since i need to look into blueprints
for Adwaita 1.2, and verify if it behaves properly when the dialog is in
not-sensitive input mode and in OSC52 mode.
2025-03-05 14:27:13 -06:00
Leah Amelia Chen
8f7425f78c gtk: implement quick terminal slide animation
Yet another protocol that as far as I know only KWin implements.
Oh well, might as well let KDE users such as myself enjoy it OOTB
2025-03-05 21:13:13 +01:00
Maciej Bartczak
bd617c52e9 code review:
- implement blueprints for Adwaita 1.2
- use postifx notation for casting gtk widgets
- fix formatting
2025-03-05 21:03:02 +01:00
Maciej Bartczak
f71b294697 gtk: new approach to reveal/hide buttons 2025-03-05 21:03:02 +01:00
Maciej Bartczak
7123d4e055 gtk: blur the content view instead of using a Revealer widget 2025-03-05 21:03:02 +01:00
Maciej Bartczak
1f695c2646 gtk: implement sensitive content reveal mechanism when showing paste confirmation in secure input mode 2025-03-05 21:02:58 +01:00
Jeffrey C. Ollie
58adaffcb9 gtk: don't modify horizontal alignment on menus that have arrows (#6087)
Setting the horizontal alignment to start on popover menus that have
arrows results in visual anomalies:


![image](https://github.com/user-attachments/assets/fef279a3-73cf-4717-9b32-605ccd48c934)

From Discord:

https://discord.com/channels/1005603569187160125/1346819853612482571
2025-03-05 13:42:50 -06:00
Jeffrey C. Ollie
8f62901218 gtk: don't modify horizontal alignment on menus that have arrows 2025-03-05 13:28:57 -06:00
Leah Amelia Chen
2f65f01fc8 gtk: add localization support, take 3 (#6004)
This is my third (!) attempt at implementing localization support. By
leveraging GTK builder to do most of the `gettext` calls, I can avoid
the whole mess about missing symbols on non-glibc platforms.

Added some documentation too for contributors and translators, just for
good measure.

Supersedes #5214, resolves the GTK half of #2357
2025-03-05 20:12:52 +01:00
Mitchell Hashimoto
66e8d91957 Make equalize_splits action only affect current window (#6080)
Fixes #6064 


https://github.com/user-attachments/assets/bbf393be-de98-41eb-aaad-3a185705ed4c
2025-03-04 07:36:00 -08:00
Ken VanDine
fd6e4fd615 fix: Generate pixbuf loader cache on start if needed, fixes #6066 (#6079)
This fix ensures the correct pixbuf loaders are used, not mixing in
libraries from the host.
2025-03-04 09:38:23 -05:00
Bryan Lee
423bc1971b Make equalize_splits action only affect current window 2025-03-04 22:37:32 +08:00
Ken VanDine
2c6e6ad680 fix: Generate pixbuf loader cache on start if needed, fixes #6066 2025-03-04 08:50:11 -05:00
Leah Amelia Chen
6373399e59 os: deprioritize GHOSTTY_RESOURCES_DIR for debug builds
When one develops Ghostty while using Ghostty it could lead to an
interesting conundrum: the freshly built Ghostty would use the parent
Ghostty's resources, which would be stale and not reflect any new
changes to resources. This is especially bad for translators, since
their translations would not be reflected in the newly built Ghostty
if they happen to run it under older Ghostty, which is not only
counterintuitive and also painful in terms of workflow.

Now, on debug builds we always try to use the terminfo detection method
first in order to locate the zig-out/share/ghostty folder, and only fall
back to GHOSTTY_RESOURCES_DIR if the executable is for some reason no
longer in zig-out. You can test this behavior by manually moving the
Ghostty executable out of zig-out, and then launching it with and without
Ghostty.
2025-03-03 10:19:58 +01:00
Mitchell Hashimoto
6b1a017a86 build: some style changes, namely we should create steps only in root 2025-03-03 10:19:58 +01:00
Leah Amelia Chen
e252932bde translations: add basic Chinese translation 2025-03-03 10:19:58 +01:00
Leah Amelia Chen
9c97084ad0 gtk: extract translations from Zig source code 2025-03-03 10:19:58 +01:00
Leah Amelia Chen
5851bad4a0 ci: add check that ensures POT files are up to date 2025-03-03 10:19:58 +01:00
Leah Amelia Chen
9360afd29f gtk: add localization support, take 3
This is my third (!) attempt at implementing localization support.
By leveraging GTK builder to do most of the `gettext` calls, I
can avoid the whole mess about missing symbols on non-glibc platforms.

Added some documentation too for contributors and translators,
just for good measure.
2025-03-03 10:19:58 +01:00
Tim Culverhouse
ee8ae196ee input: legacy encoding never encodes text for command mods on macOS (#6057)
Fixes #5929
Replaces #5984

On macOS, native applications typically never encode any text for key
events that use the command key. This is because the command key is used
for key equivalents and "commands" and should not be used for text
input.

This can be verified with apps like TextEdit but also terminals like
Terminal.app officially but also iTerm2 unofficially. Anything such as
`Cmd+b` or `Cmd+Shift+b` will not produce any text input.

Cross-platform terminals generally don't follow this, for example Kitty
performs CSI-u encoding and Alacritty and WezTerm encode the text as-is
(i.e. `Cmd+b` will produce `b`).

On Linux, the super key (command-equivalent) does produce text input.
For example, `Super+b` will produce `b` in Gnome Console, Foot, and all
the cross-platform terminals mentioned above.

In the interest of matching the behavior of native macOS applications,
we should not encode text for command key events on macOS. We continue
to encode text for the super key on non-macOS platforms. This matches
the behaviors appropriately on each platform.
2025-03-02 16:21:02 -06:00
Mitchell Hashimoto
a646aee6bd CODEOWNERS: terminal team should own input encoding (#6058) 2025-03-02 13:56:37 -08:00
Mitchell Hashimoto
28e20f3015 CODEOWNERS: terminal team should own input encoding 2025-03-02 13:54:35 -08:00
Mitchell Hashimoto
f93eb0b27f input: legacy encoding never encodes text for command mods on macOS
Fixes #5929
Replaces #5984

On macOS, native applications typically never encode any text for
key events that use the command key. This is because the command key
is used for key equivalents and "commands" and should not be used
for text input.

This can be verified with apps like TextEdit but also terminals like
Terminal.app officially but also iTerm2 unofficially. Anything such as
`Cmd+b` or `Cmd+Shift+b` will not produce any text input.

Cross-platform terminals generally don't follow this, for example Kitty
performs CSI-u encoding and Alacritty and WezTerm encode the text as-is
(i.e. `Cmd+b` will produce `b`).

On Linux, the super key (command-equivalent) does produce text input.
For example, `Super+b` will produce `b` in Gnome Console, Foot, and
all the cross-platform terminals mentioned above.

In the interest of matching the behavior of native macOS applications,
we should not encode text for command key events on macOS. We continue
to encode text for the super key on non-macOS platforms.
2025-03-02 13:53:20 -08:00
Mitchell Hashimoto
82326508b1 macos: set title of terminal window immediately if configured (#6056)
Fixes #5934 for macOS

If a `title` config is set, this change sets the title immediately on
windowDidLoad to ensure that the window appears with the correct title
right away.

If there is any reason to set another title, the `set_title` apprt
action will come on another event loop tick (due to our usage of
notifications) but that's okay since that's already how it works. This
is just to say that setting this here won't break any shell integration
or anything.
2025-03-02 13:48:33 -08:00
Mitchell Hashimoto
8d395c094b macos: set title of terminal window immediately if configured
Fixes #5934 for macOS

If a `title` config is set, this change sets the title immediately on
windowDidLoad to ensure that the window appears with the correct title
right away.

If there is any reason to set another title, the `set_title` apprt
action will come on another event loop tick (due to our usage of
notifications) but that's okay since that's already how it works. This
is just to say that setting this here won't break any shell integration
or anything.
2025-03-02 13:27:40 -08:00
Mitchell Hashimoto
fc893ae7e3 core!: modify scroll behavior (#6052)
Modify the scroll behavior to better match other terminals, as well as
provide a
better overall experience. Before this PR, ghostty would scale
non-precision
scroll events dependent on the screen size. This is in line with kitty,
but no
other terminal. Ghostty also was the only terminal to send *more than
one* wheel
event.

```
 # 50% Screen height
| terminal   | arrows keys sent| wheels events sent|
|------------|-----------------|-------------------|
| alacritty  |        3        |          1        |
| foot       |        3        |          1        |
| xterm      |        5        |          1        |
| kitty      |        3        |          1        |
| ghostty    |        2        |          2        |

 # 100% Screen height
| terminal   | arrows keys sent| wheels events sent|
|------------|-----------------|-------------------|
| alacritty  |        3        |          1        |
| foot       |        3        |          1        |
| xterm      |        5        |          1        |
| kitty      |        5        |          1        |
| ghostty    |        3        |          3        |
```

This PR modifies Ghostty to behave like foot and alacritty.

For an improved user experience, we only use the configured multiplier
for
non-precision scrolls. This multiplier now *only applies* to viewport
scrolling
and alternate scroll mode. The default value has been updated to 3.0.

GTK also now supports precision scrolling.
2025-03-02 13:15:45 -08:00
Tim Culverhouse
30a49d0458 fixup! config: default mouse-scroll-multiplier to 3.0 2025-03-02 08:46:11 -06:00
Tim Culverhouse
68a2478317 gtk: enable non-discrete scrolling
Remove the flag which reports all scrolls as discrete scrolls. This
enables precision scrolling in GTK. We have to track a flag between
continuous scroll events.
2025-03-02 08:36:47 -06:00
Tim Culverhouse
c1e87e7122 scroll: only use multiplier for non-precision scrolls
Precision scrolls don't require a multiplier to behave nicely. However,
wheel scrolls feel extremely slow without one. We apply the multiplier
to wheel scrolls only
2025-03-02 08:35:25 -06:00
Tim Culverhouse
6e751d2d7e config: default mouse-scroll-multiplier to 3.0
Make Ghostty behave like other terminals by multiplying scrolls by 3.0.
This only affects when we are reporting arrow keys (alternate scroll
mode) or when we are scrolling the scrollback.
2025-03-02 08:03:09 -06:00
Tim Culverhouse
dbba3f1a60 scroll: don't use multiplier for wheel events
When we report mouse scroll wheel events, they should not be multiplied.
Refactor the scrollCallback to only use a multiplier for viewport or
alternate scroll reports.
2025-03-02 08:02:47 -06:00
Tim Culverhouse
34388ab5df surface: calculate scroll amount directly from yoff/xoff for non-precision scrolls
Calculate the scroll amount for non-precision scrolls as a direct
multiple of yoff. This fixes an issue where Ghostty sends scroll wheel
events (or arrow keys if in alternate scroll mode) that are variable,
dependent on the screen size. I checked multiple terminals, and each
responds to a single wheel click by sending only a single wheel / arrow
key - independent of screen size.

```sh
printf "\x1b[?1049h"
printf "\x1b[?1007h"

cat -v

```

Using the above procedure, with varying screen sizes:

```
 # 50% Screen height
| terminal   | arrows keys sent| wheels events sent|
|------------|-----------------|-------------------|
| alacritty  |        3        |          1        |
| foot       |        3        |          1        |
| xterm      |        5        |          1        |
| kitty      |        3        |          1        |
| ghostty    |        2        |          2        |

 # 100% Screen height
| terminal   | arrows keys sent| wheels events sent|
|------------|-----------------|-------------------|
| alacritty  |        3        |          1        |
| foot       |        3        |          1        |
| xterm      |        5        |          1        |
| kitty      |        5        |          1        |
| ghostty    |        3        |          3        |
```

Both ghostty and kitty scale the number of arrow keys sent in proportion
to the screen size. However, when mouse reporting is on, only ghostty
does this.

This commit makes Ghostty behave like foot, and more generally removes
the dependence on screen size.
2025-03-02 08:02:47 -06:00
Mitchell Hashimoto
8721f2ae51 Update iTerm2 colorschemes (#6047)
Upstream revision:
e21d5ffd19
2025-03-01 20:42:22 -08:00
mitchellh
29447b60b3 deps: Update iTerm2 color schemes 2025-03-02 00:13:13 +00:00
Mitchell Hashimoto
e2b5584a8d Add note to configuration that some settings might require a restart (#6033)
This adds a note in the default config to note that may require a
restart. Also adds a note with the window-padding-x and window-padding-y
to indicate a restart will be required to update existing windows.

I ran into this while updating one of the existing values in the default
config file. `window-padding-x` The value defaulted to 2 so figured it
was safe to assume and just uncomment it and try reloading the config.

Doing that doesn't work only restarting will make it take effect for the
main window ( or of course more tricky opening new windows and killing
off the old one )

https://github.com/ghostty-org/ghostty/discussions/6022
2025-03-01 13:57:25 -08:00
Aaron Ogle
e7a9d6a81d Update config template with a note about a restart possibly being required 2025-03-01 13:55:10 -08:00
Jeffrey C. Ollie
b342909e10 GTK: do not check for terminal area focus when setting window title (#6032)
Fixes https://github.com/ghostty-org/ghostty/issues/5940
The mentioned problem occurs because when creating a new tab through the
tab overview we do not have focus on the terminal area widget, it does
not matter if we have a custom title set or not.
I think it is just safe to remove this check from the code. I've tested
the change and I don't really see a valid use case in which we would not
want to set the window title even if we don't have focus on the terminal
area.
2025-03-01 12:10:13 -06:00
Leah Amelia Chen
df62d45b36 gtk: update URLWidget to use zig-gobject (#6042) 2025-03-01 18:40:27 +01:00
Jeffrey C. Ollie
5d5a632a89 gtk: update URLWidget to use zig-gobject
Also move URLWidget to a separate file to cut down on the size of
Surface.zig.
2025-03-01 10:02:16 -06:00
Jeffrey C. Ollie
ed647caa2e apprt/gtk: remove non-ascii characters from resize overlay (#6040)
It is possible that fonts people are using don't contain these
characters as evidenced by users in the Discord.
2025-03-01 08:54:31 -06:00
Maciej Bartczak
a3cd7c6f02 gtk: update the window title when grabbing tab focus 2025-03-01 13:25:25 +01:00
Tristan Partin
0e6c26bbfe apprt/gtk: remove non-ascii characters from resize overlay
It is possible that fonts people are using don't contain these
characters as evidenced by users in the Discord.

Signed-off-by: Tristan Partin <tristan@partin.io>
2025-03-01 00:37:01 -06:00
Mitchell Hashimoto
efc1b10bfd Introduce reset_window_size keybinding and apprt action (#6038)
Related to #6035

This implements the keybind/action portion of #5974 so that this can
have a binding and so that other apprts can respond to this and
implement it this way.
2025-02-28 19:02:10 -08:00
Mitchell Hashimoto
17cae57f51 Introduce reset_window_size keybinding and apprt action
Related to #6035

This implements the keybind/action portion of #5974 so that this can
have a binding and so that other apprts can respond to this and
implement it this way.
2025-02-28 15:31:17 -08:00
Mitchell Hashimoto
c6485b9fd5 "Return to Default Size" implementation (#5974)
## Added Support for "Return To Default Size"

This update introduces support for the **"Return To Default Size"**
feature.

### Fixes  
- Resolves [#1328](https://github.com/ghostty-org/ghostty/issues/1328)

### Screenshots  

| Description | Screenshot |
|------------|------------|
| **Ghostty** | <img width="1084" alt="Screenshot 2025-02-24 at 21 15
38"
src="https://github.com/user-attachments/assets/4657ccdb-9c7a-4884-873c-bbe0f30f9400"
/> |
| **After changing window size** | <img width="1155" alt="Screenshot
2025-02-24 at 21 16 00"
src="https://github.com/user-attachments/assets/9b3931f2-1c4b-4f86-8d56-8892bd5675cc"
/> |
| **Native Terminal App (for reference)** | <img width="630"
alt="Screenshot 2025-02-24 at 21 16 20"
src="https://github.com/user-attachments/assets/ae049931-b74d-4246-a9e7-d9be079b1a24"
/> |
2025-02-28 15:06:24 -08:00
Mitchell Hashimoto
afb154ee5d macos: store default size as computed property 2025-02-28 14:51:56 -08:00
Leah Amelia Chen
5accc069fb gtk: implement quick terminal (#6027) 2025-02-28 23:31:39 +01:00
Mikhail Borisov
8838ebf02a Refactor to use height/width from ghostty configuration 2025-02-28 14:17:46 -08:00
Mikhail Borisov
f73c1a2c59 "Return to Default Size" implementation
Added support for "Return To Default Size"
2025-02-28 14:17:46 -08:00
Mitchell Hashimoto
9681009650 apprt initial_size is sent whenever the grid size changes (#6034)
As noted in the comments, this is so that apprt's can always know what
the default size of a window would be so they can utilize this for
"return to default size" actions.

The initial size shouldn't be treated as a "resize" event and was
already documented as such. Prior to this commit the docs already noted
that the initial size may be sent multiple times but only the first time
during initialization should be used as a resize.

Therefore, this shouldn't impact prior behavior. I've verified this with
the apprts.
2025-02-28 10:43:55 -08:00
Mitchell Hashimoto
b0f1f19da0 apprt initial_size is sent whenever the grid size changes
As noted in the comments, this is so that apprt's can always know what
the default size of a window would be so they can utilize this for
"return to default size" actions.

The initial size shouldn't be treated as a "resize" event and was
already documented as such. Prior to this commit the docs already noted
that the initial size may be sent multiple times but only the first time
during initialization should be used as a resize.

Therefore, this shouldn't impact prior behavior. I've verified this with
the apprts.
2025-02-28 10:07:36 -08:00
Leah Amelia Chen
a85651fe4f gtk: implement quick terminal
Using `gtk4-layer-shell` still seems like the path of least resistance,
and to my delight it pretty much Just Works. Hurrah!

This implementation could do with some further polish (e.g. animations,
which can be implemented via libadwaita's animations API, and global
shortcuts), but as a MVP it works well enough.

It even supports tabs!

Fixes #4624.
2025-02-28 18:04:42 +01:00
Mitchell Hashimoto
1cfe7027e5 Fix Terminal Inspector option turns inactive if toggled in the Quick Terminal (#6024)
Fixed: [2475](https://github.com/ghostty-org/ghostty/issues/2475)

The problem actually existed because of the responder chain, as
previously pointed out in the report (thanks to @mitchellh).

When we first click on Toggle Terminal Inspector:
* the responder chain goes to _toggleTerminalInspector_
(_SurfaceView_AppKit_ implementation).
When we click the second toggleTerminalInspector:
* it tries to find the next responder, but the one available is
_TerminalController_. (if we remove this method from there, the bug will
reproduce even without quick mode)

**Problem**:
TerminalController not available during quick terminal, so there's no
way to toggle inspector
**Solution**:
We add toggleTerminalInspector to the _QuickTerminalController_:
selector, as we did with other similar methods.
2025-02-28 07:09:00 -08:00
Mikhail Borisov
744240c009 Fix Terminal Inspector option turns inactive if toggled in the Quick Terminal 2025-02-28 00:38:29 +01:00
Mitchell Hashimoto
ef88d1cba9 feat: respect maximize config on macOS (#5962)
Resolve #5928
2025-02-27 15:25:17 -08:00
Aaron Ruan
5a5478abe1 feat: respect maximize config on macOS
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-02-27 15:10:39 -08:00
Qwerasd
a1437e5579 fix(Metal): force a full rebuild in setFontGrid (#6008)
This was causing garbled text due to a non-rebuilt rows referencing an
outdated atlas when the DPI changed but not the grid dimensions, which
could be caused by a variety of things such as the quick terminal
slide-in, dpi scaling changes on sleep/wake, moving windows between
displays because of closing/opening the laptop lid, etc.

Fixes #2731
2025-02-27 09:43:47 -05:00
Jeffrey C. Ollie
31df9d5576 gtk: work around oversized drag handle for GtkPaned (#6000)
Improves #3020.

Based on recommendation from upstream Gtk issue:
https://gitlab.gnome.org/GNOME/gtk/-/issues/4484#note_2362002

Without this, it's not possible to select the first character on the
right-hand side of a split.
2025-02-27 08:42:17 -06:00
Jeffrey C. Ollie
ef7f8cb3da gtk: use language-neutral arrows for resize overlays (#6013)
The meaning of "c" and "r" can be somewhat cryptic to non-native English
speakers as it may not be immediately obvious that "c" stands for
"columns", and "r" stands for "rows". I propose replacing them with
left-right and up-down double-headed arrows that convey the same
meaning, but in a truly language-neutral manner.

Related to #2357
2025-02-27 08:25:12 -06:00
David Wales
63ea1ab32e gtk: work around oversized drag handle for GtkPaned
Improves #3020.

Based on recommendation from upstream Gtk issue:
https://gitlab.gnome.org/GNOME/gtk/-/issues/4484#note_2362002

Without this, it's not possible to select the first character on the
right-hand side of a split.
2025-02-27 19:17:37 +11:00
Leah Amelia Chen
cdfa028521 gtk: use language-neutral arrows for resize overlays
The meaning of "c" and "r" can be somewhat cryptic to non-native English
speakers as it may not be immediately obvious that "c" stands for "columns",
and "r" stands for "rows". I propose replacing them with left-right and
up-down double-headed arrows that convey the same meaning, but in a
truly language-neutral manner.

Related to #2357
2025-02-27 08:38:06 +01:00
Jeffrey C. Ollie
c7938af7be gtk: convert Split.zig to gobject (#6012) 2025-02-26 22:38:51 -06:00
Jeffrey C. Ollie
78a98e01fc gtk: convert Split.zig to gobject 2025-02-26 19:22:02 -06:00
Jeffrey C. Ollie
d85ed8275e gtk: convert cgroup operations to gobject (#6009) 2025-02-26 18:28:53 -06:00
Jeffrey C. Ollie
6581b9cf41 gtk: convert cgroup operations to gobject 2025-02-26 16:26:44 -06:00
Leah Amelia Chen
12ba5d89f0 apprt/gtk: subscribe to AdwStyleManager::dark for ColorScheme (#6007) 2025-02-26 20:38:50 +01:00
Qwerasd
16a61c43dd fix(Metal): force a full rebuild in setFontGrid
This was causing garbled text due to a non-rebuilt rows referencing an
outdated atlas when the DPI changed but not the grid dimensions, which
could be caused by a variety of things such as the quick terminal
slide-in, dpi scaling changes on sleep/wake, moving windows between
displays because of closing/opening the laptop lid, etc.
2025-02-26 14:11:05 -05:00
Tristan Partin
acbb1d3bd4 apprt/gtk: subscribe to AdwStyleManager::dark for ColorScheme
Signed-off-by: Tristan Partin <tristan@partin.io>
2025-02-26 13:03:12 -06:00
Jeffrey C. Ollie
dec14f3096 gtk: switch dbus operations in src/apprt/gtk/App.zig to zig-gobject (#5996) 2025-02-26 11:17:47 -06:00
Jeffrey C. Ollie
5fdb732798 gtk: switch dbus operations in src/apprt/gtk/App.zig to zig-gobject 2025-02-25 22:52:57 -06:00
Leah Amelia Chen
4e5e4a7c2f gtk: switch clipboard confirmation to zig-gobject and blueprints (#5968) 2025-02-25 23:28:56 +01:00
Mitchell Hashimoto
c068390634 Fix elvish sudo integration and update documentation (#5992)
Elvish integration is broken when running `sudo`, because the function
`sudo-with-terminfo` uses `command` command, which is not implemented in
Elvish. Changing it to `external` command should fix possible error when
bypassing aliases, functions and builtins, like `command` does in Bash.
Discussion about this issue: #5979 

Also I updated documentation about Elvish integration to provide fix
when using `use ghostty-integration` outside of Ghostty with `rc.elv`.
2025-02-25 13:57:31 -08:00
Yappaholic
3cac06a70a Fix elvish sudo integration and update documentation 2025-02-25 23:17:00 +03:00
Jeffrey C. Ollie
62dcddb315 gtk: fix missing defer 2025-02-25 13:46:50 -06:00
Jeffrey C. Ollie
0638eca633 gtk: use versioned directories to store blueprint files 2025-02-25 13:30:44 -06:00
Jeffrey C. Ollie
c6b049b12b gtk: fix properties on close confirmation text view 2025-02-25 13:30:44 -06:00
Jeffrey C. Ollie
3f847de964 gtk: switch clipboard confirmation to zig-gobject and blueprints
Note that for Debian 12, the blueprints must be compiled on a distro
with a newer version of `blueprint-compiler` and the raw UI XML
committed to git. Debian 12 includes `blueprint-compiler` 0.6.0 which
doesn't support compiling `adw.MessageDialog` even though the version of
`libadwaita` supports it.
2025-02-25 13:30:44 -06:00
Mitchell Hashimoto
9972eeb673 Create a snap packaging subsystem (#5987)
This team is responsible for snap packaging.
2025-02-25 10:54:29 -08:00
Mitchell Hashimoto
166362d349 Create a snap packaging subsystem
This team is responsible for snap packaging.
2025-02-25 10:21:55 -08:00
Mitchell Hashimoto
0b7df7511a Fix empty keybind setting (#5977)
Fixes https://github.com/ghostty-org/ghostty/issues/5936.

Extracts the default keybind setting to an `init` function. Add logic to
call `init` in `parseIntoField` if it is defined for the type.
2025-02-25 09:06:11 -08:00
David Mo
df9de1523c fix test 2025-02-25 11:53:01 -05:00
Leah Amelia Chen
22f3e60dcf gtk: convert window actions to use zig-gobject (#5978) 2025-02-25 16:44:09 +01:00
David Mo
af2d710000 rename setToDefault to init 2025-02-25 10:15:58 -05:00
Jeffrey C. Ollie
3d08b1c4aa gtk: cast to application window 2025-02-25 08:19:52 -06:00
David Mo
22d99f2533 add test for setToDefault 2025-02-24 23:39:01 -05:00
David Mo
8fadb54e65 set default keybinds when parsing empty keybind config 2025-02-24 23:31:49 -05:00
David Mo
0321aec68f create default keybinds function 2025-02-24 23:27:49 -05:00
Jeffrey C. Ollie
d284146621 gtk: convert window actions to use zig-gobject 2025-02-24 22:07:16 -06:00
Mitchell Hashimoto
92340f8fb0 fix(macos): prevent performing newTab shortcut on QuickTerminalWindow… (#5955)
Fixes #5939
2025-02-24 15:32:39 -08:00
McNight
b4349d3226 fix(macos): make showNoNewTabAlert method private #5939 2025-02-25 00:18:02 +01:00
McNight
1254c6b981 fix(macos): address MR feedback #5939 2025-02-25 00:17:01 +01:00
Mitchell Hashimoto
ce8bfe45ed Docs change: Note instead of simple text and Removing two times showing info. (#5920)
In docs option reference, for macos-icon info. It is showing two times
similar thing. And Note looks good instead of just text because it wont
work without `custom-style`. So a Big Note is a good highlight.
2025-02-24 09:41:26 -08:00
Jeffrey C. Ollie
e1e1539e4f kitty: delete stray log line (#5969) 2025-02-24 11:30:22 -06:00
Jeffrey C. Ollie
9bcf554139 gtk: instruct users to install blueprint-compiler (#5970)
There's been *far* too many people who aren't aware of the new
dependency, and that is partly our fault: a "FileNotFound" error is
quite obtuse, unless you religiously follow every PR and every commit
made to the repository. Instead of shepherding everyone who runs into
this manually, we should offer better signposting.
2025-02-24 11:25:56 -06:00
Leah Amelia Chen
1dc375dd0e gtk: instruct users to install blueprint-compiler
There's been *far* too many people who aren't aware of the new dependency,
and that is partly our fault: a "FileNotFound" error is quite obtuse,
unless you religiously follow every PR and every commit made to the
repository. Instead of shepherding everyone who runs into this manually,
we should offer better signposting.
2025-02-24 18:10:18 +01:00
Jeffrey C. Ollie
f4f36a9a98 kitty: delete stray log line 2025-02-24 11:05:37 -06:00
Mitchell Hashimoto
71ae51b4b3 kitty images: add delete by range operations (#5957)
Fixes #5937

Implement [deleting Kitty image
ranges](https://sw.kovidgoyal.net/kitty/graphics-protocol/#deleting-images).
2025-02-24 07:14:11 -08:00
Jeffrey C. Ollie
61f41e5c01 nix: include libxml2 in nativeBuildInputs for xmllint (#5959) 2025-02-23 15:56:08 -06:00
Jeffrey C. Ollie
2ef042978d nix: include libxml2 in nativeBuildInputs for xmllint 2025-02-23 15:17:18 -06:00
Leah Amelia Chen
a52c603f16 gtk: ensure that the content scale is always positive (#5954) 2025-02-23 21:27:09 +01:00
Jeffrey C. Ollie
da10269d3f gtk: handle other nonsensical values returned by gtk_widget_get_scale_factor 2025-02-23 13:18:00 -06:00
Jeffrey C. Ollie
ac7029256a gtk: better document what to do if gtk-xft-dpi <= 0 2025-02-23 13:04:47 -06:00
Jeffrey C. Ollie
995959dce4 kitty images: add delete by range operations
Fixes #5937

Implement [deleting Kitty image ranges](https://sw.kovidgoyal.net/kitty/graphics-protocol/#deleting-images).
2025-02-23 12:57:24 -06:00
McNight
aa4aaa200f fix(macos): prevent performing newTab shortcut on QuickTerminalWindow #5939 2025-02-23 19:34:27 +01:00
Jeffrey C. Ollie
bc2acdd060 gtk: ensure that the content scale is always positive
Fixes #5927

This doesn't fix the underlying reason that GTK sometimes reports
content scales as negative. If GTK reports a negative scale, we ignore
that and use 1.0 for the scale.
2025-02-23 11:02:59 -06:00
Mitchell Hashimoto
2f63f840de terminal: increase CSI max params to 24 to accept Kakoune sequence (#5949)
See #5930

Kakoune sends a real SGR sequence with 17 parameters. Our previous max
was 16 so we threw away the entire sequence. This commit increases the
max rather than fundamentally addressing limitations.

Practically, it took us this long to witness a real world sequence that
exceeded our previous limit. We may need to revisit this in the future,
but this is an easy fix for now.

In the future, as the comment states in this diff, we should probably
look into a rare slow path where we heap allocate to accept up to some
larger size (but still would need a cap to avoid DoS). For now,
increasing to 24 slightly increases our memory usage but shouldn't
result in any real world issues.
2025-02-23 07:12:38 -08:00
Tristan Partin
eaeb6a620f gtk: switch menus to use blueprints instead of raw builder ui (#5944) 2025-02-22 23:30:56 -06:00
Tristan Partin
65c65b9c97 gtk: fix menu separator colors (again) (#5945) 2025-02-22 23:30:30 -06:00
Mitchell Hashimoto
dad2cf887b add macos default config path to manpages (#5942)
This should resolve #5938.

I tested this locally using `zig build -D=emit-docs=true` and confirmed
that the mdgen process provided the new manpages in
`zig-out/share/man/man*`, respectively.

Let me know if this needs any changes, I tried to keep this as similar
as possible to the existing manpages (both format and content).
2025-02-22 20:53:34 -08:00
Mitchell Hashimoto
22c506b03e terminal: increase CSI max params to 24 to accept Kakoune sequence
See #5930

Kakoune sends a real SGR sequence with 17 parameters. Our previous max
was 16 so we through away the entire sequence. This commit increases the
max rather than fundamentally addressing limitations.

Practically, it took us this long to witness a real world sequence that
exceeded our previous limit. We may need to revisit this in the future,
but this is an easy fix for now.

In the future, as the comment states in this diff, we should probably
look into a rare slow path where we heap allocate to accept up to some
larger size (but still would need a cap to avoid DoS). For now,
increasing to 24 slightly increases our memory usage but shouldn't
result in any real world issues.
2025-02-22 20:43:44 -08:00
Jeffrey C. Ollie
427da79a02 gtk: fix menu separator colors (again) 2025-02-22 20:23:16 -06:00
Jeffrey C. Ollie
a8b6b96fbd gtk: switch menus to use blueprints instead of raw builder ui 2025-02-22 20:21:41 -06:00
Tristan Partin
e7cbb7fd16 gtk: update ResizeOverlay for zig-gobject (#5941)
Also switch to a "DerivedConfig" model so that we aren't referring to a
global copy of the config.
2025-02-22 20:07:20 -06:00
Jeffrey C. Ollie
bdf0f27d1a gtk: fix the alignment of the context menu (#5943)
This aligns the top left of the context menu with the right-click
location, rather than the top center.
2025-02-22 18:37:41 -06:00
Jeffrey C. Ollie
0af256b57a gtk: fix the alignment of the context menu
This aligns the top left of the context menu with the right-click
location, rather than the top center.
2025-02-22 18:23:30 -06:00
taylrfnt
398add17f1 actually change it in both places 2025-02-22 18:00:37 -06:00
taylrfnt
eec150d4cd mention default loc precendence over XDG 2025-02-22 17:58:05 -06:00
taylrfnt
573fe7348b add macos default config path to manpages 2025-02-22 17:46:30 -06:00
Jeffrey C. Ollie
f1134640c5 gtk: update ResizeOverlay for zig-gobject
Also switch to a "DerivedConfig" model so that we aren't referring to a
global copy of the config.
2025-02-22 17:42:09 -06:00
Jeffrey C. Ollie
5131f8a71c GTK: propagate config updates to the GTK apprt surfaces (#5866)
This will be needed to the convert GTK apprt surfaces to a DerivedConfig
model rather than accessing the global config stored in the app. It's a
no-op for now, but I have a PR in the works to update the resize overlay
that will take advantage of this.
2025-02-22 17:19:13 -06:00
Jeffrey C. Ollie
867982a2ff Gtk: change title prompt (#5905)
This PR implements the title change functionality for the GTK app and
closes https://github.com/ghostty-org/ghostty/issues/5769

Demo:


https://github.com/user-attachments/assets/cad611b3-b7bf-40ac-8d0f-11d2095fe525

For now I came up with a basic UI that i believe is sufficient, but I'm
open to feedback and happy to iterate on it further.

https://github.com/ghostty-org/ghostty/issues/5769#issuecomment-2660341107
- Regarding Mitchell's comment I checked Gnome Console and I could not
find a similar feature.
2025-02-22 17:00:40 -06:00
Jeffrey C. Ollie
bde5b963d0 gtk: fix Builder api changes 2025-02-22 16:39:12 -06:00
Maciej Bartczak
5d80db2ef8 code review: fix log format 2025-02-22 16:39:12 -06:00
Jeffrey C. Ollie
32a62ff862 snap: add libxml2-utils (for xmllint) to snap 2025-02-22 16:33:22 -06:00
Jeffrey C. Ollie
d4bcac0150 snap: add blueprint-compiler to snap 2025-02-22 16:33:22 -06:00
Jeffrey C. Ollie
51dc1e2e8c gtk: fix typos 2025-02-22 16:33:22 -06:00
Jeffrey C. Ollie
4f3c4037aa gtk: get 'Change Title' working with older distros 2025-02-22 16:33:20 -06:00
Maciej Bartczak
7c19dd5a33 format the blueprint file using blueprint-compiler format 2025-02-22 16:32:52 -06:00
Maciej Bartczak
8758295647 code review:
- move responses definition to the blueprint, use translatable strings
- minor changes in the response callback
2025-02-22 16:32:52 -06:00
Maciej Bartczak
1ee8dfc99c code review:
- remove unnecessary @ptrCast
- set the default focus to the text entry field
2025-02-22 16:32:52 -06:00
Maciej Bartczak
cd287b4161 - remove the unused dialog context struct
- set the current title in the input buffer
- fix formatting
2025-02-22 16:32:50 -06:00
Maciej Bartczak
454a53b3f1 code review:
- remove the menu entry defined in code
2025-02-22 16:32:23 -06:00
Maciej Bartczak
6189f5d09e code review:
- use blueprint for the dialog content
- use zig-gobject bindings
- make the enum values lowercase
2025-02-22 16:31:32 -06:00
Maciej Bartczak
dcd17c6ac4 set the ok widget to be activated by default 2025-02-22 16:30:57 -06:00
Maciej Bartczak
3542778d84 free the terminal title when destroy is run 2025-02-22 16:30:57 -06:00
Maciej Bartczak
95fc5ad1e9 remove outdated comment 2025-02-22 16:30:57 -06:00
Maciej Bartczak
cc9c45de2a fix the edge case when user tries to revert the title to default and hasn't set a title before 2025-02-22 16:30:57 -06:00
Maciej Bartczak
5e9908af27 make the change of the title persistent & allow the user to restore to a default one 2025-02-22 16:30:56 -06:00
Maciej Bartczak
6b75ca40ca Implement a prompt that allows the user to set the title 2025-02-22 16:30:55 -06:00
Jeffrey C. Ollie
3f715c296a gtk: update menus to use popovers and builder ui files (#5781)
Menus (context menus and the window hamburger menu) now use popovers and
are defined using GTK builder UI files. This is a bit more "modern" and
reduces the amount of code to define menus.
2025-02-22 14:54:06 -06:00
Mitchell Hashimoto
e307f1a373 Allow whitespace in ColorList values (#5925)
The following formats are now all valid:

```zig
macos-icon-screen-color = #00FF00,#FF1000,#00FFFF
macos-icon-screen-color = #00FF00, #FF1000, #00FFFF
macos-icon-screen-color = #00FF00 ,#FF1000 ,#00FFFF
macos-icon-screen-color =  #00FF00 , #FF1000  , #00FFFF
```

Fixes #5918
2025-02-22 12:18:54 -08:00
Mitchell Hashimoto
726ac36612 Add support for whitespace in color and palette parsing (#5926)
Resolves #5921
2025-02-22 07:25:18 -08:00
Mitchell Hashimoto
ce62b5cc5e Clarify configuration of macos-icon-screen-color's gradient (#5923)
From #5863, cc @vollink.

I'm not sure what the hard-wrap limit for comments is (70?), so I've
tried to match the paragraph I've edited.
2025-02-22 07:13:08 -08:00
Bryan Lee
1b6b029e0d Add test cases for whitespace handling for ColorList 2025-02-22 22:11:35 +08:00
Bryan Lee
2383e4d90d Add support for whitespace in color and palette parsing 2025-02-22 22:05:05 +08:00
Bryan Lee
7c6375f744 Allow whitespace after commas in ColorList values 2025-02-22 20:53:27 +08:00
Kat
6770ad3736 Clarify configuration of macos-icon-screen-color's gradient. 2025-02-22 17:14:08 +11:00
Ronit Gandhi
a262da92bf using only note instead of both for docs. 2025-02-22 10:49:27 +05:30
Mitchell Hashimoto
870b74f4da macOS: Fix new window focus when created from quick terminal (#5834)
## Root Cause

The issue has two aspects:

1. The window creation process didn't explicitly force focus on the new
window after showing it.
2. More fundamentally, we were relying on `NSApp.isActive` to determine
whether to activate the application, which is problematic because:
- When creating a window from quick terminal, the application is already
"active" but this active state is owned by the quick terminal
- The [`NSApp.isActive`
check](4cfe5522db/macos/Sources/Features/Terminal/TerminalManager.swift (L100))
doesn't accurately reflect our intent - creating a new window is an
explicit user action that should always result in that window gaining
focus

## Solution

Removing the `NSApp.isActive` check.

```swift
// Before
if !NSApp.isActive {
    NSApp.activate(ignoringOtherApps: true)
}

// After
NSApp.activate(ignoringOtherApps: true)
```

Fixes #5688
2025-02-21 15:50:00 -08:00
Mitchell Hashimoto
c1fb9a33f7 Fix barely visible new tab button on macOS (#5897)
Resolve #5894 and #4288
2025-02-21 15:47:33 -08:00
Aaron Ruan
4291e1c5d7 fix: use surfaceConfig.backgroundColor to determine if the theme is light or dark
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-02-21 15:32:24 -08:00
Mitchell Hashimoto
b5ecd7b6be Update libxev to use dynamic backend, support Linux configurability (#5916)
Related to #3224

Previously, Ghostty used a static API for async event handling: io_uring
on Linux, kqueue on macOS. This commit changes the backend to be dynamic
on Linux so that epoll will be used if io_uring isn't available, or if
the user explicitly chooses it.

This introduces a new config `async-backend` (default "auto") which can
be set by the user to change the async backend in use. This is a
best-effort setting: if the user requests io_uring but it isn't
available, Ghostty will fall back to something that is and that choice
is up to us.

Basic benchmarking both in libxev and Ghostty (vtebench) show no
noticeable performance differences introducing the dynamic API, nor
choosing epoll over io_uring.

For platforms that don't have multiple choices (currently macOS), the
dynamic API is literally the static API so there should be no
performance or behavioral changes whatsoever.
2025-02-21 15:18:59 -08:00
Mitchell Hashimoto
d532a6e260 Update libxev to use dynamic backend, support Linux configurability
Related to #3224

Previously, Ghostty used a static API for async event handling: io_uring
on Linux, kqueue on macOS. This commit changes the backend to be dynamic
on Linux so that epoll will be used if io_uring isn't available, or if
the user explicitly chooses it.

This introduces a new config `async-backend` (default "auto") which can
be set by the user to change the async backend in use. This is a
best-effort setting: if the user requests io_uring but it isn't
available, Ghostty will fall back to something that is and that choice
is up to us.

Basic benchmarking both in libxev and Ghostty (vtebench) show no
noticeable performance differences introducing the dynamic API, nor
choosing epoll over io_uring.
2025-02-21 15:04:37 -08:00
Jeffrey C. Ollie
2697061e5b gtk: fix comment in Window.updateConfig 2025-02-18 23:28:10 -06:00
Jeffrey C. Ollie
d1fa933006 gtk: forward config updates to GTK apprt surfaces 2025-02-18 23:18:47 -06:00
Jeffrey C. Ollie
2d5a07c795 gtk: fix build on debian 12 2025-02-18 17:10:54 -06:00
Jeffrey C. Ollie
b3f994a9d2 gtk: use builder ui files and popovers for menus 2025-02-18 17:10:51 -06:00
Jeffrey C. Ollie
38908e0126 gtk: apply all window appearance changes in syncAppearance (#5404)
The GTK side of appearance code is kind of a mess with several different
functions all having the responsibility of interacting with each other
and setting the appropriate window appearance. It should solely be the
responsibility of the `syncAppearance` function to apply appearance
changes, with other callbacks/functions calling it instead: much like
what we already do for the macOS apprt.

~~I also took the time to refactor the libadwaita version checks since
calling `versionAtLeast(0, 0, 0)` does get old after a while. Now almost
all checks are given human-readable names and contributors need not
memorize what the relevant version checks all are.~~ Moved to another PR
2025-02-18 16:36:07 -06:00
Leah Amelia Chen
8eaa901aec config: update reload ability information for several keys
Several keys are now able to affect existing windows (especially
window-decoration, whose config documentation got a greater overhaul)
2025-02-18 10:09:41 +01:00
Leah Amelia Chen
aa2dbe2919 gtk: apply all window appearance changes in syncAppearance
The GTK side of appearance code is kind of a mess with several different
functions all having the responsibility of interacting with each other
and setting the appropriate window appearance. It should solely be the
responsibility of the `syncAppearance` function to apply appearance
changes, with other callbacks/functions calling it instead: much like
what we already do for the macOS apprt.
2025-02-18 10:09:41 +01:00
Bryan Lee
c9f8732e5c Fix new window focus when quick terminal is open 2025-02-18 10:50:01 +08:00
Jeffrey C. Ollie
da32534e8a gtk: fix closing window when last tab is closed (#5837)
Causes windows to not close and leave behind a "corpse" if they are not
the last window or we are running in single instance mode.

![image](https://github.com/user-attachments/assets/5f6860c2-7807-4ff1-9cad-d32dd4bc348b)
2025-02-17 11:37:51 -06:00
Jeffrey C. Ollie
3dbbbdee0b gtk: fix closing window when last tab is closed 2025-02-17 11:15:16 -06:00
Mitchell Hashimoto
16c6903706 Vertically center title when macos-titlebar-style = tabs (#5777)
Fix #3868 
<img width="812" alt="Frame 14"
src="https://github.com/user-attachments/assets/1fe78a13-ed8f-46e5-b4d4-69ecefdbdc22"
/>
2025-02-17 07:44:22 -08:00
Mitchell Hashimoto
3253df3d54 Equalize Splits invalid keybind (#5646)
refer to #4007

there are also quite a few posts about this in the discord help section

Basically for some reason for the equal key shift is not a typical
modifier where it would be the original key + shift modifier but it
actually just changes equal to respond as the plus key this is the only
key on the keyboard I can see exhibit this behavior

it seems all 3 major operating systems report the key this way (mac,
linux, and windows)
2025-02-17 07:41:42 -08:00
Aaron Ruan
830a117555 fix: vertically center toolbar title more accurately
Signed-off-by: Aaron Ruan <i@ar212.com>
2025-02-17 07:30:14 -08:00
rhodes-b
768b0a79cb dont use shift+equal combo 2025-02-17 07:26:32 -08:00
Mitchell Hashimoto
429c8ab277 fix: [snap] Don't set GDK_PIXBUF_MODULE_FILE, it causes the icon loader (#5820)
This fixes loading the tab-new-symbolic icon in the snap package
2025-02-16 20:45:22 -08:00
Ken VanDine
76bd002aa4 fix: [snap] Don't set GDK_PIXBUF_MODULE_FILE, it causes the icon loader 2025-02-16 23:18:16 -05:00
Jeffrey C. Ollie
246f4baf7c gtk: rename notebook to TabView and switch to gobject (#5795) 2025-02-16 17:43:46 -06:00
Mitchell Hashimoto
1013ba63ee [macOS] feat: Add "Split Left" and "Split Up" actions to menubar (#5807)
Fixes #5779
2025-02-16 12:37:11 -08:00
mbrown379
b1df97b33f Add Split Left and Split Up to menu 2025-02-16 15:14:02 -05:00
Jeffrey C. Ollie
25b93ceb55 gtk: disable shortcuts in tab view 2025-02-16 13:56:15 -06:00
Jeffrey C. Ollie
497a1b6f8f gtk: prevent double free when closing window 2025-02-16 13:56:15 -06:00
Jeffrey C. Ollie
bf7e9603d2 gtk: rename notebook to TabView and switch to gobject 2025-02-16 13:56:15 -06:00
Mitchell Hashimoto
2e7ed98dfd build: fix colorscheme update (#5797) 2025-02-16 08:39:39 -08:00
Jeffrey C. Ollie
36e6ed3339 build: fix colorscheme update 2025-02-15 23:39:40 -06:00
Jeffrey C. Ollie
9a5bc65034 gtk: fix building on Debian 12 (#5791)
`std.debug.assert(x)` _is not_ the same as `if (!x) unreachable` because
the function call is not `inline`. Since it's not inline the Zig
compiler will try to compile any code that might otherwise be
unreachable.

Also, added a CI test that compiles Ghostty in a Debian 12 container to
ensure that regressions do not happen.
2025-02-15 18:31:39 -06:00
Mitchell Hashimoto
8ad2ae6ab4 Update iTerm2 colorschemes (#5793)
Upstream revision:
efb1bb1843
2025-02-15 16:26:58 -08:00
mitchellh
fe11efff63 deps: Update iTerm2 color schemes 2025-02-16 00:13:20 +00:00
Jeffrey C. Ollie
b0d68324a6 gtk: fix multiple build args in docker build 2025-02-15 18:11:42 -06:00
Jeffrey C. Ollie
fb35d10981 gtk: add Zig version as arg to Debian 12 build 2025-02-15 18:01:07 -06:00
Jeffrey C. Ollie
191b19f9a5 gtk: add debian build to list of required checks 2025-02-15 17:58:25 -06:00
Jeffrey C. Ollie
c7b3cbd397 gtk: only test Debian 12 builds on amd64 2025-02-15 17:57:19 -06:00
Jeffrey C. Ollie
0ce1342263 gtk: fix building on Debian 12
`std.debug.assert(x)` _is not_ the same as `if (!x) unreachable`
because the function call is not `inline`. Since it's not inline the
Zig compiler will try to compile any code that might otherwise be
unreachable.

Also, added a CI test that compiles Ghostty in a Debian 12 container to
ensure that regressions do not happen.
2025-02-15 16:53:53 -06:00
Mitchell Hashimoto
6d8db4b380 [macOS] feat: Add setting to hide icon from dock/cmd-tab (#5122)
Resolves #4538 

Adds boolean configuration option `macos-hidden` which toggles the
NSApp's activation policy appropriately on config change.
2025-02-15 11:00:32 -08:00
Albert Dong
d7a82f212a Add setting to hide icon from dock/cmd-tab 2025-02-15 10:45:27 -08:00
Mitchell Hashimoto
aeccbd266a Added snap packaging (#3931)
Added snap packaging, fixes #3153

If whoever registered the name in the snap store could add me as a
collaborator, I can handle getting it released in the store, setup
automated builds, and request the necessary classic permissions in the
store.
2025-02-15 09:24:36 -08:00
Thom Dickson
ac9f8ba9b1 wip: allow directional split movement 2025-02-15 10:14:21 -06:00
Mitchell Hashimoto
baa47ff24e ci: test requires build-snap 2025-02-15 07:24:25 -08:00
Mitchell Hashimoto
818bc779b3 apprt/gtk: unset snap env vars 2025-02-15 07:22:21 -08:00
Mitchell Hashimoto
88a6b542b3 ci: move snap testing into our big test workflow 2025-02-15 07:20:55 -08:00
Mitchell Hashimoto
494273cf08 ci: snap workflow requires git history 2025-02-15 07:10:31 -08:00
Mitchell Hashimoto
03d1240999 nix: use snapcraft only on Linux 2025-02-15 07:07:23 -08:00
Ken VanDine
b551e106a8 Comment out refresh-mode, the store rejects this. Needs fixing in
review-tools
2025-02-15 07:06:40 -08:00
Ken VanDine
0c3b873dde Merge remote-tracking branch 'origin/add_snap_package' into add_snap_package 2025-02-15 07:06:40 -08:00
Ken VanDine
d3623393a6 More environment handling to ensure reliability across distros 2025-02-15 07:06:40 -08:00
Ken VanDine
2adee4290a Improved rpath handling for ghostty 2025-02-15 07:06:40 -08:00
Ken VanDine
94e2982d4b Allow snap to refresh while running 2025-02-15 07:06:40 -08:00
Ken VanDine
238b0faf5c Simplified setting snap version 2025-02-15 07:06:40 -08:00
Ken VanDine
927f626d9a Merge remote-tracking branch 'upstream/main' into add_snap_package 2025-02-15 07:06:40 -08:00
Ken VanDine
bd6a133e95 Updated stage packages 2025-02-15 07:06:40 -08:00
Ken VanDine
1c41cf236f Merge branch 'ghostty-org:main' into add_snap_package 2025-02-15 07:06:40 -08:00
Ken VanDine
a831df903d Merge branch 'ghostty-org:main' into add_snap_package 2025-02-15 07:06:40 -08:00
Ken VanDine
ff5c1001c6 Per PR review feedback, this is the more "ziggy" way of doing the check for environment variable. 2025-02-15 07:06:40 -08:00
Ken VanDine
e4cf81c2ba Clean up environment variable while launching the shell 2025-02-15 07:06:40 -08:00
Ken VanDine
cb5379ab1d Unset environment varies set by the snap 2025-02-15 07:06:40 -08:00
Ken VanDine
7e5c57a848 Only export XDG_CONFIG_HOME and XDG_DATA_HOME if they aren't already set 2025-02-15 07:06:40 -08:00
Ken VanDine
5841a4f958 Stage libglib2.0-0t64 to insure we don't mix in the host's lib 2025-02-15 07:06:40 -08:00
Ken VanDine
725488e1a2 Improved environment handling to ensure the snap will work across
distros and unset all SNAP environment variables that could leak at
runtime
2025-02-15 07:06:40 -08:00
Ken VanDine
0acf82bb9c Use patch-rpath which improves our cross distro support 2025-02-15 07:06:40 -08:00
Mitchell Hashimoto
9944fd5958 ci: temporary apt installs required for namespace 2025-02-15 07:06:40 -08:00
Ken VanDine
e7d4daa7c1 Removed duplicated stage-packages 2025-02-15 07:06:40 -08:00
Ken VanDine
5de0e775cb Don't stage shells 2025-02-15 07:06:40 -08:00
Ken VanDine
301fdff58f enable-patchelf is more repliable for classic snaps 2025-02-15 07:06:40 -08:00
Ken VanDine
99c7abb43a Set GHOSTTY_RESOURCES_DIR 2025-02-15 07:06:40 -08:00
Ken VanDine
a85de40710 Exit with error if building for unsupported arch 2025-02-15 07:06:40 -08:00
Ken VanDine
e174fb2748 no-patchelf for DRI and tidy up the mesa bits 2025-02-15 07:06:40 -08:00
Ken VanDine
403eab2cf0 Stage gnome-text-editor to open configuration, this makes it more
reliable across more distros as a classic snap.
2025-02-15 07:06:40 -08:00
Ken VanDine
bdafc2227c Drop patchelf 2025-02-15 07:06:40 -08:00
Ken VanDine
c9cafd3051 Enable patch-elf for libs part 2025-02-15 07:06:40 -08:00
Ken VanDine
48f94e6fcc Stage more depends to ensure we aren't getting leaks from the host 2025-02-15 07:06:40 -08:00
Ken VanDine
43b2e43a11 EGL fixes, ensure necessary env variables are set to isolate
dependencies from the host
2025-02-15 07:06:40 -08:00
Ken VanDine
8dffe3450c CRAFT_TARGET_ARCH is deprecated, use CRAFT_ARCH_BUILD_FOR 2025-02-15 07:06:40 -08:00
Ken VanDine
ae953b5f10 Ensure LD_LIBRARY_PATH is set appropriately 2025-02-15 07:06:40 -08:00
Mitchell Hashimoto
c7635201ab Add snap to nix, add arm64 builders 2025-02-15 07:06:40 -08:00
Ken VanDine
c35ca1e87f Set a more meaningful version for the snap 2025-02-15 07:06:40 -08:00
Ken VanDine
d06d6796c5 Changed shebang in launcher script 2025-02-15 07:06:40 -08:00
Ken VanDine
e6c9dc7040 Only run snap workflow on push and PR 2025-02-15 07:06:40 -08:00
Ken VanDine
5d0dde57f9 Don't stage shells 2025-02-15 07:06:40 -08:00
Ken VanDine
d0108416d0 enable-patchelf is more repliable for classic snaps 2025-02-15 07:06:40 -08:00
Ken VanDine
71297870cf Set GHOSTTY_RESOURCES_DIR 2025-02-15 07:06:40 -08:00
Ken VanDine
fcde494440 Install bash-completion 2025-02-15 07:06:40 -08:00
Ken VanDine
b7bd8444c7 Exit with error if building for unsupported arch 2025-02-15 07:06:40 -08:00
Ken VanDine
2b2b3c5b3b Set source-type for launcher dir 2025-02-15 07:06:40 -08:00
Ken VanDine
818c81282b Added snap build workflow 2025-02-15 07:06:40 -08:00
Ken VanDine
f0842c5599 Added snap packaging 2025-02-15 07:06:40 -08:00
Jeffrey C. Ollie
2d0940f6ae gtk: require libadwaita (#5749)
This commit removes support for building without libadwaita. (Y'all knew
that I just had this sitting in my back pocket). This will need some
serious review to ensure that we haven't lost any functionality.
2025-02-15 09:04:11 -06:00
Tim Culverhouse
f1f1120749 termio: use modified backend (#5776)
In Termio.init, we make a copy of backend and modify it by calling
initTerminal. However, we used the original in the struct definition.
This lead to the pty being opened with a size 0,0.
2025-02-14 22:57:50 -06:00
Mitchell Hashimoto
c1ff382e97 core: add env config option (#5309)
Fixes #5257

Specify environment variables to pass to commands launched in a terminal
surface. The format is `env=KEY=VALUE`.

`env = foo=bar`
`env = bar=baz`

Setting `env` to an empty string will reset the entire map to default
(empty).

`env =`

Setting a key to an empty string will remove that particular key and
corresponding value from the map.

`env = foo=bar`
`env = foo=`

will result in `foo` not being passed to the launched commands. Setting
a key multiple times will overwrite previous entries.

`env = foo=bar`
`env = foo=baz`

will result in `foo=baz` being passed to the launched commands.

These environment variables _will not_ be passed to commands run by
Ghostty for other purposes, like `open` or `xdg-open` used to open URLs
in your browser.
2025-02-14 20:55:51 -08:00
Tim Culverhouse
29f25ae474 termio: prevent responses to non-query OSC 21 sequences (#5770)
The Ghostty implementation of OSC 21 (Kitty color protocol) currently
responds to *all* OSC 21 sequences. It should not respond to a set, nor
a reset command. Fix the implementation so that we only respond if a
query was received.
2025-02-14 22:50:03 -06:00
Jeffrey C. Ollie
c7971b562e core: add env config option
Fixes #5257

Specify environment variables to pass to commands launched in a terminal
surface. The format is `env=KEY=VALUE`.

`env = foo=bar`
`env = bar=baz`

Setting `env` to an empty string will reset the entire map to default
(empty).

`env =`

Setting a key to an empty string will remove that particular key and
corresponding value from the map.

`env = foo=bar`
`env = foo=`

will result in `foo` not being passed to the launched commands.
Setting a key multiple times will overwrite previous entries.

`env = foo=bar`
`env = foo=baz`

will result in `foo=baz` being passed to the launched commands.

These environment variables _will not_ be passed to commands run by Ghostty
for other purposes, like `open` or `xdg-open` used to open URLs in your
browser.
2025-02-14 20:50:01 -08:00
Tim Culverhouse
b7009202ce termio: use modified backend
In Termio.init, we make a copy of backend and modify it by calling
initTerminal. However, we used the original in the struct definition.
This lead to the pty being opened with a size 0,0.
2025-02-14 22:44:27 -06:00
Jeffrey C. Ollie
25c5ecf553 gtk: require libadwaita
This commit removes support for building without libadwaita.
2025-02-14 21:49:51 -06:00
Tim Culverhouse
09fbf096d3 termio: prevent responses to non-query OSC 21 sequences
The Ghostty implementation of OSC 21 (Kitty color protocol) currently
responds to *all* OSC 21 sequences. It should not respond to a set, nor
a reset command. Fix the implementation so that we only respond if a
query was received.
2025-02-14 18:55:26 -06:00
Mitchell Hashimoto
b975f1e860 cli: disable +boo on non-desktop platforms due to lack of tty 2025-02-14 15:14:05 -08:00
Mitchell Hashimoto
8c4b0f815d prettier 2025-02-14 14:54:59 -08:00
Mitchell Hashimoto
4e8e2d9796 nix: snapcraft should only be installed on Linux 2025-02-14 14:52:36 -08:00
Ken VanDine
90ce5b75f1 Simplified setting snap version 2025-02-14 14:52:08 -08:00
Ken VanDine
fd9cbde3d8 Merge remote-tracking branch 'upstream/main' into add_snap_package 2025-02-14 14:52:08 -08:00
Ken VanDine
b0edda4b69 Updated stage packages 2025-02-14 14:52:08 -08:00
Ken VanDine
bbd279bb4f Merge branch 'ghostty-org:main' into add_snap_package 2025-02-14 14:52:08 -08:00
Ken VanDine
bdbf30dc96 Merge branch 'ghostty-org:main' into add_snap_package 2025-02-14 14:52:08 -08:00
Ken VanDine
a111b3f96f Per PR review feedback, this is the more "ziggy" way of doing the check for environment variable. 2025-02-14 14:52:08 -08:00
Ken VanDine
f239df59ca Clean up environment variable while launching the shell 2025-02-14 14:52:08 -08:00
Ken VanDine
c036eb2444 Unset environment varies set by the snap 2025-02-14 14:52:08 -08:00
Ken VanDine
cee189de11 Only export XDG_CONFIG_HOME and XDG_DATA_HOME if they aren't already set 2025-02-14 14:52:08 -08:00
Ken VanDine
d2f82b2e40 Stage libglib2.0-0t64 to insure we don't mix in the host's lib 2025-02-14 14:52:08 -08:00
Ken VanDine
3e669fc4bb Improved environment handling to ensure the snap will work across
distros and unset all SNAP environment variables that could leak at
runtime
2025-02-14 14:52:08 -08:00
Ken VanDine
1a5b69181f Use patch-rpath which improves our cross distro support 2025-02-14 14:52:08 -08:00
Mitchell Hashimoto
55c5b8b72f ci: temporary apt installs required for namespace 2025-02-14 14:52:08 -08:00
Ken VanDine
5e77a973b2 Removed duplicated stage-packages 2025-02-14 14:52:08 -08:00
Ken VanDine
9c81cd323d Don't stage shells 2025-02-14 14:52:08 -08:00
Ken VanDine
78446008c4 enable-patchelf is more repliable for classic snaps 2025-02-14 14:52:08 -08:00
Ken VanDine
e09d8455a1 Set GHOSTTY_RESOURCES_DIR 2025-02-14 14:52:08 -08:00
Ken VanDine
1dcea3b11f Exit with error if building for unsupported arch 2025-02-14 14:52:08 -08:00
Ken VanDine
9d62c31f44 no-patchelf for DRI and tidy up the mesa bits 2025-02-14 14:52:08 -08:00
Ken VanDine
0272ad9edb Stage gnome-text-editor to open configuration, this makes it more
reliable across more distros as a classic snap.
2025-02-14 14:52:08 -08:00
Ken VanDine
f3829072f3 Drop patchelf 2025-02-14 14:52:08 -08:00
Ken VanDine
2b6b7c19d2 Enable patch-elf for libs part 2025-02-14 14:52:08 -08:00
Ken VanDine
3a9d61d6e4 Stage more depends to ensure we aren't getting leaks from the host 2025-02-14 14:52:08 -08:00
Ken VanDine
6d8b3973e4 EGL fixes, ensure necessary env variables are set to isolate
dependencies from the host
2025-02-14 14:52:08 -08:00
Ken VanDine
aa4d9809c3 CRAFT_TARGET_ARCH is deprecated, use CRAFT_ARCH_BUILD_FOR 2025-02-14 14:52:08 -08:00
Ken VanDine
ec8e7d9d86 Ensure LD_LIBRARY_PATH is set appropriately 2025-02-14 14:52:08 -08:00
Mitchell Hashimoto
f1f23e1c7d Add snap to nix, add arm64 builders 2025-02-14 14:52:08 -08:00
Ken VanDine
2e0e8af1ad Set a more meaningful version for the snap 2025-02-14 14:52:08 -08:00
Ken VanDine
53f1b4bc15 Changed shebang in launcher script 2025-02-14 14:52:08 -08:00
Ken VanDine
eae420a241 Only run snap workflow on push and PR 2025-02-14 14:52:08 -08:00
Ken VanDine
bf49784b7d Don't stage shells 2025-02-14 14:52:08 -08:00
Ken VanDine
b6a3b98828 enable-patchelf is more repliable for classic snaps 2025-02-14 14:52:08 -08:00
Ken VanDine
eb0816c2c4 Set GHOSTTY_RESOURCES_DIR 2025-02-14 14:52:08 -08:00
Ken VanDine
30fa18390f Install bash-completion 2025-02-14 14:52:08 -08:00
Ken VanDine
f51789b17a Exit with error if building for unsupported arch 2025-02-14 14:52:08 -08:00
Ken VanDine
97b104cf9d Set source-type for launcher dir 2025-02-14 14:52:08 -08:00
Ken VanDine
a7d1029e5c Added snap build workflow 2025-02-14 14:52:08 -08:00
Ken VanDine
aed30502bd Added snap packaging 2025-02-14 14:52:08 -08:00
Mitchell Hashimoto
56efaf0c82 [macOS] feat: add bring_all_to_front keybinding (#5006)
Can't consider the feature complete until the Linux (GTK) implementation
:/ .

Fixes #4704
2025-02-14 14:49:28 -08:00
Mitchell Hashimoto
686b6a2971 cli: add +boo command (#4876)
Add a `+boo` command to show the animation from the website. The data
for the frames is compressed during the build process. This build step
was added to the SharedDeps object because it is used in both
libghostty and in binaries.

The compression is done as follows:

- All files are concatenated together using \x01 as a combining byte
- The files are compressed to a cached build file
- A zig file is written to stdout which `@embedFile`s the compressed
  file and exposes it to the importer
- A new anonymous module "framedata" is added in the SharedDeps object

Any file can import framedata and access the compressed bytes via
`framedata.compressed`. In the `boo` command, we decompress the slice
and
split it into frames for use in the animation.

The overall addition to the binary size is 348k.
2025-02-14 14:47:51 -08:00
Tim Culverhouse
9cb297202b cli: add +boo command
Add a `+boo` command to show the animation from the website. The data
for the frames is compressed during the build process. This build step
was added to the SharedDeps object because it is used in both
libghostty and in binaries.

The compression is done as follows:
- All files are concatenated together using \x01 as a combining byte
- The files are compressed to a cached build file
- A zig file is written to stdout which `@embedFile`s the compressed
  file and exposes it to the importer
- A new anonymous module "framedata" is added in the SharedDeps object

Any file can import framedata and access the compressed bytes via
`framedata.compressed`. In the `boo` command, we decompress the file and
split it into frames for use in the animation.

The overall addition to the binary size is 348k.
2025-02-14 14:46:18 -08:00
Damien Mehala
a0f243691a feat: add bring_all_to_front keybinding
Resolves #4704.
2025-02-14 14:41:49 -08:00
Mitchell Hashimoto
cdfea4bc7e feat: add save instruction to +list-themes (#4902)
Close #4731 

<img width="1164" alt="image"
src="https://github.com/user-attachments/assets/50cb96cc-5192-424f-9ec6-1a150ae7f98b"
/>
2025-02-14 13:47:46 -08:00
Aaron Ruan
5c1f85e861 Merge branch 'ghostty-org:main' into list-theme-save 2025-02-14 13:44:33 -08:00
Aaron Ruan
2da7d77feb add save instruction to +list-themes
Signed-off-by: Aaron Ruan <aaron212cn@outlook.com>
2025-02-14 13:44:33 -08:00
Mitchell Hashimoto
1121ea9d6c Add tab title renaming feature to macos (#4217)
Tries to resolve #2509 partially by enabling tab title renaming feature
for MacOS.

* Used the existing set_title action
* Added the set_title action to Bindings so that a keybind can be set
for this feature (defaulted this to cmd+i -- same as iTerm2)
* 3 ways to trigger this feature: "Set Title" option in the right-click
menu for the window, "Set Title" option in the "View" menu in the title
bar, and the keybind (cmd+i default)
* Prevented esc sequences from the different programs from resetting the
tab title once it is set manually using a new state var called
`titleSetManually` in the SurfaceView
* The input box is a basic native macos dialog with "OK" and "Cancel".
Leaving the title text box empty resets the title to automatic / from
the `title` property in the config

**Demo**:


https://github.com/user-attachments/assets/5cacc389-4486-46c4-8cd5-dda347e9c663


Need some feedback. Thanks!
2025-02-14 13:37:29 -08:00
Aswin M Prabhu
a581955b9b Add tab title rename feature to macos 2025-02-14 13:29:36 -08:00
Mitchell Hashimoto
228b4dbd60 build: mirror most of our direct dependencies (#5765)
This adds a new script `update-mirror.sh` which generates the proper
blob format for R2 (or any blob storage) to mirror all of our
dependencies.

It doesn't automate updating build.zig.zon but on an ongoing basis this
should be easy to do manually, and we can strive to automate it in the
future.

I omitted iTerm2 color themes because we auto-update that via CI and
updating all of the machinery to send it to our mirror and so on is a
pain. Additionally, this doesn't mirror transitive dependencies because
Zig doesn't have a way to fetch those from a mirror instead (unless you
pre-generate a full cache like packagers but that's not practical for
day to day development).

It's hugely beneficial just to get most of our dependencies mirrored.
2025-02-14 11:34:08 -08:00
Mitchell Hashimoto
8231ebb770 build: mirror most of our direct dependencies
This adds a new script `update-mirror.sh` which generates the proper
blob format for R2 (or any blob storage) to mirror all of our
dependencies.

It doesn't automate updating build.zig.zon but on an ongoing basis this
should be easy to do manually, and we can strive to automate it in the
future.

I omitted iTerm2 color themes because we auto-update that via CI and
updating all of the machinery to send it to our mirror and so on is a
pain. Additionally, this doesn't mirror transitive dependencies because
Zig doesn't have a way to fetch those from a mirror instead (unless you
pre-generate a full cache like packagers but that's not practical for
day to day development).

It's hugely beneficial just to get most of our dependencies mirrored.
2025-02-14 10:06:15 -08:00
Mitchell Hashimoto
95e6a27393 build: generate a build.zig.zon.txt file for easy zig fetch scripting (#5764)
This fixes a regression in 1.1.1/1.1.2 where our PACKAGING docs mention
using `fetch-zig-cache.sh` but it was removed. This commit adds it back,
generating its contents from the build.zig.zon file (via zon2nix which
we use for our Nix packaging).

For packagers, there are no dependency changes: you still need Zig and
POSIX sh. For release time, Ghostty has a new dependency on `jq` but
otherwise the release process is the same. The check-zig-cache.sh script
is updated to generate the new build.zig.zon.txt file.
2025-02-14 09:24:07 -08:00
Jeffrey C. Ollie
f32ad5216b build: generate a build.zig.zon.txt file for easy zig fetch scripting
This fixes a regression in 1.1.1/1.1.2 where our PACKAGING docs mention
using `fetch-zig-cache.sh` but it was removed. This commit adds it back,
generating its contents from the build.zig.zon file (via zon2nix which
we use for our Nix packaging).

For packagers, there are no dependency changes: you still need Zig and
POSIX sh. For release time, Ghostty has a new dependency on `jq` but
otherwise the release process is the same. The check-zig-cache.sh script
is updated to generate the new build.zig.zon.txt file.
2025-02-14 09:23:51 -08:00
Mitchell Hashimoto
56b244973f Add back fetch-zig-cache.sh for packaging (#5762)
See the comment on more details, which also covers when and how we can
remove this.
2025-02-14 08:07:28 -08:00
Mitchell Hashimoto
cdd287c88b Add back fetch-zig-cache.sh for packaging
See the comment on more details, which also covers when and how we can
remove this.
2025-02-14 07:23:26 -08:00
Mitchell Hashimoto
315df0ab3f macos: add padded-notch option for macos-non-native-fullscreen (#5750)
Finishes #378
Supercedes #4159

This adds a new enum value for `macos-non-native-fullscreen`:
`padded-notch`. This value will add padding to the top of the window to
account for the notch on applicable devices while still hiding the menu.

This value is preferred over "visible-menu" by some people because for
screens without a notch, the window will take up the full height.

The plan in the future is that we may color the padded area when a notch
is present. In this commit it appears as transparent.

EDIT: Hah, the video below is pretty useless since the screen recording
software omits the notch. 😄


https://github.com/user-attachments/assets/4b1e84dd-3b3a-44a8-a83b-0f51e44f6cf8
2025-02-13 21:09:29 -08:00
Mitchell Hashimoto
ac7aa757bd macos: add padded-notch option for macos-non-native-fullscreen
Finishes #378
Supercedes #4159

This adds a new enum value for `macos-non-native-fullscreen`:
`padded-notch`. This value will add padding to the top of the window to
account for the notch on applicable devices while still hiding the
menu.

This value is preferred over "visible-menu" by some people because for
screens without a notch, the window will take up the full height.

The plan in the future is that we may color the padded area when a notch
is present. In this commit it appears as transparent.
2025-02-13 20:27:42 -08:00
Mitchell Hashimoto
52a5069dec up versions for development 2025-02-13 15:31:14 -08:00
922 changed files with 93696 additions and 28736 deletions

2
.envrc
View File

@ -4,3 +4,5 @@ if has nix; then
watch_file nix/{devShell,package,wraptest}.nix watch_file nix/{devShell,package,wraptest}.nix
use flake use flake
fi fi
source_env_if_exists .envrc.local

5
.gitattributes vendored
View File

@ -1,7 +1,12 @@
build.zig.zon.nix linguist-generated=true build.zig.zon.nix linguist-generated=true
build.zig.zon.txt linguist-generated=true
build.zig.zon.json linguist-generated=true
vendor/** linguist-vendored vendor/** linguist-vendored
website/** linguist-documentation website/** linguist-documentation
pkg/breakpad/vendor/** linguist-vendored pkg/breakpad/vendor/** linguist-vendored
pkg/cimgui/vendor/** linguist-vendored pkg/cimgui/vendor/** linguist-vendored
pkg/glfw/wayland-headers/** linguist-vendored
pkg/libintl/config.h linguist-generated=true
pkg/libintl/libintl.h linguist-generated=true
pkg/simdutf/vendor/** linguist-vendored pkg/simdutf/vendor/** linguist-vendored
src/terminal/res/** linguist-vendored src/terminal/res/** linguist-vendored

View File

@ -0,0 +1,162 @@
labels: ["needs-confirmation"]
body:
- type: markdown
attributes:
value: |
> [!IMPORTANT]
> Please read through [the Discussion rules](https://github.com/ghostty-org/ghostty/discussions/6937), review [the FAQs](https://ghostty.org/docs/help#common-issues-and-solutions), and check for both existing [Discussions](https://github.com/ghostty-org/ghostty/discussions?discussions_q=) and [Issues](https://github.com/ghostty-org/ghostty/issues?q=sort%3Areactions-desc) prior to opening a new Discussion.
- type: markdown
attributes:
value: "# Issue Details"
- type: textarea
attributes:
label: Issue Description
description: |
Provide a detailed description of the issue. Include relevant information, such as:
- The feature or configuration option you encounter the issue with.
- Screenshots, screen recordings, or other supporting media (as needed).
- If this is a regression of an existing issue that was closed or resolved, please include the previous item reference (Discussion, Issue, PR, commit) in your description.
> [!TIP]
> **Not sure what information to include?**
> Here are some recommendations:
> - **Input issues:** include your keyboard layout, a screenshot of logged keystrokes from the terminal inspector's "Keyboard" tab (Linux: <kbd>ctrl</kbd>+<kbd>shift</kbd>+<kbd>i</kbd>; MacOS: <kbd>cmd</kbd>+<kbd>alt</kbd>+<kbd>i</kbd>), input method, Linux input method engine (IBus, Fcitx 5, or none) and its version.
> - **Font issues:** include the problematic character(s), the output of `ghostty +show-face` for these character(s), and if they work in other applications.
> - **Terminal emulation issues (including image rendering issues):** attach an [asciinema](https://docs.asciinema.org/getting-started/) cast file, shell script, or text file for reproduction.
> - **Renderer issues:** (Linux) include your OpenGL version, graphics card, driver version.
> - **Crashes:** (macOS) include the [Sentry UUID](https://github.com/ghostty-org/ghostty?tab=readme-ov-file#crash-reports); (Linux) try to reproduce using a debug build and provide the stack trace.
placeholder: |
When using SSH to connect to my remote Linux machine from my local macOS device in Ghostty, I try to run `clear`, and the screen does not clear. Instead, I see the following error message printed to the terminal: `Error opening terminal: xterm-ghostty.`
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: |
Describe how you expect Ghostty to behave in this situation. Include any relevant documentation links.
placeholder: |
The screen is cleared and the prompt is redrawn at the top of the window.
validations:
required: true
- type: textarea
attributes:
label: Actual Behavior
description: |
Describe how Ghostty actually behaves in this situation. If it is not immediately obvious how the actual behavior differs from the expected behavior described above, please be sure to mention the deviation specifically.
placeholder: |
The screen is not cleared, and an error is printed: `Error opening terminal: xterm-ghostty`.
validations:
required: true
- type: textarea
attributes:
label: Reproduction Steps
description: |
Provide a detailed set of step-by-step instructions for reproducing this issue.
placeholder: |
1. Open Ghostty.
2. Connect to a remote server via SSH.
3. Try to execute `clear`.
4. Observe `xterm-ghostty` error message above.
validations:
required: true
- type: textarea
attributes:
label: Ghostty Logs
description: |
Provide any captured Ghostty logs or stacktraces during your issue reproduction in this field. On Linux, logs can be found by running `ghostty` from the command-line; on macOS, logs can be viewed with `sudo log stream --level debug --predicate 'subsystem=="com.mitchellh.ghostty"'` from another terminal emulator.
render: text
- type: textarea
attributes:
label: Ghostty Version
description: Paste the output of `ghostty +version` here.
placeholder: |
Ghostty 1.1.3
Version
- version: 1.1.3
- channel: stable
Build Config
- Zig version: 0.13.0
- build mode : builtin.OptimizeMode.ReleaseFast
- app runtime: apprt.Runtime.none
- font engine: font.main.Backend.coretext
- renderer : renderer.Metal
- libxev : main.Backend.kqueue
render: text
validations:
required: true
- type: input
attributes:
label: OS Version Information
description: |
Please tell us what operating system (name and version) you are using.
placeholder: Ubuntu 24.04.1 (Noble Numbat)
validations:
required: true
- type: dropdown
attributes:
label: (Linux only) Display Server
description: |
If you run Linux, please tell us if you use X11 or Wayland. If you aren't sure, you can determine this by running `[ -z "$WAYLAND_DISPLAY" ] && echo X11 || echo Wayland`.
options:
- X11
- Wayland
- Other
validations:
required: false
- type: input
attributes:
label: (Linux only) Desktop Environment/Window Manager
description: |
If you run Linux, please tell us what Desktop Environment/Window Manager you are using (include the name and version).
placeholder: GNOME 47.4
validations:
required: false
- type: textarea
attributes:
label: Minimal Ghostty Configuration
description: |
Please provide the **minimum** configuration needed to reproduce this issue. If you can still reproduce the issue with one of the lines removed, do not include that line. If and **only** if you are not able to determine this, paste the contents of your Ghostty configuration file here.
placeholder: |
font-family = CommitMono Nerd Font
font-family-bold = CommitMono Nerd Font
font-family-italic = CommitMono Nerd Font
font-family-bold-italic = CommitMono Nerd Font
font-feature = +cv07
font-size = 16
font-thicken = true
theme = catppuccin-mocha
render: ini
validations:
required: true
- type: textarea
attributes:
label: Additional Relevant Configuration
description: |
If your issue involves other programs, tools, or applications in addition to Ghostty (e.g. Neovim, tmux, Zellij, etc.), please provide the minimum configuration and versions needed for all relevant programs to reproduce the issue here. If you use custom CSS or shaders for Ghostty, also include them here, if applicable to your issue.
placeholder: |
#### `tmux.conf` (tmux 3.5a)
```
set -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ",xterm*:Tc"
set -g base-index 1
setw -g pane-base-index 1
```
validations:
required: false
- type: markdown
attributes:
value: |
# User Acknowledgements
> [!TIP]
> Use these links to review the existing Ghostty [Discussions](https://github.com/ghostty-org/ghostty/discussions?discussions_q=) and [Issues](https://github.com/ghostty-org/ghostty/issues?q=sort%3Areactions-desc).
- type: checkboxes
attributes:
label: "I acknowledge that:"
options:
- label: I have reviewed the FAQ and confirm that my issue is NOT among them.
required: true
- label: I have searched the Ghostty repository (both open and closed Discussions and Issues) and confirm this is not a duplicate of an existing issue or discussion.
required: true
- label: I have checked the "Preview" tab on all text fields to ensure that everything looks right, and have wrapped all configuration and code in code blocks with a group of three backticks (` ``` `) on separate lines.
required: true

14
.github/scripts/check-translations.sh vendored Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
old_pot=$(mktemp)
cp po/com.mitchellh.ghostty.pot "$old_pot"
zig build update-translations
# Compare previous POT to current POT
msgcmp "$old_pot" po/com.mitchellh.ghostty.pot --use-untranslated
# Compare all other POs to current POT
for f in po/*.po; do
# Ignore untranslated entries
msgcmp --use-untranslated "$f" po/com.mitchellh.ghostty.pot;
done

View File

@ -36,16 +36,16 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
- name: Setup Nix - name: Setup Nix
uses: cachix/install-nix-action@v30 uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

View File

@ -47,7 +47,7 @@ jobs:
sentry-cli dif upload --project ghostty --wait dsym.zip sentry-cli dif upload --project ghostty --wait dsym.zip
build-macos: build-macos:
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
timeout-minutes: 90 timeout-minutes: 90
steps: steps:
- name: Checkout code - name: Checkout code
@ -57,10 +57,10 @@ jobs:
fetch-depth: 0 fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -94,7 +94,7 @@ jobs:
- name: Build Ghostty.app - name: Build Ghostty.app
run: | run: |
cd macos cd macos
sudo xcode-select -s /Applications/Xcode_16.0.app sudo xcode-select -s /Applications/Xcode_26.0.app
xcodebuild -target Ghostty -configuration Release xcodebuild -target Ghostty -configuration Release
# We inject the "build number" as simply the number of commits since HEAD. # We inject the "build number" as simply the number of commits since HEAD.
@ -199,7 +199,7 @@ jobs:
destination-dir: ./ destination-dir: ./
build-macos-debug: build-macos-debug:
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
timeout-minutes: 90 timeout-minutes: 90
steps: steps:
- name: Checkout code - name: Checkout code
@ -209,10 +209,10 @@ jobs:
fetch-depth: 0 fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -246,7 +246,7 @@ jobs:
- name: Build Ghostty.app - name: Build Ghostty.app
run: | run: |
cd macos cd macos
sudo xcode-select -s /Applications/Xcode_16.0.app sudo xcode-select -s /Applications/Xcode_26.0.app
xcodebuild -target Ghostty -configuration Release xcodebuild -target Ghostty -configuration Release
# We inject the "build number" as simply the number of commits since HEAD. # We inject the "build number" as simply the number of commits since HEAD.

View File

@ -77,22 +77,31 @@ jobs:
needs: [setup] needs: [setup]
env: env:
GHOSTTY_VERSION: ${{ needs.setup.outputs.version }} GHOSTTY_VERSION: ${{ needs.setup.outputs.version }}
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30 - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Create Tarball - name: Create Tarball
run: | run: |
git archive --format=tgz --prefix="ghostty-${GHOSTTY_VERSION}/" -o "ghostty-${GHOSTTY_VERSION}.tar.gz" HEAD nix develop -c zig build distcheck
git archive --format=tgz --prefix=ghostty-source/ -o ghostty-source.tar.gz HEAD cp zig-out/dist/ghostty-${GHOSTTY_VERSION}.tar.gz .
- name: Sign Tarball - name: Sign Tarball
run: | run: |
@ -108,12 +117,10 @@ jobs:
path: |- path: |-
ghostty-${{ env.GHOSTTY_VERSION }}.tar.gz ghostty-${{ env.GHOSTTY_VERSION }}.tar.gz
ghostty-${{ env.GHOSTTY_VERSION }}.tar.gz.minisig ghostty-${{ env.GHOSTTY_VERSION }}.tar.gz.minisig
ghostty-source.tar.gz
ghostty-source.tar.gz.minisig
build-macos: build-macos:
needs: [setup] needs: [setup]
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
timeout-minutes: 90 timeout-minutes: 90
env: env:
GHOSTTY_VERSION: ${{ needs.setup.outputs.version }} GHOSTTY_VERSION: ${{ needs.setup.outputs.version }}
@ -123,16 +130,16 @@ jobs:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: XCode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_16.4.app
- name: Setup Sparkle - name: Setup Sparkle
env: env:
@ -281,7 +288,7 @@ jobs:
appcast: appcast:
needs: [setup, build-macos] needs: [setup, build-macos]
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
env: env:
GHOSTTY_VERSION: ${{ needs.setup.outputs.version }} GHOSTTY_VERSION: ${{ needs.setup.outputs.version }}
GHOSTTY_BUILD: ${{ needs.setup.outputs.build }} GHOSTTY_BUILD: ${{ needs.setup.outputs.build }}

View File

@ -101,24 +101,38 @@ jobs:
) )
}} }}
runs-on: namespace-profile-ghostty-md runs-on: namespace-profile-ghostty-md
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30 - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Create Tarball - name: Create Tarball
run: git archive --format=tgz --prefix=ghostty-source/ -o ghostty-source.tar.gz HEAD run: |
rm -rf zig-out/dist
nix develop -c zig build distcheck
cp zig-out/dist/*.tar.gz ghostty-source.tar.gz
- name: Sign Tarball - name: Sign Tarball
run: | run: |
echo -n "${{ secrets.MINISIGN_KEY }}" > minisign.key echo -n "${{ secrets.MINISIGN_KEY }}" > minisign.key
echo -n "${{ secrets.MINISIGN_PASSWORD }}" > minisign.password echo -n "${{ secrets.MINISIGN_PASSWORD }}" > minisign.password
nix develop -c minisign -S -m ghostty-source.tar.gz -s minisign.key < minisign.password nix develop -c minisign -S -m ghostty-source.tar.gz -s minisign.key < minisign.password
- name: Update Release - name: Update Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2.3.2
with: with:
name: 'Ghostty Tip ("Nightly")' name: 'Ghostty Tip ("Nightly")'
prerelease: true prerelease: true
@ -140,7 +154,7 @@ jobs:
) )
}} }}
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
timeout-minutes: 90 timeout-minutes: 90
steps: steps:
- name: Checkout code - name: Checkout code
@ -150,16 +164,16 @@ jobs:
fetch-depth: 0 fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: XCode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_26.0.app
# Setup Sparkle # Setup Sparkle
- name: Setup Sparkle - name: Setup Sparkle
@ -285,7 +299,7 @@ jobs:
# Update Release # Update Release
- name: Release - name: Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2.3.2
with: with:
name: 'Ghostty Tip ("Nightly")' name: 'Ghostty Tip ("Nightly")'
prerelease: true prerelease: true
@ -355,7 +369,7 @@ jobs:
) )
}} }}
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
timeout-minutes: 90 timeout-minutes: 90
steps: steps:
- name: Checkout code - name: Checkout code
@ -365,16 +379,16 @@ jobs:
fetch-depth: 0 fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: XCode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_26.0.app
# Setup Sparkle # Setup Sparkle
- name: Setup Sparkle - name: Setup Sparkle
@ -493,7 +507,7 @@ jobs:
# Update Release # Update Release
- name: Release - name: Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2.3.2
with: with:
name: 'Ghostty Tip ("Nightly")' name: 'Ghostty Tip ("Nightly")'
prerelease: true prerelease: true
@ -530,7 +544,7 @@ jobs:
) )
}} }}
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
timeout-minutes: 90 timeout-minutes: 90
steps: steps:
- name: Checkout code - name: Checkout code
@ -540,16 +554,16 @@ jobs:
fetch-depth: 0 fetch-depth: 0
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: XCode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_26.0.app
# Setup Sparkle # Setup Sparkle
- name: Setup Sparkle - name: Setup Sparkle
@ -668,7 +682,7 @@ jobs:
# Update Release # Update Release
- name: Release - name: Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@v2.3.2
with: with:
name: 'Ghostty Tip ("Nightly")' name: 'Ghostty Tip ("Nightly")'
prerelease: true prerelease: true

View File

@ -8,15 +8,22 @@ name: Test
jobs: jobs:
required: required:
name: "Required Checks: Test" name: "Required Checks: Test"
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-xsm
needs: needs:
- build
- build-bench - build-bench
- build-dist
- build-flatpak
- build-linux
- build-linux-libghostty - build-linux-libghostty
- build-nix - build-nix
- build-snap
- build-macos - build-macos
- build-macos-tahoe
- build-macos-matrix - build-macos-matrix
- build-windows - build-windows
- build-windows-cross
- flatpak-check-zig-cache
- flatpak
- test - test
- test-gtk - test-gtk
- test-sentry-linux - test-sentry-linux
@ -24,7 +31,11 @@ jobs:
- prettier - prettier
- alejandra - alejandra
- typos - typos
- translations
- blueprint-compiler
- test-pkg-linux - test-pkg-linux
- test-debian-12
- zig-fmt
steps: steps:
- id: status - id: status
name: Determine status name: Determine status
@ -45,52 +56,6 @@ jobs:
echo "One or more required build workflows failed: ${{ steps.status.outputs.results }}" echo "One or more required build workflows failed: ${{ steps.status.outputs.results }}"
exit 1 exit 1
build:
strategy:
fail-fast: false
matrix:
os: ["namespace-profile-ghostty-md"]
target: [
aarch64-linux,
x86_64-linux,
x86-windows-gnu,
x86_64-windows-gnu,
# We don't support cross-compiling to macOS because the macOS build
# requires xcode due to the swift harness.
#aarch64-macos,
#x86_64-macos,
]
runs-on: ${{ matrix.os }}
needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0
with:
path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
# Cross-compile the binary. We always use static building for this
# because its the only way to access the headers.
- name: Test Build
run: nix develop -c zig build -Dapp-runtime=glfw -Dtarget=${{ matrix.target }}
build-bench: build-bench:
# We build benchmarks on large because it uses ReleaseFast # We build benchmarks on large because it uses ReleaseFast
runs-on: namespace-profile-ghostty-lg runs-on: namespace-profile-ghostty-lg
@ -103,17 +68,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -121,6 +86,73 @@ jobs:
- name: Build Benchmarks - name: Build Benchmarks
run: nix develop -c zig build -Dapp-runtime=glfw -Demit-bench run: nix develop -c zig build -Dapp-runtime=glfw -Demit-bench
build-flatpak:
strategy:
fail-fast: false
runs-on: namespace-profile-ghostty-sm
needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build with Flatpak
run: |
nix develop -c \
zig build \
-Dflatpak=true
build-linux:
strategy:
fail-fast: false
matrix:
os: [namespace-profile-ghostty-md, namespace-profile-ghostty-md-arm64]
runs-on: ${{ matrix.os }}
needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Test Build
run: nix develop -c zig build -Dapp-runtime=glfw
build-linux-libghostty: build-linux-libghostty:
runs-on: namespace-profile-ghostty-md runs-on: namespace-profile-ghostty-md
needs: test needs: test
@ -132,17 +164,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -165,42 +197,96 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Test NixOS package build - name: Test release NixOS package build
run: nix build .#ghostty run: nix build .#ghostty-releasefast
- name: Check version
run: result/bin/ghostty +version | grep -q 'builtin.OptimizeMode.ReleaseFast'
- name: Check to see if the binary has been stripped
run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'no symbols'
- name: Test debug NixOS package build
run: nix build .#ghostty-debug
- name: Check version
run: result/bin/ghostty +version | grep -q 'builtin.OptimizeMode.Debug'
- name: Check to see if the binary has not been stripped
run: nm result/bin/.ghostty-wrapped 2>&1 | grep -q 'main_ghostty.main'
build-dist:
runs-on: namespace-profile-ghostty-md
needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build and Check Source Tarball
run: |
rm -rf zig-out/dist
nix develop -c zig build distcheck
cp zig-out/dist/*.tar.gz ghostty-source.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: source-tarball
path: |-
ghostty-source.tar.gz
build-macos: build-macos:
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
needs: test needs: test
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_26.0.app
- name: get the Zig deps - name: get the Zig deps
id: deps id: deps
@ -211,7 +297,47 @@ jobs:
- name: Build GhosttyKit - name: Build GhosttyKit
run: nix develop -c zig build --system ${{ steps.deps.outputs.deps }} run: nix develop -c zig build --system ${{ steps.deps.outputs.deps }}
# The native app is built with native XCode tooling. This also does # The native app is built with native Xcode tooling. This also does
# codesigning. IMPORTANT: this must NOT run in a Nix environment.
# Nix breaks xcodebuild so this has to be run outside.
- name: Build Ghostty.app
run: cd macos && xcodebuild -target Ghostty
# Build the iOS target without code signing just to verify it works.
- name: Build Ghostty iOS
run: |
cd macos
xcodebuild -target Ghostty-iOS "CODE_SIGNING_ALLOWED=NO"
build-macos-tahoe:
runs-on: namespace-profile-ghostty-macos-tahoe
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
# TODO(tahoe): https://github.com/NixOS/nix/issues/13342
- uses: DeterminateSystems/nix-installer-action@main
with:
determinate: true
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_26.0.app
- name: get the Zig deps
id: deps
run: nix build -L .#deps && echo "deps=$(readlink ./result)" >> $GITHUB_OUTPUT
# GhosttyKit is the framework that is built from Zig for our native
# Mac app to access.
- name: Build GhosttyKit
run: nix develop -c zig build --system ${{ steps.deps.outputs.deps }}
# The native app is built with native Xcode tooling. This also does
# codesigning. IMPORTANT: this must NOT run in a Nix environment. # codesigning. IMPORTANT: this must NOT run in a Nix environment.
# Nix breaks xcodebuild so this has to be run outside. # Nix breaks xcodebuild so this has to be run outside.
- name: Build Ghostty.app - name: Build Ghostty.app
@ -224,23 +350,23 @@ jobs:
xcodebuild -target Ghostty-iOS "CODE_SIGNING_ALLOWED=NO" xcodebuild -target Ghostty-iOS "CODE_SIGNING_ALLOWED=NO"
build-macos-matrix: build-macos-matrix:
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
needs: test needs: test
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_26.0.app
- name: get the Zig deps - name: get the Zig deps
id: deps id: deps
@ -276,6 +402,43 @@ jobs:
nix develop -c zig build --system ${{ steps.deps.outputs.deps }} -Dapp-runtime=glfw -Drenderer=metal -Dfont-backend=coretext_harfbuzz nix develop -c zig build --system ${{ steps.deps.outputs.deps }} -Dapp-runtime=glfw -Drenderer=metal -Dfont-backend=coretext_harfbuzz
nix develop -c zig build --system ${{ steps.deps.outputs.deps }} -Dapp-runtime=glfw -Drenderer=metal -Dfont-backend=coretext_noshape nix develop -c zig build --system ${{ steps.deps.outputs.deps }} -Dapp-runtime=glfw -Drenderer=metal -Dfont-backend=coretext_noshape
build-snap:
strategy:
fail-fast: false
matrix:
os:
[namespace-profile-ghostty-snap, namespace-profile-ghostty-snap-arm64]
runs-on: ${{ matrix.os }}
needs: [test, build-dist]
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Download Source Tarball Artifacts
uses: actions/download-artifact@v4
with:
name: source-tarball
- name: Extract tarball
run: |
mkdir dist
tar --verbose --extract --strip-components 1 --directory dist --file ghostty-source.tar.gz
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- run: sudo apt install -y udev
- run: sudo systemctl start systemd-udevd
# Workaround until this is fixed: https://github.com/canonical/lxd-pkg-snap/pull/789
- run: |
_LXD_SNAP_DEVCGROUP_CONFIG="/var/lib/snapd/cgroup/snap.lxd.device"
sudo mkdir -p /var/lib/snapd/cgroup
echo 'self-managed=true' | sudo tee "${_LXD_SNAP_DEVCGROUP_CONFIG}"
- uses: snapcore/action-build@v1
with:
path: dist
build-windows: build-windows:
runs-on: windows-2022 runs-on: windows-2022
# this will not stop other jobs from running # this will not stop other jobs from running
@ -344,6 +507,52 @@ jobs:
shell: pwsh shell: pwsh
run: Get-Content -Path ".\build.log" run: Get-Content -Path ".\build.log"
build-windows-cross:
strategy:
fail-fast: false
matrix:
os: ["namespace-profile-ghostty-md"]
target: [
x86-windows-gnu,
x86_64-windows-gnu,
# We don't support cross-compiling to macOS or Linux because
# we require system libraries.
#aarch64-linux,
#x86_64-linux,
#aarch64-macos,
#x86_64-macos,
]
runs-on: ${{ matrix.os }}
needs: test
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
# Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
# Cross-compile the binary. We always use static building for this
# because its the only way to access the headers.
- name: Test Build
run: nix develop -c zig build -Dapp-runtime=glfw -Dtarget=${{ matrix.target }}
test: test:
if: github.repository == 'ghostty-org/ghostty' if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-md runs-on: namespace-profile-ghostty-md
@ -355,17 +564,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -374,7 +583,7 @@ jobs:
run: nix develop -c zig build -Dapp-runtime=none test run: nix develop -c zig build -Dapp-runtime=none test
- name: Test GTK Build - name: Test GTK Build
run: nix develop -c zig build -Dapp-runtime=gtk -Dgtk-adwaita=true -Demit-docs run: nix develop -c zig build -Dapp-runtime=gtk -Demit-docs
- name: Test GLFW Build - name: Test GLFW Build
run: nix develop -c zig build -Dapp-runtime=glfw run: nix develop -c zig build -Dapp-runtime=glfw
@ -387,10 +596,9 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
adwaita: ["true", "false"]
x11: ["true", "false"] x11: ["true", "false"]
wayland: ["true", "false"] wayland: ["true", "false"]
name: GTK adwaita=${{ matrix.adwaita }} x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }} name: GTK x11=${{ matrix.x11 }} wayland=${{ matrix.wayland }}
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-sm
needs: test needs: test
env: env:
@ -401,17 +609,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -421,7 +629,6 @@ jobs:
nix develop -c \ nix develop -c \
zig build \ zig build \
-Dapp-runtime=gtk \ -Dapp-runtime=gtk \
-Dgtk-adwaita=${{ matrix.adwaita }} \
-Dgtk-x11=${{ matrix.x11 }} \ -Dgtk-x11=${{ matrix.x11 }} \
-Dgtk-wayland=${{ matrix.wayland }} -Dgtk-wayland=${{ matrix.wayland }}
@ -441,17 +648,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -461,23 +668,23 @@ jobs:
nix develop -c zig build -Dsentry=${{ matrix.sentry }} nix develop -c zig build -Dsentry=${{ matrix.sentry }}
test-macos: test-macos:
runs-on: namespace-profile-ghostty-macos runs-on: namespace-profile-ghostty-macos-sequoia
needs: test needs: test
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@v4
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: XCode Select - name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_16.0.app run: sudo xcode-select -s /Applications/Xcode_26.0.app
- name: get the Zig deps - name: get the Zig deps
id: deps id: deps
@ -486,9 +693,9 @@ jobs:
- name: test - name: test
run: nix develop -c zig build test --system ${{ steps.deps.outputs.deps }} run: nix develop -c zig build test --system ${{ steps.deps.outputs.deps }}
prettier: zig-fmt:
if: github.repository == 'ghostty-org/ghostty' if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-xsm
timeout-minutes: 60 timeout-minutes: 60
env: env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache ZIG_LOCAL_CACHE_DIR: /zig/local-cache
@ -496,15 +703,42 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it - uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: true
useDaemon: false # sometimes fails on short jobs
- name: zig fmt
run: nix develop -c zig fmt --check .
prettier:
if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-xsm
timeout-minutes: 60
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -515,7 +749,7 @@ jobs:
alejandra: alejandra:
if: github.repository == 'ghostty-org/ghostty' if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-xsm
timeout-minutes: 60 timeout-minutes: 60
env: env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache ZIG_LOCAL_CACHE_DIR: /zig/local-cache
@ -523,15 +757,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it - uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -542,7 +776,7 @@ jobs:
typos: typos:
if: github.repository == 'ghostty-org/ghostty' if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-sm runs-on: namespace-profile-ghostty-xsm
timeout-minutes: 60 timeout-minutes: 60
env: env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache ZIG_LOCAL_CACHE_DIR: /zig/local-cache
@ -550,15 +784,15 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it - uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -567,6 +801,62 @@ jobs:
- name: typos check - name: typos check
run: nix develop -c typos run: nix develop -c typos
translations:
if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-xsm
timeout-minutes: 60
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: true
useDaemon: false # sometimes fails on short jobs
- name: check translations
run: nix develop -c .github/scripts/check-translations.sh
blueprint-compiler:
if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-xsm
timeout-minutes: 60
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- uses: actions/checkout@v4 # Check out repo so we can lint it
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
skipPush: true
useDaemon: false # sometimes fails on short jobs
- name: check blueprints
run: nix develop -c ./nix/build-support/check-blueprints.sh
- name: check unchanged
run: git diff --exit-code
test-pkg-linux: test-pkg-linux:
strategy: strategy:
fail-fast: false fail-fast: false
@ -583,17 +873,17 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
# Install Nix and use that to run our tests so our environment matches exactly. # Install Nix and use that to run our tests so our environment matches exactly.
- uses: cachix/install-nix-action@v30 - uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -601,3 +891,85 @@ jobs:
- name: Test ${{ matrix.pkg }} Build - name: Test ${{ matrix.pkg }} Build
run: | run: |
nix develop -c sh -c "cd pkg/${{ matrix.pkg }} ; zig build test" nix develop -c sh -c "cd pkg/${{ matrix.pkg }} ; zig build test"
test-debian-12:
name: Test build on Debian 12
runs-on: namespace-profile-ghostty-sm
needs: [test, build-dist]
steps:
- name: Install and configure Namespace CLI
uses: namespacelabs/nscloud-setup@v0
- name: Configure Namespace powered Buildx
uses: namespacelabs/nscloud-setup-buildx-action@v0
- name: Download Source Tarball Artifacts
uses: actions/download-artifact@v4
with:
name: source-tarball
- name: Extract tarball
run: |
mkdir dist
tar --verbose --extract --strip-components 1 --directory dist --file ghostty-source.tar.gz
- name: Build and push
uses: docker/build-push-action@v6
with:
context: dist
file: dist/src/build/docker/debian/Dockerfile
build-args: |
DISTRO_VERSION=12
flatpak-check-zig-cache:
if: github.repository == 'ghostty-org/ghostty'
runs-on: namespace-profile-ghostty-xsm
env:
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.8
with:
path: |
/nix
/zig
- name: Setup Nix
uses: cachix/install-nix-action@v31
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v16
with:
name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
useDaemon: false # sometimes fails on short jobs
- name: Check Flatpak Zig Dependencies
run: nix develop -c ./flatpak/build-support/check-zig-cache.sh
flatpak:
if: github.repository == 'ghostty-org/ghostty'
name: "Flatpak"
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47
options: --privileged
strategy:
fail-fast: false
matrix:
variant:
- arch: x86_64
runner: namespace-profile-ghostty-md
- arch: aarch64
runner: namespace-profile-ghostty-md-arm64
runs-on: ${{ matrix.variant.runner }}
needs: [flatpak-check-zig-cache, test]
steps:
- uses: actions/checkout@v4
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: com.mitchellh.ghostty
manifest-path: flatpak/com.mitchellh.ghostty.yml
cache-key: flatpak-builder-${{ github.sha }}
arch: ${{ matrix.variant.arch }}
verbose: true

View File

@ -22,17 +22,17 @@ jobs:
fetch-depth: 0 fetch-depth: 0
- name: Setup Cache - name: Setup Cache
uses: namespacelabs/nscloud-cache-action@v1.2.0 uses: namespacelabs/nscloud-cache-action@v1.2.8
with: with:
path: | path: |
/nix /nix
/zig /zig
- name: Setup Nix - name: Setup Nix
uses: cachix/install-nix-action@v30 uses: cachix/install-nix-action@v31
with: with:
nix_path: nixpkgs=channel:nixos-unstable nix_path: nixpkgs=channel:nixos-unstable
- uses: cachix/cachix-action@v15 - uses: cachix/cachix-action@v16
with: with:
name: ghostty name: ghostty
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
@ -50,6 +50,8 @@ jobs:
if ! git diff --exit-code build.zig.zon; then if ! git diff --exit-code build.zig.zon; then
nix develop -c ./nix/build-support/check-zig-cache.sh --update nix develop -c ./nix/build-support/check-zig-cache.sh --update
nix develop -c ./nix/build-support/check-zig-cache.sh nix develop -c ./nix/build-support/check-zig-cache.sh
nix develop -c ./flatpak/build-support/check-zig-cache.sh --update
nix develop -c ./flatpak/build-support/check-zig-cache.sh
fi fi
# Verify the build still works. We choose an arbitrary build type # Verify the build still works. We choose an arbitrary build type
@ -67,6 +69,9 @@ jobs:
add-paths: | add-paths: |
build.zig.zon build.zig.zon
build.zig.zon.nix build.zig.zon.nix
build.zig.zon.txt
build.zig.zon.json
flatpak/zig-packages.json
body: | body: |
Upstream revision: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/${{ steps.zig_fetch.outputs.upstream_rev }} Upstream revision: https://github.com/mbadolato/iTerm2-Color-Schemes/tree/${{ steps.zig_fetch.outputs.upstream_rev }}
labels: dependencies labels: dependencies

4
.gitignore vendored
View File

@ -5,6 +5,7 @@
.DS_Store .DS_Store
.vscode/ .vscode/
.direnv/ .direnv/
.envrc.local
.flatpak-builder/ .flatpak-builder/
zig-cache/ zig-cache/
.zig-cache/ .zig-cache/
@ -13,9 +14,10 @@ zig-out/
example/*.wasm example/*.wasm
test/ghostty test/ghostty
test/cases/**/*.actual.png test/cases/**/*.actual.png
flatpak/builddir/
flatpak/repo/
glad.zip glad.zip
/Box_test.ppm /Box_test.ppm
/Box_test_diff.ppm /Box_test_diff.ppm
/ghostty.qcow2 /ghostty.qcow2
/build.zig.zon2json-lock

View File

@ -11,6 +11,9 @@ zig-out/
# macos is managed by XCode GUI # macos is managed by XCode GUI
macos/ macos/
# produced by Icon Composer on macOS
images/Ghostty.icon/icon.json
# website dev run # website dev run
website/.next website/.next

View File

@ -78,9 +78,19 @@
# the GTK apprt. Also includes X11/Wayland integrations and general # the GTK apprt. Also includes X11/Wayland integrations and general
# Linux support. # Linux support.
# #
# - @ghostty-org/localization/* - Anything related to localization
# for a specific locale.
#
# - @ghosty-org/localization/manager - Manage all localization tasks
# and tooling. They are not responsible for any specific locale but
# are responsible for the overall localization process and tooling.
#
# - @ghostty-org/macos - The Ghostty macOS app and any macOS-specific # - @ghostty-org/macos - The Ghostty macOS app and any macOS-specific
# features, configurations, etc. # features, configurations, etc.
# #
# - @ghostty-org/packaging/snap - Ghostty snap packaging
# (https://snapcraft.io/ghostty)
#
# - @ghostty-org/renderer - Ghostty rendering subsystem, including the # - @ghostty-org/renderer - Ghostty rendering subsystem, including the
# rendering abstractions as well as specific renderers like OpenGL # rendering abstractions as well as specific renderers like OpenGL
# and Metal. # and Metal.
@ -138,12 +148,38 @@
# Shell # Shell
/src/shell-integration/ @ghostty-org/shell /src/shell-integration/ @ghostty-org/shell
/src/termio/shell-integration.zig @ghostty-org/shell /src/termio/shell_integration.zig @ghostty-org/shell
# Terminal # Terminal
/src/simd/ @ghostty-org/terminal /src/simd/ @ghostty-org/terminal
/src/input/KeyEncoder.zig @ghostty-org/terminal
/src/terminal/ @ghostty-org/terminal /src/terminal/ @ghostty-org/terminal
/src/terminfo/ @ghostty-org/terminal /src/terminfo/ @ghostty-org/terminal
/src/unicode/ @ghostty-org/terminal /src/unicode/ @ghostty-org/terminal
/src/Surface.zig @ghostty-org/terminal /src/Surface.zig @ghostty-org/terminal
/src/surface_mouse.zig @ghostty-org/terminal /src/surface_mouse.zig @ghostty-org/terminal
# Localization
/po/README_TRANSLATORS.md @ghostty-org/localization
/po/com.mitchellh.ghostty.pot @ghostty-org/localization
/po/ca_ES.UTF-8.po @ghostty-org/ca_ES
/po/de_DE.UTF-8.po @ghostty-org/de_DE
/po/es_BO.UTF-8.po @ghostty-org/es_BO
/po/es_AR.UTF-8.po @ghostty-org/es_AR
/po/fr_FR.UTF-8.po @ghostty-org/fr_FR
/po/id_ID.UTF-8.po @ghostty-org/id_ID
/po/ja_JP.UTF-8.po @ghostty-org/ja_JP
/po/mk_MK.UTF-8.po @ghostty-org/mk_MK
/po/nb_NO.UTF-8.po @ghostty-org/nb_NO
/po/nl_NL.UTF-8.po @ghostty-org/nl_NL
/po/pl_PL.UTF-8.po @ghostty-org/pl_PL
/po/pt_BR.UTF-8.po @ghostty-org/pt_BR
/po/ru_RU.UTF-8.po @ghostty-org/ru_RU
/po/tr_TR.UTF-8.po @ghostty-org/tr_TR
/po/uk_UA.UTF-8.po @ghostty-org/uk_UA
/po/zh_CN.UTF-8.po @ghostty-org/zh_CN
/po/ga_IE.UTF-8.po @ghostty-org/ga_IE
/po/ko_KR.UTF-8.po @ghostty-org/ko_KR
# Packaging - Snap
/snap/ @ghostty-org/snap

View File

@ -21,6 +21,15 @@ All issues are actionable. Pick one and start working on it. Thank you.
If you need help or guidance, comment on the issue. Issues that are extra If you need help or guidance, comment on the issue. Issues that are extra
friendly to new contributors are tagged with "contributor friendly". friendly to new contributors are tagged with "contributor friendly".
**I'd like to translate Ghostty to my language!**
We have written a [Translator's Guide](po/README_TRANSLATORS.md) for
everyone interested in contributing translations to Ghostty.
Translations usually do not need to go through the process of issue triage
and you can submit pull requests directly, although please make sure that
our [Style Guide](po/README_TRANSLATORS.md#style-guide) is followed before
submission.
**I have a bug!** **I have a bug!**
1. Search the issue tracker and discussions for similar issues. 1. Search the issue tracker and discussions for similar issues.
@ -86,6 +95,10 @@ pull request will be accepted with a high degree of certainty.
> working on Ghostty.** If you're a user reporting an issue, you can > working on Ghostty.** If you're a user reporting an issue, you can
> ignore the rest of this document. > ignore the rest of this document.
## Including and Updating Translations
See the [Contributor's Guide](po/README_CONTRIBUTORS.md) for more details.
## Input Stack Testing ## Input Stack Testing
The input stack is the part of the codebase that starts with a The input stack is the part of the codebase that starts with a

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2024 Mitchell Hashimoto Copyright (c) 2024 Mitchell Hashimoto, Ghostty contributors
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -4,13 +4,12 @@ Ghostty relies on downstream package maintainers to distribute Ghostty to
end-users. This document provides guidance to package maintainers on how to end-users. This document provides guidance to package maintainers on how to
package Ghostty for distribution. package Ghostty for distribution.
> [!NOTE] > [!IMPORTANT]
> >
> While Ghostty went through an extensive private beta testing period, > This document is only accurate for the Ghostty source alongside it.
> packaging Ghostty is immature and may require additional build script > **Do not use this document for older or newer versions of Ghostty!** If
> tweaks and documentation improvement. I'm extremely motivated to work with > you are reading this document in a different version of Ghostty, please
> package maintainers to improve the packaging process. Please open issues > find the `PACKAGING.md` file alongside that version.
> to discuss any packaging issues you encounter.
## Source Tarballs ## Source Tarballs
@ -23,13 +22,6 @@ https://release.files.ghostty.org/VERSION/ghostty-VERSION.tar.gz
https://release.files.ghostty.org/VERSION/ghostty-VERSION.tar.gz.minisig https://release.files.ghostty.org/VERSION/ghostty-VERSION.tar.gz.minisig
``` ```
> [!NOTE]
>
> **Version 1.0.0 the filename is `ghostty-source.tar.gz`.** Future
> versions will use the `ghostty-VERSION.tar.gz` format since it is more
> typical for source tarballs. But for version 1.0.0, the filename is
> `ghostty-source.tar.gz`.
Signature files are signed with Signature files are signed with
[minisign](https://jedisct1.github.io/minisign/) [minisign](https://jedisct1.github.io/minisign/)
using the following public key: using the following public key:
@ -44,6 +36,19 @@ Use the `ghostty-source.tar.gz` asset and _not the GitHub auto-generated
source tarball_. These tarballs are generated for every commit to source tarball_. These tarballs are generated for every commit to
the `main` branch and are not associated with a specific version. the `main` branch and are not associated with a specific version.
> [!WARNING]
>
> Source tarballs are _not the same_ as a Git checkout. Source tarballs
> contain some preprocessed files that allow building Ghostty with less
> dependencies. If you are building Ghostty from a Git checkout, the
> steps below are the same but they may require additional dependencies
> not listed here. See the `README.md` for more information on building
> from a Git checkout.
>
> For everyone except Ghostty developers, please use the source tarballs.
> We generate tip source tarballs for users following the development
> branch.
## Zig Version ## Zig Version
[Zig](https://ziglang.org) is required to build Ghostty. Prior to Zig 1.0, [Zig](https://ziglang.org) is required to build Ghostty. Prior to Zig 1.0,
@ -55,7 +60,7 @@ To find the version of Zig required to build Ghostty, check the `required_zig`
constant in `build.zig`. You don't need to know Zig to extract this information. constant in `build.zig`. You don't need to know Zig to extract this information.
This version will always be an official released version of Zig. This version will always be an official released version of Zig.
For example, at the time of writing this document, Ghostty requires Zig 0.13.0. For example, at the time of writing this document, Ghostty requires Zig 0.14.0.
## Building Ghostty ## Building Ghostty

View File

@ -188,8 +188,11 @@ SENTRY_DSN=https://e914ee84fd895c4fe324afa3e53dac76@o4507352570920960.ingest.us.
## Developing Ghostty ## Developing Ghostty
See the documentation on the Ghostty website for See the documentation on the Ghostty website for
[building Ghostty from source](http://ghostty.org/docs/install/build). [building Ghostty from a source tarball](http://ghostty.org/docs/install/build).
For development, omit the `-Doptimize` flag to build a debug build. Building Ghostty from a Git checkout is very similar, except you want to
omit the `-Doptimize` flag to build a debug build, and you may require
additional dependencies since the source tarball includes some processed
files that are not in the Git repository.
On Linux or macOS, you can use `zig build -Dapp-runtime=glfw run` for a quick On Linux or macOS, you can use `zig build -Dapp-runtime=glfw run` for a quick
GLFW-based app for a faster development cycle while developing core GLFW-based app for a faster development cycle while developing core
@ -206,6 +209,43 @@ Other useful commands:
in the current running terminal emulator so if you want to check the in the current running terminal emulator so if you want to check the
behavior of this project, you must run this command in Ghostty. behavior of this project, you must run this command in Ghostty.
### Extra Dependencies
Building Ghostty from a Git checkout on Linux requires some additional
dependencies:
- `blueprint-compiler`
macOS users don't require any additional dependencies.
> [!NOTE]
> This only applies to building from a _Git checkout_. This section does
> not apply if you're building from a released _source tarball_. For
> source tarballs, see the
> [website](http://ghostty.org/docs/install/build).
### Xcode Version and SDKs
Building the Ghostty macOS app requires that Xcode, the macOS SDK,
and the iOS SDK are all installed.
A common issue is that the incorrect version of Xcode is either
installed or selected. Use the `xcode-select` command to
ensure that the correct version of Xcode is selected:
```shell-session
sudo xcode-select --switch /Applications/Xcode-beta.app
```
> [!IMPORTANT]
>
> Main branch development of Ghostty is preparing for the next major
> macOS release, Tahoe (macOS 26). Therefore, the main branch requires
> **Xcode 26 and the macOS 26 SDK**.
>
> You do not need to be running on macOS 26 to build Ghostty, you can
> still use Xcode 26 beta on macOS 15 stable.
### Linting ### Linting
#### Prettier #### Prettier
@ -233,7 +273,7 @@ nix develop -c prettier --write .
Nix modules are formatted with [Alejandra](https://github.com/kamadorueda/alejandra/). An Alejandra CI check Nix modules are formatted with [Alejandra](https://github.com/kamadorueda/alejandra/). An Alejandra CI check
will fail builds with improper formatting. will fail builds with improper formatting.
Nix users can use the following command to format with Alejanda: Nix users can use the following command to format with Alejandra:
``` ```
nix develop -c alejandra . nix develop -c alejandra .

21
TODO.md
View File

@ -1,21 +0,0 @@
Performance:
- Loading fonts on startups should probably happen in multiple threads
Correctness:
- test wrap against wraptest: https://github.com/mattiase/wraptest
- automate this in some way
- Charsets: UTF-8 vs. ASCII mode
- we only support UTF-8 input right now
- need fallback glyphs if they're not supported
- can effect a crash using `vttest` menu `3 10` since it tries to parse
ASCII as UTF-8.
Mac:
- Preferences window
Major Features:
- Bell

View File

@ -3,7 +3,7 @@ const builtin = @import("builtin");
const buildpkg = @import("src/build/main.zig"); const buildpkg = @import("src/build/main.zig");
comptime { comptime {
buildpkg.requireZig("0.13.0"); buildpkg.requireZig("0.14.0");
} }
pub fn build(b: *std.Build) !void { pub fn build(b: *std.Build) !void {
@ -11,34 +11,42 @@ pub fn build(b: *std.Build) !void {
// Ghostty resources like terminfo, shell integration, themes, etc. // Ghostty resources like terminfo, shell integration, themes, etc.
const resources = try buildpkg.GhosttyResources.init(b, &config); const resources = try buildpkg.GhosttyResources.init(b, &config);
const i18n = try buildpkg.GhosttyI18n.init(b, &config);
// Ghostty dependencies used by many artifacts. // Ghostty dependencies used by many artifacts.
const deps = try buildpkg.SharedDeps.init(b, &config); const deps = try buildpkg.SharedDeps.init(b, &config);
const exe = try buildpkg.GhosttyExe.init(b, &config, &deps);
if (config.emit_helpgen) deps.help_strings.install(); if (config.emit_helpgen) deps.help_strings.install();
// Ghostty executable, the actual runnable Ghostty program.
const exe = try buildpkg.GhosttyExe.init(b, &config, &deps);
// Ghostty docs // Ghostty docs
if (config.emit_docs) { const docs = try buildpkg.GhosttyDocs.init(b, &deps);
const docs = try buildpkg.GhosttyDocs.init(b, &deps); if (config.emit_docs) docs.install();
docs.install();
}
// Ghostty webdata // Ghostty webdata
if (config.emit_webdata) { const webdata = try buildpkg.GhosttyWebdata.init(b, &deps);
const webdata = try buildpkg.GhosttyWebdata.init(b, &deps); if (config.emit_webdata) webdata.install();
webdata.install();
}
// Ghostty bench tools // Ghostty bench tools
if (config.emit_bench) { const bench = try buildpkg.GhosttyBench.init(b, &deps);
const bench = try buildpkg.GhosttyBench.init(b, &deps); if (config.emit_bench) bench.install();
bench.install();
// Ghostty dist tarball
const dist = try buildpkg.GhosttyDist.init(b, &config);
{
const step = b.step("dist", "Build the dist tarball");
step.dependOn(dist.install_step);
const check_step = b.step("distcheck", "Install and validate the dist tarball");
check_step.dependOn(dist.check_step);
check_step.dependOn(dist.install_step);
} }
// If we're not building libghostty, then install the exe and resources. // If we're not building libghostty, then install the exe and resources.
if (config.app_runtime != .none) { if (config.app_runtime != .none) {
exe.install(); exe.install();
resources.install(); resources.install();
i18n.install();
} }
// Libghostty // Libghostty
@ -48,7 +56,7 @@ pub fn build(b: *std.Build) !void {
// As such, these build steps are lacking. For example, the Darwin // As such, these build steps are lacking. For example, the Darwin
// build only produces an xcframework. // build only produces an xcframework.
if (config.app_runtime == .none) { if (config.app_runtime == .none) {
if (config.target.result.isDarwin()) darwin: { if (config.target.result.os.tag.isDarwin()) darwin: {
if (!config.emit_xcframework) break :darwin; if (!config.emit_xcframework) break :darwin;
// Build the xcframework // Build the xcframework
@ -58,6 +66,7 @@ pub fn build(b: *std.Build) !void {
// The xcframework build always installs resources because our // The xcframework build always installs resources because our
// macOS xcode project contains references to them. // macOS xcode project contains references to them.
resources.install(); resources.install();
i18n.install();
// If we aren't emitting docs we need to emit a placeholder so // If we aren't emitting docs we need to emit a placeholder so
// our macOS xcodeproject builds. // our macOS xcodeproject builds.
@ -80,6 +89,16 @@ pub fn build(b: *std.Build) !void {
{ {
const run_cmd = b.addRunArtifact(exe.exe); const run_cmd = b.addRunArtifact(exe.exe);
if (b.args) |args| run_cmd.addArgs(args); if (b.args) |args| run_cmd.addArgs(args);
// Set the proper resources dir so things like shell integration
// work correctly. If we're running `zig build run` in Ghostty,
// this also ensures it overwrites the release one with our debug
// build.
run_cmd.setEnvironmentVariable(
"GHOSTTY_RESOURCES_DIR",
b.getInstallPath(.prefix, "share/ghostty"),
);
const run_step = b.step("run", "Run the app"); const run_step = b.step("run", "Run the app");
run_step.dependOn(&run_cmd.step); run_step.dependOn(&run_cmd.step);
} }
@ -91,9 +110,15 @@ pub fn build(b: *std.Build) !void {
const test_exe = b.addTest(.{ const test_exe = b.addTest(.{
.name = "ghostty-test", .name = "ghostty-test",
.root_source_file = b.path("src/main.zig"), .filters = if (test_filter) |v| &.{v} else &.{},
.target = config.target, .root_module = b.createModule(.{
.filter = test_filter, .root_source_file = b.path("src/main.zig"),
.target = config.target,
.optimize = .Debug,
.strip = false,
.omit_frame_pointer = false,
.unwind_tables = .sync,
}),
}); });
{ {
@ -103,4 +128,11 @@ pub fn build(b: *std.Build) !void {
test_step.dependOn(&test_run.step); test_step.dependOn(&test_run.step);
} }
} }
// update-translations does what it sounds like and updates the "pot"
// files. These should be committed to the repo.
{
const step = b.step("update-translations", "Update translation files");
step.dependOn(i18n.update_step);
}
} }

View File

@ -1,90 +1,111 @@
.{ .{
.name = "ghostty", .name = .ghostty,
.version = "1.1.2", .version = "1.1.4",
.paths = .{""}, .paths = .{""},
.fingerprint = 0x64407a2a0b4147e5,
.dependencies = .{ .dependencies = .{
// Zig libs // Zig libs
.libxev = .{ .libxev = .{
.url = "https://github.com/mitchellh/libxev/archive/31eed4e337fed7b0149319e5cdbb62b848c24fbd.tar.gz", // mitchellh/libxev
.hash = "1220ebf88622c4d502dc59e71347e4d28c47e033f11b59aff774ae5787565c40999c", .url = "https://github.com/mitchellh/libxev/archive/75a10d0fb374e8eb84948dcfc68d865e755e59c2.tar.gz",
}, .hash = "libxev-0.0.0-86vtcyMBEwA-UpcjfOICyI2GYG8o6MiRbinS1_8g1_rw",
.mach_glfw = .{
.url = "https://github.com/mitchellh/mach-glfw/archive/37c2995f31abcf7e8378fba68ddcf4a3faa02de0.tar.gz",
.hash = "12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62",
.lazy = true, .lazy = true,
}, },
.vaxis = .{ .vaxis = .{
.url = "git+https://github.com/rockorager/libvaxis/?ref=main#6d729a2dc3b934818dffe06d2ba3ce02841ed74b", // rockorager/libvaxis
.hash = "12200df4ebeaed45de26cb2c9f3b6f3746d8013b604e035dae658f86f586c8c91d2f", .url = "git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23",
.hash = "vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn",
.lazy = true,
}, },
.z2d = .{ .z2d = .{
.url = "git+https://github.com/vancluever/z2d?ref=v0.4.0#4638bb02a9dc41cc2fb811f092811f6a951c752a", // vancluever/z2d
.hash = "12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a", .url = "https://github.com/vancluever/z2d/archive/8bbd035f4101f02b1d27947def0d7da3215df7fe.tar.gz",
.hash = "z2d-0.7.0-j5P_Hg_DDACq-2H2Zh7rAq6_TXWdQzv7JAUfnrdeDosg",
.lazy = true,
}, },
.zig_objc = .{ .zig_objc = .{
.url = "https://github.com/mitchellh/zig-objc/archive/9b8ba849b0f58fe207ecd6ab7c147af55b17556e.tar.gz", // mitchellh/zig-objc
.hash = "1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634", .url = "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz",
.hash = "zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt",
.lazy = true,
}, },
.zig_js = .{ .zig_js = .{
.url = "https://github.com/mitchellh/zig-js/archive/d0b8b0a57c52fbc89f9d9fecba75ca29da7dd7d1.tar.gz", // mitchellh/zig-js
.hash = "12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc", .url = "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz",
.hash = "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ",
.lazy = true,
}, },
.ziglyph = .{ .ziglyph = .{
.url = "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz", .url = "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz",
.hash = "12207831bce7d4abce57b5a98e8f3635811cfefd160bca022eb91fe905d36a02cf25", .hash = "ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf",
.lazy = true,
}, },
.zig_wayland = .{ .zig_wayland = .{
.url = "https://deps.files.ghostty.org/zig-wayland-fbfe3b4ac0b472a27b1f1a67405436c58cbee12d.tar.gz", // codeberg ifreund/zig-wayland
.hash = "12209ca054cb1919fa276e328967f10b253f7537c4136eb48f3332b0f7cf661cad38", .url = "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz",
.hash = "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy",
}, },
.zf = .{ .zf = .{
.url = "git+https://github.com/natecraddock/zf/?ref=main#ed99ca18b02dda052e20ba467e90b623c04690dd", // natecraddock/zf
.hash = "1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8", .url = "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz",
.hash = "zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9",
.lazy = true,
}, },
.gobject = .{ .gobject = .{
.url = "https://github.com/ianprime0509/zig-gobject/releases/download/v0.2.2/bindings-gnome47.tar.zst", // https://github.com/jcollie/ghostty-gobject based on zig_gobject
.hash = "12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d", // Temporary until we generate them at build time automatically.
.url = "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-18-21-1/ghostty-gobject-0.14.0-2025-03-18-21-1.tar.zst",
.hash = "gobject-0.2.0-Skun7IWDlQAOKu4BV7LapIxL9Imbq1JRmzvcIkazvAxR",
.lazy = true,
}, },
// C libs // C libs
.cimgui = .{ .path = "./pkg/cimgui" }, .cimgui = .{ .path = "./pkg/cimgui", .lazy = true },
.fontconfig = .{ .path = "./pkg/fontconfig" }, .fontconfig = .{ .path = "./pkg/fontconfig", .lazy = true },
.freetype = .{ .path = "./pkg/freetype" }, .freetype = .{ .path = "./pkg/freetype", .lazy = true },
.harfbuzz = .{ .path = "./pkg/harfbuzz" }, .glfw = .{ .path = "./pkg/glfw", .lazy = true },
.highway = .{ .path = "./pkg/highway" }, .gtk4_layer_shell = .{ .path = "./pkg/gtk4-layer-shell", .lazy = true },
.libpng = .{ .path = "./pkg/libpng" }, .harfbuzz = .{ .path = "./pkg/harfbuzz", .lazy = true },
.macos = .{ .path = "./pkg/macos" }, .highway = .{ .path = "./pkg/highway", .lazy = true },
.oniguruma = .{ .path = "./pkg/oniguruma" }, .libintl = .{ .path = "./pkg/libintl", .lazy = true },
.opengl = .{ .path = "./pkg/opengl" }, .libpng = .{ .path = "./pkg/libpng", .lazy = true },
.sentry = .{ .path = "./pkg/sentry" }, .macos = .{ .path = "./pkg/macos", .lazy = true },
.simdutf = .{ .path = "./pkg/simdutf" }, .oniguruma = .{ .path = "./pkg/oniguruma", .lazy = true },
.utfcpp = .{ .path = "./pkg/utfcpp" }, .opengl = .{ .path = "./pkg/opengl", .lazy = true },
.wuffs = .{ .path = "./pkg/wuffs" }, .sentry = .{ .path = "./pkg/sentry", .lazy = true },
.zlib = .{ .path = "./pkg/zlib" }, .simdutf = .{ .path = "./pkg/simdutf", .lazy = true },
.utfcpp = .{ .path = "./pkg/utfcpp", .lazy = true },
.wuffs = .{ .path = "./pkg/wuffs", .lazy = true },
.zlib = .{ .path = "./pkg/zlib", .lazy = true },
// Shader translation // Shader translation
.glslang = .{ .path = "./pkg/glslang" }, .glslang = .{ .path = "./pkg/glslang", .lazy = true },
.spirv_cross = .{ .path = "./pkg/spirv-cross" }, .spirv_cross = .{ .path = "./pkg/spirv-cross", .lazy = true },
// Wayland // Wayland
.wayland = .{ .wayland = .{
.url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz", .url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz",
.hash = "12202cdac858abc52413a6c6711d5026d2d3c8e13f95ca2c327eade0736298bb021f", .hash = "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t",
.lazy = true,
}, },
.wayland_protocols = .{ .wayland_protocols = .{
.url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz", .url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz",
.hash = "12201a57c6ce0001aa034fa80fba3e1cd2253c560a45748f4f4dd21ff23b491cddef", .hash = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S",
.lazy = true,
}, },
.plasma_wayland_protocols = .{ .plasma_wayland_protocols = .{
.url = "git+https://github.com/KDE/plasma-wayland-protocols?ref=main#db525e8f9da548cffa2ac77618dd0fbe7f511b86", .url = "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz",
.hash = "12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566", .hash = "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs",
.lazy = true,
}, },
// Other // Other
.apple_sdk = .{ .path = "./pkg/apple-sdk" }, .apple_sdk = .{ .path = "./pkg/apple-sdk" },
.iterm2_themes = .{ .iterm2_themes = .{
.url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/db227d159adc265818f2e898da0f70ef8d7b580e.tar.gz", .url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/6fa671fdc1daf1fcfa025cb960ffa3e7373a2ed8.tar.gz",
.hash = "12203d2647e5daf36a9c85b969e03f422540786ce9ea624eb4c26d204fe1f46218f3", .hash = "N-V-__8AAGHcWgTaKLjwmFkxToNT4jgz5VXUHR7hz8TQ2_AS",
.lazy = true,
}, },
}, },
} }

172
build.zig.zon.json generated Normal file
View File

@ -0,0 +1,172 @@
{
"N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ": {
"name": "breakpad",
"url": "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz",
"hash": "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk="
},
"N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v": {
"name": "fontconfig",
"url": "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz",
"hash": "sha256-O6LdkhWHGKzsXKrxpxYEO1qgVcJ7CB2RSvPMtA3OilU="
},
"N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub": {
"name": "freetype",
"url": "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz",
"hash": "sha256-QnIB9dUVFnDQXB9bRb713aHy592XHvVPD+qqf/0quQw="
},
"N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-": {
"name": "gettext",
"url": "https://deps.files.ghostty.org/gettext-0.24.tar.gz",
"hash": "sha256-yRhQPVk9cNr0hE0XWhPYFq+stmfAb7oeydzVACwVGLc="
},
"N-V-__8AAMrJSwAUGb9-vTzkNR-5LXS81MR__ZRVfF3tWgG6": {
"name": "glfw",
"url": "https://github.com/glfw/glfw/archive/e7ea71be039836da3a98cea55ae5569cb5eb885c.tar.gz",
"hash": "sha256-M3N1XUAlMebBo5X1Py+9YxjKXgZ6eacqWRCbUmwLKQo="
},
"N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy": {
"name": "glslang",
"url": "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz",
"hash": "sha256-FKLtu1Ccs+UamlPj9eQ12/WXFgS0uDPmPmB26MCpl7U="
},
"gobject-0.2.0-Skun7IWDlQAOKu4BV7LapIxL9Imbq1JRmzvcIkazvAxR": {
"name": "gobject",
"url": "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-18-21-1/ghostty-gobject-0.14.0-2025-03-18-21-1.tar.zst",
"hash": "sha256-hWcpl0Wd3XydT+RY7+VIoxXPhCzele1Ip76YSh+KmLI="
},
"N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr": {
"name": "gtk4_layer_shell",
"url": "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz",
"hash": "sha256-mChCgSYKXu9bT2OlXxbEv2p4ihAgptsDfssPcfozaYg="
},
"N-V-__8AAG02ugUcWec-Ndp-i7JTsJ0dgF8nnJRUInkGLG7G": {
"name": "harfbuzz",
"url": "https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz",
"hash": "sha256-8WNRuv4hRyX+LB1bWfDZPkmQWkskeJn7kNcM/5U6K5s="
},
"N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE": {
"name": "highway",
"url": "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz",
"hash": "sha256-h9T4iT704I8iSXNgj/6/lCaKgTgLp5wS6IQZaMgKohI="
},
"N-V-__8AAH0GaQC8a52s6vfIxg88OZgFgEW6DFxfSK4lX_l3": {
"name": "imgui",
"url": "https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz",
"hash": "sha256-oF/QHgTPEat4Hig4fGIdLkIPHmBEyOJ6JeYD6pnveGA="
},
"N-V-__8AAGHcWgTaKLjwmFkxToNT4jgz5VXUHR7hz8TQ2_AS": {
"name": "iterm2_themes",
"url": "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/6fa671fdc1daf1fcfa025cb960ffa3e7373a2ed8.tar.gz",
"hash": "sha256-g9o2CIc/TfWYoUS/l/HP5KZECD7qNsdQUlFruaKkVz4="
},
"N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD": {
"name": "libpng",
"url": "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz",
"hash": "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo="
},
"libxev-0.0.0-86vtcyMBEwA-UpcjfOICyI2GYG8o6MiRbinS1_8g1_rw": {
"name": "libxev",
"url": "https://github.com/mitchellh/libxev/archive/75a10d0fb374e8eb84948dcfc68d865e755e59c2.tar.gz",
"hash": "sha256-/CSKSuZZfn0aIQlVZ0O8ch5O4gCajYBTTuoetRdo0n4="
},
"N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK": {
"name": "libxml2",
"url": "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz",
"hash": "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU="
},
"N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c": {
"name": "oniguruma",
"url": "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz",
"hash": "sha256-ABqhIC54RI9MC/GkjHblVodrNvFtks4yB+zP1h2Z8qA="
},
"N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc": {
"name": "pixels",
"url": "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz",
"hash": "sha256-Veg7FtCRCCUCvxSb9FfzH0IJLFmCZQ4/+657SIcb8Ro="
},
"N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs": {
"name": "plasma_wayland_protocols",
"url": "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz",
"hash": "sha256-XFi6IUrNjmvKNCbcCLAixGqN2Zeymhs+KLrfccIN9EE="
},
"N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG": {
"name": "sentry",
"url": "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz",
"hash": "sha256-KsZJfMjWGo0xCT5HrduMmyxFsWsHBbszSoNbZCPDGN8="
},
"N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv": {
"name": "spirv_cross",
"url": "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz",
"hash": "sha256-tStvz8Ref6abHwahNiwVVHNETizAmZVVaxVsU7pmV+M="
},
"N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH": {
"name": "utfcpp",
"url": "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz",
"hash": "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8="
},
"vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn": {
"name": "vaxis",
"url": "git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23",
"hash": "sha256-bNZ3oveT6vPChjimPJ/GGfcdivlAeJdl/xfWM+S/MHY="
},
"N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t": {
"name": "wayland",
"url": "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz",
"hash": "sha256-6kGR1o5DdnflHzqs3ieCmBAUTpMdOXoyfcYDXiw5xQ0="
},
"N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S": {
"name": "wayland_protocols",
"url": "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz",
"hash": "sha256-XO3K3egbdeYPI+XoO13SuOtO+5+Peb16NH0UiusFMPg="
},
"N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs": {
"name": "wuffs",
"url": "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
"hash": "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM="
},
"z2d-0.7.0-j5P_Hg_DDACq-2H2Zh7rAq6_TXWdQzv7JAUfnrdeDosg": {
"name": "z2d",
"url": "https://github.com/vancluever/z2d/archive/8bbd035f4101f02b1d27947def0d7da3215df7fe.tar.gz",
"hash": "sha256-wfadegeixcbgxRzRtf6M2H34CTuvDM22XVIhuufFBG4="
},
"zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9": {
"name": "zf",
"url": "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz",
"hash": "sha256-3nulNQd/4rZ4paeXJYXwAliNNyRNsIOX/q3z1JB8C7I="
},
"zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM": {
"name": "zg",
"url": "git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc",
"hash": "sha256-fo3l6cjkrr/godElTGnQzalBsasN7J73IDIRmw7v1gA="
},
"N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ": {
"name": "zig_js",
"url": "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz",
"hash": "sha256-fyNeCVbC9UAaKJY6JhAZlT0A479M/AKYMPIWEZbDWD0="
},
"zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt": {
"name": "zig_objc",
"url": "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz",
"hash": "sha256-zn1tR6xhSmDla4UJ3t+Gni4Ni3R8deSK3tEe7DGzNXw="
},
"wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy": {
"name": "zig_wayland",
"url": "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz",
"hash": "sha256-E77GZ15APYbbO1WzmuJi8eG9/iQFbc2CgkNBxjCLUhk="
},
"zigimg-0.1.0-lly-O6N2EABOxke8dqyzCwhtUCAafqP35zC7wsZ4Ddxj": {
"name": "zigimg",
"url": "git+https://github.com/TUSF/zigimg#31268548fe3276c0e95f318a6c0d2ab10565b58d",
"hash": "sha256-oblfr2FIzuqq0FLo/RrzCwUX1NJJuT53EwD3nP3KwN0="
},
"ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf": {
"name": "ziglyph",
"url": "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz",
"hash": "sha256-cse98+Ft8QUjX+P88yyYfaxJOJGQ9M7Ymw7jFxDz89k="
},
"N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o": {
"name": "zlib",
"url": "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz",
"hash": "sha256-F+iIY/NgBnKrSRgvIXKBtvxNPHYr3jYZNeQ2qVIU0Fw="
}
}

532
build.zig.zon.nix generated
View File

@ -1,22 +1,20 @@
# generated by zon2nix (https://github.com/Cloudef/zig2nix) # generated by zon2nix (https://github.com/jcollie/zon2nix)
{ {
lib, lib,
linkFarm, linkFarm,
fetchurl, fetchurl,
fetchgit, fetchgit,
runCommandLocal, runCommandLocal,
zig, zig_0_14,
name ? "zig-packages", name ? "zig-packages",
}: }: let
with builtins;
with lib; let
unpackZigArtifact = { unpackZigArtifact = {
name, name,
artifact, artifact,
}: }:
runCommandLocal name runCommandLocal name
{ {
nativeBuildInputs = [zig]; nativeBuildInputs = [zig_0_14];
} }
'' ''
hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})" hash="$(zig fetch --global-cache-dir "$TMPDIR" ${artifact})"
@ -38,12 +36,12 @@ with lib; let
url, url,
hash, hash,
}: let }: let
parts = splitString "#" url; parts = lib.splitString "#" url;
url_base = elemAt parts 0; url_base = builtins.elemAt parts 0;
url_without_query = elemAt (splitString "?" url_base) 0; url_without_query = builtins.elemAt (lib.splitString "?" url_base) 0;
rev_base = elemAt parts 1; rev_base = builtins.elemAt parts 1;
rev = rev =
if match "^[a-fA-F0-9]{40}$" rev_base != null if builtins.match "^[a-fA-F0-9]{40}$" rev_base != null
then rev_base then rev_base
else "refs/heads/${rev_base}"; else "refs/heads/${rev_base}";
in in
@ -58,9 +56,9 @@ with lib; let
url, url,
hash, hash,
}: let }: let
parts = splitString "://" url; parts = lib.splitString "://" url;
proto = elemAt parts 0; proto = builtins.elemAt parts 0;
path = elemAt parts 1; path = builtins.elemAt parts 1;
fetcher = { fetcher = {
"git+http" = fetchGitZig { "git+http" = fetchGitZig {
inherit name hash; inherit name hash;
@ -84,215 +82,15 @@ with lib; let
in in
linkFarm name [ linkFarm name [
{ {
name = "1220ebf88622c4d502dc59e71347e4d28c47e033f11b59aff774ae5787565c40999c"; name = "N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "libxev"; name = "breakpad";
url = "https://github.com/mitchellh/libxev/archive/31eed4e337fed7b0149319e5cdbb62b848c24fbd.tar.gz"; url = "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz";
hash = "sha256-VHP90NTytIZ8UZsYRKOOxN490/I6yv6ec40sP8y5MJ8="; hash = "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk=";
}; };
} }
{ {
name = "12206ed982e709e565d536ce930701a8c07edfd2cfdce428683f3f2a601d37696a62"; name = "N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v";
path = fetchZigArtifact {
name = "mach_glfw";
url = "https://github.com/mitchellh/mach-glfw/archive/37c2995f31abcf7e8378fba68ddcf4a3faa02de0.tar.gz";
hash = "sha256-HhXIvWUS8/CHWY4VXPG2ZEo+we8XOn3o5rYJCQ1n8Nk=";
};
}
{
name = "1220736fa4ba211162c7a0e46cc8fe04d95921927688bff64ab5da7420d098a7272d";
path = fetchZigArtifact {
name = "glfw";
url = "https://github.com/mitchellh/glfw/archive/b552c6ec47326b94015feddb36058ea567b87159.tar.gz";
hash = "sha256-IeBVAOQmtyFqVxzuXPek1onuPwIamcOyYtxqKpPEQjU=";
};
}
{
name = "12202adbfecdad671d585c9a5bfcbd5cdf821726779430047742ce1bf94ad67d19cb";
path = fetchZigArtifact {
name = "xcode_frameworks";
url = "https://github.com/mitchellh/xcode-frameworks/archive/69801c154c39d7ae6129ea1ba8fe1afe00585fc8.tar.gz";
hash = "sha256-mP/I2coL57UJm/3+4Q8sPAgQwk8V4zM+S4VBBTrX2To=";
};
}
{
name = "122004bfd4c519dadfb8e6281a42fc34fd1aa15aea654ea8a492839046f9894fa2cf";
path = fetchZigArtifact {
name = "vulkan_headers";
url = "https://github.com/mitchellh/vulkan-headers/archive/04c8a0389d5a0236a96312988017cd4ce27d8041.tar.gz";
hash = "sha256-K+zrRudgHFukOM6En1StRYRMNYkeRk+qHTXvrXaG+FU=";
};
}
{
name = "1220b3164434d2ec9db146a40bf3a30f490590d68fa8529776a3138074f0da2c11ca";
path = fetchZigArtifact {
name = "wayland_headers";
url = "https://github.com/mitchellh/wayland-headers/archive/5f991515a29f994d87b908115a2ab0b899474bd1.tar.gz";
hash = "sha256-uFilLZinKkZt6RdVTV3lUmJpzpswDdFva22FvwU/XQI=";
};
}
{
name = "122089c326186c84aa2fd034b16abc38f3ebf4862d9ae106dc1847ac44f557b36465";
path = fetchZigArtifact {
name = "x11_headers";
url = "https://github.com/mitchellh/x11-headers/archive/2ffbd62d82ff73ec929dd8de802bc95effa0ef88.tar.gz";
hash = "sha256-EhV2bmTY/OMYN1wEul35gD0hQgS/Al262jO3pVr0O+c=";
};
}
{
name = "12200df4ebeaed45de26cb2c9f3b6f3746d8013b604e035dae658f86f586c8c91d2f";
path = fetchZigArtifact {
name = "vaxis";
url = "git+https://github.com/rockorager/libvaxis/?ref=main#6d729a2dc3b934818dffe06d2ba3ce02841ed74b";
hash = "sha256-fFf79fCy4QQFVNcN722tSMjB6FyVEzCB36oH1olk9JQ=";
};
}
{
name = "1220dd654ef941fc76fd96f9ec6adadf83f69b9887a0d3f4ee5ac0a1a3e11be35cf5";
path = fetchZigArtifact {
name = "zigimg";
url = "git+https://github.com/zigimg/zigimg#3a667bdb3d7f0955a5a51c8468eac83210c1439e";
hash = "sha256-oLf3YH3yeg4ikVO/GahMCDRMTU31AHkfSnF4rt7xTKo=";
};
}
{
name = "122055beff332830a391e9895c044d33b15ea21063779557024b46169fb1984c6e40";
path = fetchZigArtifact {
name = "zg";
url = "https://codeberg.org/atman/zg/archive/v0.13.2.tar.gz";
hash = "sha256-2x9hT7bYq9KJYWLVOf21a+QvTG/F7HWT+YK15IMRzNY=";
};
}
{
name = "12201f0d542e7541cf492a001d4d0d0155c92f58212fbcb0d224e95edeba06b5416a";
path = fetchZigArtifact {
name = "z2d";
url = "git+https://github.com/vancluever/z2d?ref=v0.4.0#4638bb02a9dc41cc2fb811f092811f6a951c752a";
hash = "sha256-YpWXn1J3JKQSCrWB25mAfzd1/T56QstEZnhPzBwxgoM=";
};
}
{
name = "1220e17e64ef0ef561b3e4b9f3a96a2494285f2ec31c097721bf8c8677ec4415c634";
path = fetchZigArtifact {
name = "zig_objc";
url = "https://github.com/mitchellh/zig-objc/archive/9b8ba849b0f58fe207ecd6ab7c147af55b17556e.tar.gz";
hash = "sha256-H+HIbh2T23uzrsg9/1/vl9Ir1HCAa2pzeTx6zktJH9Q=";
};
}
{
name = "12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc";
path = fetchZigArtifact {
name = "zig_js";
url = "https://github.com/mitchellh/zig-js/archive/d0b8b0a57c52fbc89f9d9fecba75ca29da7dd7d1.tar.gz";
hash = "sha256-fyNeCVbC9UAaKJY6JhAZlT0A479M/AKYMPIWEZbDWD0=";
};
}
{
name = "12207831bce7d4abce57b5a98e8f3635811cfefd160bca022eb91fe905d36a02cf25";
path = fetchZigArtifact {
name = "ziglyph";
url = "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz";
hash = "sha256-cse98+Ft8QUjX+P88yyYfaxJOJGQ9M7Ymw7jFxDz89k=";
};
}
{
name = "12209ca054cb1919fa276e328967f10b253f7537c4136eb48f3332b0f7cf661cad38";
path = fetchZigArtifact {
name = "zig_wayland";
url = "https://deps.files.ghostty.org/zig-wayland-fbfe3b4ac0b472a27b1f1a67405436c58cbee12d.tar.gz";
hash = "sha256-RtAystqK/GRYIquTK1KfD7rRSCrfuzAvCD1Z9DE1ldc=";
};
}
{
name = "1220edc3b8d8bedbb50555947987e5e8e2f93871ca3c8e8d4cc8f1377c15b5dd35e8";
path = fetchZigArtifact {
name = "zf";
url = "git+https://github.com/natecraddock/zf/?ref=main#ed99ca18b02dda052e20ba467e90b623c04690dd";
hash = "sha256-t6QNrEJZ4GZZsYixjYvpdrYoCmNbG8TTUmGs2MFa4sU=";
};
}
{
name = "1220c72c1697dd9008461ead702997a15d8a1c5810247f02e7983b9f74c6c6e4c087";
path = fetchZigArtifact {
name = "vaxis";
url = "git+https://github.com/rockorager/libvaxis/?ref=main#dc0a228a5544988d4a920cfb40be9cd28db41423";
hash = "sha256-QWN4jOrA91KlbqmeEHHJ4HTnCC9nmfxt8DHUXJpAzLI=";
};
}
{
name = "12208d70ee791d7ef7e16e1c3c9c1127b57f1ed066a24f87d57fc9f730c5dc394b9d";
path = fetchZigArtifact {
name = "gobject";
url = "https://github.com/ianprime0509/zig-gobject/releases/download/v0.2.2/bindings-gnome47.tar.zst";
hash = "sha256-UU97kNv/bZzQPKz1djhEDLapLguvfBpFfWVb6FthtcI=";
};
}
{
name = "12202cdac858abc52413a6c6711d5026d2d3c8e13f95ca2c327eade0736298bb021f";
path = fetchZigArtifact {
name = "wayland";
url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz";
hash = "sha256-m9G72jdG30KH2yQhNBcBJ46OnekzuX0i2uIOyczkpLk=";
};
}
{
name = "12201a57c6ce0001aa034fa80fba3e1cd2253c560a45748f4f4dd21ff23b491cddef";
path = fetchZigArtifact {
name = "wayland_protocols";
url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz";
hash = "sha256-XO3K3egbdeYPI+XoO13SuOtO+5+Peb16NH0UiusFMPg=";
};
}
{
name = "12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566";
path = fetchZigArtifact {
name = "plasma_wayland_protocols";
url = "git+https://github.com/KDE/plasma-wayland-protocols?ref=main#db525e8f9da548cffa2ac77618dd0fbe7f511b86";
hash = "sha256-iWRv3+OfmHxmeCJ8m0ChjgZX6mwXlcFmK8P/Vt8gDj4=";
};
}
{
name = "12203d2647e5daf36a9c85b969e03f422540786ce9ea624eb4c26d204fe1f46218f3";
path = fetchZigArtifact {
name = "iterm2_themes";
url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/db227d159adc265818f2e898da0f70ef8d7b580e.tar.gz";
hash = "sha256-Iyf7U4rpvNkPX4AOEbYSYGte5+SjRwsWD2luOn1Hz8U=";
};
}
{
name = "1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402";
path = fetchZigArtifact {
name = "imgui";
url = "https://github.com/ocornut/imgui/archive/e391fe2e66eb1c96b1624ae8444dc64c23146ef4.tar.gz";
hash = "sha256-oF/QHgTPEat4Hig4fGIdLkIPHmBEyOJ6JeYD6pnveGA=";
};
}
{
name = "1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d";
path = fetchZigArtifact {
name = "freetype";
url = "https://github.com/freetype/freetype/archive/refs/tags/VER-2-13-2.tar.gz";
hash = "sha256-QnIB9dUVFnDQXB9bRb713aHy592XHvVPD+qqf/0quQw=";
};
}
{
name = "1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66";
path = fetchZigArtifact {
name = "libpng";
url = "https://github.com/glennrp/libpng/archive/refs/tags/v1.6.43.tar.gz";
hash = "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo=";
};
}
{
name = "1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb";
path = fetchZigArtifact {
name = "zlib";
url = "https://github.com/madler/zlib/archive/refs/tags/v1.3.1.tar.gz";
hash = "sha256-F+iIY/NgBnKrSRgvIXKBtvxNPHYr3jYZNeQ2qVIU0Fw=";
};
}
{
name = "12201149afb3326c56c05bb0a577f54f76ac20deece63aa2f5cd6ff31a4fa4fcb3b7";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "fontconfig"; name = "fontconfig";
url = "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz"; url = "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz";
@ -300,91 +98,259 @@ in
}; };
} }
{ {
name = "122032442d95c3b428ae8e526017fad881e7dc78eab4d558e9a58a80bfbd65a64f7d"; name = "N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "libxml2"; name = "freetype";
url = "https://github.com/GNOME/libxml2/archive/refs/tags/v2.11.5.tar.gz"; url = "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz";
hash = "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU="; hash = "sha256-QnIB9dUVFnDQXB9bRb713aHy592XHvVPD+qqf/0quQw=";
}; };
} }
{ {
name = "1220b8588f106c996af10249bfa092c6fb2f35fbacb1505ef477a0b04a7dd1063122"; name = "N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "harfbuzz"; name = "gettext";
url = "https://github.com/harfbuzz/harfbuzz/archive/refs/tags/8.4.0.tar.gz"; url = "https://deps.files.ghostty.org/gettext-0.24.tar.gz";
hash = "sha256-nxygiYE7BZRK0c6MfgGCEwJtNdybq0gKIeuHaDg5ZVY="; hash = "sha256-yRhQPVk9cNr0hE0XWhPYFq+stmfAb7oeydzVACwVGLc=";
}; };
} }
{ {
name = "12205c83b8311a24b1d5ae6d21640df04f4b0726e314337c043cde1432758cbe165b"; name = "N-V-__8AAMrJSwAUGb9-vTzkNR-5LXS81MR__ZRVfF3tWgG6";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "highway"; name = "glfw";
url = "https://github.com/google/highway/archive/refs/tags/1.1.0.tar.gz"; url = "https://github.com/glfw/glfw/archive/e7ea71be039836da3a98cea55ae5569cb5eb885c.tar.gz";
hash = "sha256-NUqLRTm1iOcLmOxwhEJz4/J0EwLEw3e8xOgbPRhm98k="; hash = "sha256-M3N1XUAlMebBo5X1Py+9YxjKXgZ6eacqWRCbUmwLKQo=";
}; };
} }
{ {
name = "1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb"; name = "N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy";
path = fetchZigArtifact {
name = "oniguruma";
url = "https://github.com/kkos/oniguruma/archive/refs/tags/v6.9.9.tar.gz";
hash = "sha256-ABqhIC54RI9MC/GkjHblVodrNvFtks4yB+zP1h2Z8qA=";
};
}
{
name = "1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e";
path = fetchZigArtifact {
name = "sentry";
url = "https://github.com/getsentry/sentry-native/archive/refs/tags/0.7.8.tar.gz";
hash = "sha256-KsZJfMjWGo0xCT5HrduMmyxFsWsHBbszSoNbZCPDGN8=";
};
}
{
name = "12207fd37bb8251919c112dcdd8f616a491857b34a451f7e4486490077206dc2a1ea";
path = fetchZigArtifact {
name = "breakpad";
url = "https://github.com/getsentry/breakpad/archive/b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz";
hash = "sha256-bMqYlD0amQdmzvYQd8Ca/1k4Bj/heh7+EijlQSttatk=";
};
}
{
name = "1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641";
path = fetchZigArtifact {
name = "utfcpp";
url = "https://github.com/nemtrif/utfcpp/archive/refs/tags/v4.0.5.tar.gz";
hash = "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8=";
};
}
{
name = "122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd";
path = fetchZigArtifact {
name = "wuffs";
url = "https://github.com/google/wuffs/archive/refs/tags/v0.4.0-alpha.9.tar.gz";
hash = "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM=";
};
}
{
name = "12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806";
path = fetchZigArtifact {
name = "pixels";
url = "git+https://github.com/make-github-pseudonymous-again/pixels?ref=main#d843c2714d32e15b48b8d7eeb480295af537f877";
hash = "sha256-kXYGO0qn2PfyOYCrRA49BHIgTzdmKhI8SNO1ZKfUYEE=";
};
}
{
name = "12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "glslang"; name = "glslang";
url = "https://github.com/KhronosGroup/glslang/archive/refs/tags/14.2.0.tar.gz"; url = "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz";
hash = "sha256-FKLtu1Ccs+UamlPj9eQ12/WXFgS0uDPmPmB26MCpl7U="; hash = "sha256-FKLtu1Ccs+UamlPj9eQ12/WXFgS0uDPmPmB26MCpl7U=";
}; };
} }
{ {
name = "1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da"; name = "gobject-0.2.0-Skun7IWDlQAOKu4BV7LapIxL9Imbq1JRmzvcIkazvAxR";
path = fetchZigArtifact {
name = "gobject";
url = "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-18-21-1/ghostty-gobject-0.14.0-2025-03-18-21-1.tar.zst";
hash = "sha256-hWcpl0Wd3XydT+RY7+VIoxXPhCzele1Ip76YSh+KmLI=";
};
}
{
name = "N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr";
path = fetchZigArtifact {
name = "gtk4_layer_shell";
url = "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz";
hash = "sha256-mChCgSYKXu9bT2OlXxbEv2p4ihAgptsDfssPcfozaYg=";
};
}
{
name = "N-V-__8AAG02ugUcWec-Ndp-i7JTsJ0dgF8nnJRUInkGLG7G";
path = fetchZigArtifact {
name = "harfbuzz";
url = "https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz";
hash = "sha256-8WNRuv4hRyX+LB1bWfDZPkmQWkskeJn7kNcM/5U6K5s=";
};
}
{
name = "N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE";
path = fetchZigArtifact {
name = "highway";
url = "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz";
hash = "sha256-h9T4iT704I8iSXNgj/6/lCaKgTgLp5wS6IQZaMgKohI=";
};
}
{
name = "N-V-__8AAH0GaQC8a52s6vfIxg88OZgFgEW6DFxfSK4lX_l3";
path = fetchZigArtifact {
name = "imgui";
url = "https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz";
hash = "sha256-oF/QHgTPEat4Hig4fGIdLkIPHmBEyOJ6JeYD6pnveGA=";
};
}
{
name = "N-V-__8AAGHcWgTaKLjwmFkxToNT4jgz5VXUHR7hz8TQ2_AS";
path = fetchZigArtifact {
name = "iterm2_themes";
url = "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/6fa671fdc1daf1fcfa025cb960ffa3e7373a2ed8.tar.gz";
hash = "sha256-g9o2CIc/TfWYoUS/l/HP5KZECD7qNsdQUlFruaKkVz4=";
};
}
{
name = "N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD";
path = fetchZigArtifact {
name = "libpng";
url = "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz";
hash = "sha256-/syVtGzwXo4/yKQUdQ4LparQDYnp/fF16U/wQcrxoDo=";
};
}
{
name = "libxev-0.0.0-86vtcyMBEwA-UpcjfOICyI2GYG8o6MiRbinS1_8g1_rw";
path = fetchZigArtifact {
name = "libxev";
url = "https://github.com/mitchellh/libxev/archive/75a10d0fb374e8eb84948dcfc68d865e755e59c2.tar.gz";
hash = "sha256-/CSKSuZZfn0aIQlVZ0O8ch5O4gCajYBTTuoetRdo0n4=";
};
}
{
name = "N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK";
path = fetchZigArtifact {
name = "libxml2";
url = "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz";
hash = "sha256-bCgFni4+60K1tLFkieORamNGwQladP7jvGXNxdiaYhU=";
};
}
{
name = "N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c";
path = fetchZigArtifact {
name = "oniguruma";
url = "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz";
hash = "sha256-ABqhIC54RI9MC/GkjHblVodrNvFtks4yB+zP1h2Z8qA=";
};
}
{
name = "N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc";
path = fetchZigArtifact {
name = "pixels";
url = "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz";
hash = "sha256-Veg7FtCRCCUCvxSb9FfzH0IJLFmCZQ4/+657SIcb8Ro=";
};
}
{
name = "N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs";
path = fetchZigArtifact {
name = "plasma_wayland_protocols";
url = "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz";
hash = "sha256-XFi6IUrNjmvKNCbcCLAixGqN2Zeymhs+KLrfccIN9EE=";
};
}
{
name = "N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG";
path = fetchZigArtifact {
name = "sentry";
url = "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz";
hash = "sha256-KsZJfMjWGo0xCT5HrduMmyxFsWsHBbszSoNbZCPDGN8=";
};
}
{
name = "N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv";
path = fetchZigArtifact { path = fetchZigArtifact {
name = "spirv_cross"; name = "spirv_cross";
url = "https://github.com/KhronosGroup/SPIRV-Cross/archive/476f384eb7d9e48613c45179e502a15ab95b6b49.tar.gz"; url = "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz";
hash = "sha256-tStvz8Ref6abHwahNiwVVHNETizAmZVVaxVsU7pmV+M="; hash = "sha256-tStvz8Ref6abHwahNiwVVHNETizAmZVVaxVsU7pmV+M=";
}; };
} }
{
name = "N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH";
path = fetchZigArtifact {
name = "utfcpp";
url = "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz";
hash = "sha256-/8ZooxDndgfTk/PBizJxXyI9oerExNbgV5oR345rWc8=";
};
}
{
name = "vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn";
path = fetchZigArtifact {
name = "vaxis";
url = "git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23";
hash = "sha256-bNZ3oveT6vPChjimPJ/GGfcdivlAeJdl/xfWM+S/MHY=";
};
}
{
name = "N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t";
path = fetchZigArtifact {
name = "wayland";
url = "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz";
hash = "sha256-6kGR1o5DdnflHzqs3ieCmBAUTpMdOXoyfcYDXiw5xQ0=";
};
}
{
name = "N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S";
path = fetchZigArtifact {
name = "wayland_protocols";
url = "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz";
hash = "sha256-XO3K3egbdeYPI+XoO13SuOtO+5+Peb16NH0UiusFMPg=";
};
}
{
name = "N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs";
path = fetchZigArtifact {
name = "wuffs";
url = "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz";
hash = "sha256-nkzSCr6W5sTG7enDBXEIhgEm574uLD41UVR2wlC+HBM=";
};
}
{
name = "z2d-0.7.0-j5P_Hg_DDACq-2H2Zh7rAq6_TXWdQzv7JAUfnrdeDosg";
path = fetchZigArtifact {
name = "z2d";
url = "https://github.com/vancluever/z2d/archive/8bbd035f4101f02b1d27947def0d7da3215df7fe.tar.gz";
hash = "sha256-wfadegeixcbgxRzRtf6M2H34CTuvDM22XVIhuufFBG4=";
};
}
{
name = "zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9";
path = fetchZigArtifact {
name = "zf";
url = "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz";
hash = "sha256-3nulNQd/4rZ4paeXJYXwAliNNyRNsIOX/q3z1JB8C7I=";
};
}
{
name = "zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM";
path = fetchZigArtifact {
name = "zg";
url = "git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc";
hash = "sha256-fo3l6cjkrr/godElTGnQzalBsasN7J73IDIRmw7v1gA=";
};
}
{
name = "N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ";
path = fetchZigArtifact {
name = "zig_js";
url = "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz";
hash = "sha256-fyNeCVbC9UAaKJY6JhAZlT0A479M/AKYMPIWEZbDWD0=";
};
}
{
name = "zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt";
path = fetchZigArtifact {
name = "zig_objc";
url = "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz";
hash = "sha256-zn1tR6xhSmDla4UJ3t+Gni4Ni3R8deSK3tEe7DGzNXw=";
};
}
{
name = "wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy";
path = fetchZigArtifact {
name = "zig_wayland";
url = "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz";
hash = "sha256-E77GZ15APYbbO1WzmuJi8eG9/iQFbc2CgkNBxjCLUhk=";
};
}
{
name = "zigimg-0.1.0-lly-O6N2EABOxke8dqyzCwhtUCAafqP35zC7wsZ4Ddxj";
path = fetchZigArtifact {
name = "zigimg";
url = "git+https://github.com/TUSF/zigimg#31268548fe3276c0e95f318a6c0d2ab10565b58d";
hash = "sha256-oblfr2FIzuqq0FLo/RrzCwUX1NJJuT53EwD3nP3KwN0=";
};
}
{
name = "ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf";
path = fetchZigArtifact {
name = "ziglyph";
url = "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz";
hash = "sha256-cse98+Ft8QUjX+P88yyYfaxJOJGQ9M7Ymw7jFxDz89k=";
};
}
{
name = "N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o";
path = fetchZigArtifact {
name = "zlib";
url = "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz";
hash = "sha256-F+iIY/NgBnKrSRgvIXKBtvxNPHYr3jYZNeQ2qVIU0Fw=";
};
}
] ]

34
build.zig.zon.txt generated Normal file
View File

@ -0,0 +1,34 @@
git+https://codeberg.org/atman/zg#4a002763419a34d61dcbb1f415821b83b9bf8ddc
git+https://github.com/TUSF/zigimg#31268548fe3276c0e95f318a6c0d2ab10565b58d
git+https://github.com/rockorager/libvaxis#1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23
https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz
https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz
https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz
https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz
https://deps.files.ghostty.org/gettext-0.24.tar.gz
https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz
https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz
https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz
https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz
https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz
https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz
https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz
https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz
https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz
https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz
https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz
https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz
https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz
https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz
https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz
https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz
https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz
https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz
https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz
https://github.com/glfw/glfw/archive/e7ea71be039836da3a98cea55ae5569cb5eb885c.tar.gz
https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-18-21-1/ghostty-gobject-0.14.0-2025-03-18-21-1.tar.zst
https://github.com/mbadolato/iTerm2-Color-Schemes/archive/6fa671fdc1daf1fcfa025cb960ffa3e7373a2ed8.tar.gz
https://github.com/mitchellh/libxev/archive/75a10d0fb374e8eb84948dcfc68d865e755e59c2.tar.gz
https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz
https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz
https://github.com/vancluever/z2d/archive/8bbd035f4101f02b1d27947def0d7da3215df7fe.tar.gz

View File

@ -1,59 +0,0 @@
# Note: the flatpak build is likely broken right now and is not actively
# maintained. We may completely remove this file in the future. For now,
# we want to keep _trying_ but its something with known issues.
app-id: com.mitchellh.ghostty
runtime: org.gnome.Platform
runtime-version: "43"
sdk: org.gnome.Sdk
default-branch: tip
command: ghostty
build-options:
append-path: /app/tmp/zig
strip: false
no-debuginfo: true
# Note: we have to use cleanup-commands because flatpak-builder doesn't
# run "cleanup" on its own: https://github.com/flatpak/flatpak-builder/issues/14
cleanup-commands:
- "rm -rf /app/tmp"
finish-args:
# 3D rendering
- --device=dri
# Windowing
- --share=ipc
- --socket=x11
- --socket=wayland
# Files (we are a terminal so we need all of them)
- --filesystem=host
# So we can escape the sandbox
- --talk-name=org.freedesktop.Flatpak
modules:
# Note: this should be kept in sync with our flake.nix. Over time this
# should stabilize to being a release version and not a nightly.
- name: zig
buildsystem: simple
build-commands:
- mkdir -p /app/tmp/zig
- cp -r ./* /app/tmp/zig
sources:
- type: archive
url: https://ziglang.org/builds/zig-linux-x86_64-0.12.0-dev.141+ddf5859c2.tar.xz
sha256: eaf519b1ec3cb0f3c9bcbc47ead5f50610f9c106279a35b9feb09bed8afc628b
only-arches:
- x86_64
- type: archive
url: https://ziglang.org/builds/zig-linux-aarch64-0.12.0-dev.141+ddf5859c2.tar.xz
sha256: 4f918ae185a5dc281b5d30be92cd4c36ebd77b8665729c5e2c47a8eeccd243e8
only-arches:
- aarch64
- name: ghostty
buildsystem: simple
build-commands:
- MACH_SDK_PATH="$(pwd)/vendor/mach-sdk" zig build -Doptimize=ReleaseSafe -Dcpu=baseline -Dflatpak=true -Dapp-runtime=gtk --prefix /app
sources:
- type: dir
path: .
skip:
- .flatpak-builder
- zig-cache
- zig-out

View File

@ -1,13 +1,15 @@
[Desktop Entry] [Desktop Entry]
Name=Ghostty Version=1.0
Name=@NAME@
Type=Application Type=Application
Comment=A terminal emulator Comment=A terminal emulator
Exec=ghostty TryExec=@GHOSTTY@
Exec=@GHOSTTY@ --launched-from=desktop
Icon=com.mitchellh.ghostty Icon=com.mitchellh.ghostty
Categories=System;TerminalEmulator; Categories=System;TerminalEmulator;
Keywords=terminal;tty;pty; Keywords=terminal;tty;pty;
StartupNotify=true StartupNotify=true
StartupWMClass=com.mitchellh.ghostty StartupWMClass=@APPID@
Terminal=false Terminal=false
Actions=new-window; Actions=new-window;
X-GNOME-UsesNotifications=true X-GNOME-UsesNotifications=true
@ -16,7 +18,8 @@ X-TerminalArgTitle=--title=
X-TerminalArgAppId=--class= X-TerminalArgAppId=--class=
X-TerminalArgDir=--working-directory= X-TerminalArgDir=--working-directory=
X-TerminalArgHold=--wait-after-command X-TerminalArgHold=--wait-after-command
DBusActivatable=true
[Desktop Action new-window] [Desktop Action new-window]
Name=New Window Name=New Window
Exec=ghostty Exec=@GHOSTTY@ --launched-from=desktop

View File

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>@APPID@</id>
<launchable type="desktop-id">@APPID@.desktop</launchable>
<name>@NAME@</name>
<url type="homepage">https://ghostty.org</url>
<url type="help">https://ghostty.org/docs</url>
<url type="bugtracker">https://github.com/ghostty-org/ghostty/discussions</url>
<url type="contact">https://ghostty.org/docs/help</url>
<url type="contribute">https://github.com/ghostty-org/ghostty/blob/main/CONTRIBUTING.md</url>
<url type="translate">https://github.com/ghostty-org/ghostty/blob/main/po/README_TRANSLATORS.md</url>
<url type="vcs-browser">https://github.com/ghostty-org/ghostty</url>
<summary>Ghostty is a fast, feature-rich, and cross-platform terminal emulator</summary>
<metadata_license>MIT</metadata_license>
<project_license>MIT</project_license>
<content_rating type="oars-1.1" />
<developer id="com.mitchellh">
<name>Mitchell Hashimoto</name>
</developer>
<update_contact>m@mitchellh.com</update_contact>
<description>
<p>
Ghostty is a terminal emulator that differentiates itself by being fast,
feature-rich, and native. While there are many excellent terminal
emulators available, they all force you to choose between speed,
features, or native UIs. Ghostty provides all three.
</p>
</description>
<recommends>
<control>keyboard</control>
<control>pointing</control>
</recommends>
<requires>
<!--
Mobile/tablet AND desktop supported
Ref: https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines#display-size
-->
<display_length compare="ge">360</display_length>
</requires>
<translation type="gettext">com.mitchellh.ghostty</translation>
<!--
TODO: Generate manifest location data.
Ref: https://docs.flathub.org/docs/for-app-authors/metainfo-guidelines#manifest-location
<custom>
<value key="flathub::manifest">https://github.com/ghostty-org/ghostty/blob/<hash>/flatpak/com.mitchellh.ghostty.yml</value>
</custom>
-->
<releases>
<!-- TODO: Generate this automatically -->
<release version="1.0.1" date="2024-12-31">
<url type="details">https://ghostty.org/docs/install/release-notes/1-0-1</url>
</release>
</releases>
</component>

3
dist/linux/dbus.service.flatpak.in vendored Normal file
View File

@ -0,0 +1,3 @@
[D-BUS Service]
Name=@APPID@
Exec=@GHOSTTY@ --launched-from=dbus

4
dist/linux/dbus.service.in vendored Normal file
View File

@ -0,0 +1,4 @@
[D-BUS Service]
Name=@APPID@
SystemdService=@APPID@.service
Exec=@GHOSTTY@ --launched-from=dbus

11
dist/linux/systemd.service.in vendored Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=@NAME@
After=graphical-session.target
[Service]
Type=dbus
BusName=@APPID@
ExecStart=@GHOSTTY@ --launched-from=systemd
[Install]
WantedBy=graphical-session.target

Binary file not shown.

17
dist/macos/Info.plist vendored
View File

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>ghostty</string>
<key>CFBundleIdentifier</key>
<string>com.mitchellh.ghostty</string>
<key>CFBundleName</key>
<string>Ghostty</string>
<key>CFBundleDisplayName</key>
<string>Ghostty</string>
<key>CFBundleIconFile</key>
<string>Ghostty.icns</string>
</dict>
</plist>

70
flake.lock generated
View File

@ -3,11 +3,11 @@
"flake-compat": { "flake-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1733328505, "lastModified": 1747046372,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -34,46 +34,26 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-stable": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1738255539, "lastModified": 1748189127,
"narHash": "sha256-hP2eOqhIO/OILW+3moNWO4GtdJFYCqAe9yJZgvlCoDQ=", "narHash": "sha256-zRDR+EbbeObu4V2X5QCd2Bk5eltfDlCr5yvhBwUT6pY=",
"owner": "nixos", "rev": "7c43f080a7f28b2774f3b3f43234ca11661bf334",
"repo": "nixpkgs", "type": "tarball",
"rev": "c3511a3b53b482aa7547c9d1626fd7310c1de1c5", "url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.802491.7c43f080a7f2/nixexprs.tar.xz"
"type": "github"
}, },
"original": { "original": {
"owner": "nixos", "type": "tarball",
"ref": "release-24.11", "url": "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz"
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1738136902,
"narHash": "sha256-pUvLijVGARw4u793APze3j6mU1Zwdtz7hGkGGkD87qw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9a5db3142ce450045840cc8d832b13b8a2018e0c",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
} }
}, },
"root": { "root": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs-stable": "nixpkgs-stable", "nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"zig": "zig", "zig": "zig",
"zig2nix": "zig2nix" "zon2nix": "zon2nix"
} }
}, },
"systems": { "systems": {
@ -98,15 +78,15 @@
"flake-utils" "flake-utils"
], ],
"nixpkgs": [ "nixpkgs": [
"nixpkgs-stable" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1738239110, "lastModified": 1748261582,
"narHash": "sha256-Y5i9mQ++dyIQr+zEPNy+KIbc5wjPmfllBrag3cHZgcE=", "narHash": "sha256-3i0IL3s18hdDlbsf0/E+5kyPRkZwGPbSFngq5eToiAA=",
"owner": "mitchellh", "owner": "mitchellh",
"repo": "zig-overlay", "repo": "zig-overlay",
"rev": "1a8fb6f3a04724519436355564b95fce5e272504", "rev": "aafb1b093fb838f7a02613b719e85ec912914221",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -115,27 +95,27 @@
"type": "github" "type": "github"
} }
}, },
"zig2nix": { "zon2nix": {
"inputs": { "inputs": {
"flake-utils": [ "flake-utils": [
"flake-utils" "flake-utils"
], ],
"nixpkgs": [ "nixpkgs": [
"nixpkgs-stable" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1738263917, "lastModified": 1742104771,
"narHash": "sha256-j/3fwe2pEOquHabP/puljOKwAZFjIE9gXZqA91sC48M=", "narHash": "sha256-LhidlyEA9MP8jGe1rEnyjGFCzLLgCdDpYeWggibayr0=",
"owner": "jcollie", "owner": "jcollie",
"repo": "zig2nix", "repo": "zon2nix",
"rev": "c311d8e77a6ee0d995f40a6e10a89a3a4ab04f9a", "rev": "56c159be489cc6c0e73c3930bd908ddc6fe89613",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "jcollie", "owner": "jcollie",
"ref": "c311d8e77a6ee0d995f40a6e10a89a3a4ab04f9a", "ref": "56c159be489cc6c0e73c3930bd908ddc6fe89613",
"repo": "zig2nix", "repo": "zon2nix",
"type": "github" "type": "github"
} }
} }

View File

@ -2,12 +2,10 @@
description = "👻"; description = "👻";
inputs = { inputs = {
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
# We want to stay as up to date as possible but need to be careful that the # We want to stay as up to date as possible but need to be careful that the
# glibc versions used by our dependencies from Nix are compatible with the # glibc versions used by our dependencies from Nix are compatible with the
# system glibc that the user is building for. # system glibc that the user is building for.
nixpkgs-stable.url = "github:nixos/nixpkgs/release-24.11"; nixpkgs.url = "https://channels.nixos.org/nixos-25.05/nixexprs.tar.xz";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
# Used for shell.nix # Used for shell.nix
@ -19,16 +17,16 @@
zig = { zig = {
url = "github:mitchellh/zig-overlay"; url = "github:mitchellh/zig-overlay";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs-stable"; nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils"; flake-utils.follows = "flake-utils";
flake-compat.follows = ""; flake-compat.follows = "";
}; };
}; };
zig2nix = { zon2nix = {
url = "github:jcollie/zig2nix?ref=c311d8e77a6ee0d995f40a6e10a89a3a4ab04f9a"; url = "github:jcollie/zon2nix?ref=56c159be489cc6c0e73c3930bd908ddc6fe89613";
inputs = { inputs = {
nixpkgs.follows = "nixpkgs-stable"; nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils"; flake-utils.follows = "flake-utils";
}; };
}; };
@ -36,22 +34,20 @@
outputs = { outputs = {
self, self,
nixpkgs-unstable, nixpkgs,
nixpkgs-stable,
zig, zig,
zig2nix, zon2nix,
... ...
}: }:
builtins.foldl' nixpkgs-stable.lib.recursiveUpdate {} ( builtins.foldl' nixpkgs.lib.recursiveUpdate {} (
builtins.map ( builtins.map (
system: let system: let
pkgs-stable = nixpkgs-stable.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
pkgs-unstable = nixpkgs-unstable.legacyPackages.${system};
in { in {
devShell.${system} = pkgs-stable.callPackage ./nix/devShell.nix { devShell.${system} = pkgs.callPackage ./nix/devShell.nix {
zig = zig.packages.${system}."0.13.0"; zig = zig.packages.${system}."0.14.1";
wraptest = pkgs-stable.callPackage ./nix/wraptest.nix {}; wraptest = pkgs.callPackage ./nix/wraptest.nix {};
zig2nix = zig2nix; zon2nix = zon2nix;
}; };
packages.${system} = let packages.${system} = let
@ -61,30 +57,29 @@
revision = self.shortRev or self.dirtyShortRev or "dirty"; revision = self.shortRev or self.dirtyShortRev or "dirty";
}; };
in rec { in rec {
deps = pkgs-stable.callPackage ./build.zig.zon.nix {}; deps = pkgs.callPackage ./build.zig.zon.nix {};
ghostty-debug = pkgs-stable.callPackage ./nix/package.nix (mkArgs "Debug"); ghostty-debug = pkgs.callPackage ./nix/package.nix (mkArgs "Debug");
ghostty-releasesafe = pkgs-stable.callPackage ./nix/package.nix (mkArgs "ReleaseSafe"); ghostty-releasesafe = pkgs.callPackage ./nix/package.nix (mkArgs "ReleaseSafe");
ghostty-releasefast = pkgs-stable.callPackage ./nix/package.nix (mkArgs "ReleaseFast"); ghostty-releasefast = pkgs.callPackage ./nix/package.nix (mkArgs "ReleaseFast");
ghostty = ghostty-releasefast; ghostty = ghostty-releasefast;
default = ghostty; default = ghostty;
}; };
formatter.${system} = pkgs-stable.alejandra; formatter.${system} = pkgs.alejandra;
apps.${system} = let apps.${system} = let
runVM = ( runVM = (
module: let module: let
vm = import ./nix/vm/create.nix { vm = import ./nix/vm/create.nix {
inherit system module; inherit system module nixpkgs;
nixpkgs = nixpkgs-stable;
overlay = self.overlays.debug; overlay = self.overlays.debug;
}; };
program = pkgs-stable.writeShellScript "run-ghostty-vm" '' program = pkgs.writeShellScript "run-ghostty-vm" ''
SHARED_DIR=$(pwd) SHARED_DIR=$(pwd)
export SHARED_DIR export SHARED_DIR
${pkgs-stable.lib.getExe vm.config.system.build.vm} "$@" ${pkgs.lib.getExe vm.config.system.build.vm} "$@"
''; '';
in { in {
type = "app"; type = "app";

View File

@ -0,0 +1,108 @@
#!/usr/bin/env bash
#
# This script checks if the flatpak/zig-packages.json file is up-to-date.
# If the `--update` flag is passed, it will update all necessary
# files to be up to date.
#
# The files owned by this are:
#
# - flatpak/zig-packages.json
#
# All of these are auto-generated and should not be edited manually.
# Nothing in this script should fail.
set -eu
set -o pipefail
WORK_DIR=$(mktemp -d)
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "could not create temp dir"
exit 1
fi
function cleanup {
rm -rf "$WORK_DIR"
}
trap cleanup EXIT
help() {
echo ""
echo "To fix, please (manually) re-run the script from the repository root,"
echo "commit, and submit a PR with the update:"
echo ""
echo " ./flatpak/build-support/check-zig-cache.sh --update"
echo " git add flatpak/zig-packages.json"
echo " git commit -m \"flatpak: update zig-packages.json\""
echo ""
}
# Turn Nix's base64 hashes into regular hexadecimal form
decode_hash() {
input=$1
input=${input#sha256-}
echo "$input" | base64 -d | od -vAn -t x1 | tr -d ' \n'
}
ROOT="$(realpath "$(dirname "$0")/../../")"
ZIG_PACKAGES_JSON="$ROOT/flatpak/zig-packages.json"
BUILD_ZIG_ZON_JSON="$ROOT/build.zig.zon.json"
if [ ! -f "${BUILD_ZIG_ZON_JSON}" ]; then
echo -e "\nERROR: build.zig.zon2json-lock missing."
help
exit 1
fi
if [ -f "${ZIG_PACKAGES_JSON}" ]; then
OLD_HASH=$(sha512sum "${ZIG_PACKAGES_JSON}" | awk '{print $1}')
fi
while read -r url sha256 dest; do
src_type=archive
sha256=$(decode_hash "$sha256")
git_commit=
if [[ "$url" =~ ^git\+* ]]; then
src_type=git
sha256=
url=${url#git+}
git_commit=${url##*#}
url=${url%%/\?ref*}
url=${url%%#*}
fi
jq \
-nec \
--arg type "$src_type" \
--arg url "$url" \
--arg git_commit "$git_commit" \
--arg dest "$dest" \
--arg sha256 "$sha256" \
'{
type: $type,
url: $url,
commit: $git_commit,
dest: $dest,
sha256: $sha256,
} | with_entries(select(.value != ""))'
done < <(jq -rc 'to_entries[] | [.value.url, .value.hash, "vendor/p/\(.key)"] | @tsv' "$BUILD_ZIG_ZON_JSON") |
jq -s '.' >"$WORK_DIR/zig-packages.json"
NEW_HASH=$(sha512sum "$WORK_DIR/zig-packages.json" | awk '{print $1}')
if [ "${OLD_HASH}" == "${NEW_HASH}" ]; then
echo -e "\nOK: flatpak/zig-packages.json unchanged."
exit 0
elif [ "${1:-}" != "--update" ]; then
echo -e "\nERROR: flatpak/zig-packages.json needs to be updated."
echo ""
echo " * Old hash: ${OLD_HASH}"
echo " * New hash: ${NEW_HASH}"
help
exit 1
else
mv "$WORK_DIR/zig-packages.json" "$ZIG_PACKAGES_JSON"
echo -e "\nOK: flatpak/zig-packages.json updated."
exit 0
fi

View File

@ -0,0 +1,61 @@
app-id: com.mitchellh.ghostty-debug
runtime: org.gnome.Platform
runtime-version: "48"
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.ziglang
default-branch: tip
command: ghostty
rename-icon: com.mitchellh.ghostty
finish-args:
# 3D rendering
- --device=dri
# use host PTS namespace
- --device=all
# Windowing
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
# Allow user to specify additional config files in home by default
- --filesystem=home:ro
# So we can escape the sandbox
- --talk-name=org.freedesktop.Flatpak
cleanup:
- /include
- /lib/girepository-1.0
- /lib/pkgconfig
- /share/gir-1.0
- /share/pkgconfig
- /share/vala
- "*.la"
- "*.a"
- "*.so"
modules:
- dependencies.yml
- name: ghostty
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/ziglang
build-commands:
- zig build
-Doptimize=Debug
-Dcpu=baseline
-Dflatpak=true
-Dstrip=false
-fno-sys=oniguruma
--prefix /app
--search-prefix /app
--system $PWD/vendor/p
sources:
- type: dir
path: ..
skip:
- flatpak/.flatpak-builder
- flatpak/builddir
- flatpak/repo
- zig-cache
- zig-out
- zig-packages.json

View File

@ -0,0 +1,60 @@
app-id: com.mitchellh.ghostty
runtime: org.gnome.Platform
runtime-version: "48"
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.ziglang
default-branch: tip
command: ghostty
finish-args:
# 3D rendering
- --device=dri
# use host PTS namespace
- --device=all
# Windowing
- --share=ipc
- --socket=fallback-x11
- --socket=wayland
# Allow user to specify additional config files in home by default
- --filesystem=home:ro
# So we can escape the sandbox
- --talk-name=org.freedesktop.Flatpak
cleanup:
- /include
- /lib/girepository-1.0
- /lib/pkgconfig
- /share/gir-1.0
- /share/pkgconfig
- /share/vala
- "*.la"
- "*.a"
- "*.so"
modules:
- dependencies.yml
- name: ghostty
buildsystem: simple
build-options:
append-path: /usr/lib/sdk/ziglang
build-commands:
- zig build
-Doptimize=ReleaseFast
-Dcpu=baseline
-Dflatpak=true
-Dstrip=false
-fno-sys=oniguruma
--prefix /app
--search-prefix /app
--system $PWD/vendor/p
sources:
- type: dir
path: ..
skip:
- flatpak/.flatpak-builder
- flatpak/builddir
- flatpak/repo
- zig-cache
- zig-out
- zig-packages.json

66
flatpak/dependencies.yml Normal file
View File

@ -0,0 +1,66 @@
name: dependencies-meta
buildsystem: simple
build-commands:
- true
modules:
- name: bzip2-redirect
buildsystem: simple
build-commands:
- install -Dm644 libbzip2.so /app/lib/libbzip2.so
sources:
- type: inline
contents: INPUT(libbz2.so)
dest-filename: libbzip2.so
- name: blueprint-compiler
buildsystem: meson
cleanup:
- "*"
sources:
- type: git
url: https://gitlab.gnome.org/jwestman/blueprint-compiler.git
tag: v0.16.0
commit: 04ef0944db56ab01307a29aaa7303df6067cb3c0
x-checker-data:
type: git
tag-pattern: ^v([\d.]+)$
- name: gtk4-layer-shell
buildsystem: meson
sources:
# no x-checker-data since this should be synchronized with Nix
#
# TODO: Automate this with check-zig-cache.sh
- type: archive
url: https://github.com/wmww/gtk4-layer-shell/archive/refs/tags/v1.1.0.tar.gz
sha256: 98284281260a5eef5b4f63a55f16c4bf6a788a1020a6db037ecb0f71fa336988
- name: pandoc
buildsystem: simple
cleanup:
- "*"
build-commands:
- install -Dm755 bin/pandoc /app/bin/pandoc
sources:
- type: archive
sha256: d04c95c138202f87d6b00ac19aa3dd874c681f60a9feb3b55c74f764d6d1a17d
url: https://github.com/jgm/pandoc/releases/download/3.6.3/pandoc-3.6.3-linux-amd64.tar.gz
only-arches: [x86_64]
x-checker-data:
type: json
url: https://api.github.com/repos/jgm/pandoc/releases/latest
url-query:
.assets[] | select(.name=="pandoc-" + $version + "-linux-amd64.tar.gz")
| .browser_download_url
version-query: .tag_name
- type: archive
sha256: 4e774cb1bdb6e56bc55b8eb79200bd9aa6a39905a04ecda7267f5149116f0881
url: https://github.com/jgm/pandoc/releases/download/3.6.3/pandoc-3.6.3-linux-arm64.tar.gz
only-arches: [aarch64]
x-checker-data:
type: json
url: https://api.github.com/repos/jgm/pandoc/releases/latest
url-query:
.assets[] | select(.name=="pandoc-" + $version + "-linux-arm64.tar.gz")
| .browser_download_url
version-query: .tag_name

3
flatpak/exceptions.json Normal file
View File

@ -0,0 +1,3 @@
{
"com.mitchellh.ghostty": ["finish-args-flatpak-spawn-access"]
}

206
flatpak/zig-packages.json Normal file
View File

@ -0,0 +1,206 @@
[
{
"type": "archive",
"url": "https://deps.files.ghostty.org/breakpad-b99f444ba5f6b98cac261cbb391d8766b34a5918.tar.gz",
"dest": "vendor/p/N-V-__8AALw2uwF_03u4JRkZwRLc3Y9hakkYV7NKRR9-RIZJ",
"sha256": "6cca98943d1a990766cef61077c09aff5938063fe17a1efe1228e5412b6d6ad9"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/fontconfig-2.14.2.tar.gz",
"dest": "vendor/p/N-V-__8AAIrfdwARSa-zMmxWwFuwpXf1T3asIN7s5jqi9c1v",
"sha256": "3ba2dd92158718acec5caaf1a716043b5aa055c27b081d914af3ccb40dce8a55"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/freetype-1220b81f6ecfb3fd222f76cf9106fecfa6554ab07ec7fdc4124b9bb063ae2adf969d.tar.gz",
"dest": "vendor/p/N-V-__8AAKLKpwC4H27Ps_0iL3bPkQb-z6ZVSrB-x_3EEkub",
"sha256": "427201f5d5151670d05c1f5b45bef5dda1f2e7dd971ef54f0feaaa7ffd2ab90c"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/gettext-0.24.tar.gz",
"dest": "vendor/p/N-V-__8AADcZkgn4cMhTUpIz6mShCKyqqB-NBtf_S2bHaTC-",
"sha256": "c918503d593d70daf4844d175a13d816afacb667c06fba1ec9dcd5002c1518b7"
},
{
"type": "archive",
"url": "https://github.com/glfw/glfw/archive/e7ea71be039836da3a98cea55ae5569cb5eb885c.tar.gz",
"dest": "vendor/p/N-V-__8AAMrJSwAUGb9-vTzkNR-5LXS81MR__ZRVfF3tWgG6",
"sha256": "3373755d402531e6c1a395f53f2fbd6318ca5e067a79a72a59109b526c0b290a"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/glslang-12201278a1a05c0ce0b6eb6026c65cd3e9247aa041b1c260324bf29cee559dd23ba1.tar.gz",
"dest": "vendor/p/N-V-__8AABzkUgISeKGgXAzgtutgJsZc0-kkeqBBscJgMkvy",
"sha256": "14a2edbb509cb3e51a9a53e3f5e435dbf5971604b4b833e63e6076e8c0a997b5"
},
{
"type": "archive",
"url": "https://github.com/jcollie/ghostty-gobject/releases/download/0.14.0-2025-03-18-21-1/ghostty-gobject-0.14.0-2025-03-18-21-1.tar.zst",
"dest": "vendor/p/gobject-0.2.0-Skun7IWDlQAOKu4BV7LapIxL9Imbq1JRmzvcIkazvAxR",
"sha256": "85672997459ddd7c9d4fe458efe548a315cf842cde95ed48a7be984a1f8a98b2"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/gtk4-layer-shell-1.1.0.tar.gz",
"dest": "vendor/p/N-V-__8AALiNBAA-_0gprYr92CjrMj1I5bqNu0TSJOnjFNSr",
"sha256": "98284281260a5eef5b4f63a55f16c4bf6a788a1020a6db037ecb0f71fa336988"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/harfbuzz-11.0.0.tar.xz",
"dest": "vendor/p/N-V-__8AAG02ugUcWec-Ndp-i7JTsJ0dgF8nnJRUInkGLG7G",
"sha256": "f16351bafe214725fe2c1d5b59f0d93e49905a4b247899fb90d70cff953a2b9b"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/highway-66486a10623fa0d72fe91260f96c892e41aceb06.tar.gz",
"dest": "vendor/p/N-V-__8AAGmZhABbsPJLfbqrh6JTHsXhY6qCaLAQyx25e0XE",
"sha256": "87d4f8893ef4e08f224973608ffebf94268a81380ba79c12e8841968c80aa212"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/imgui-1220bc6b9daceaf7c8c60f3c3998058045ba0c5c5f48ae255ff97776d9cd8bfc6402.tar.gz",
"dest": "vendor/p/N-V-__8AAH0GaQC8a52s6vfIxg88OZgFgEW6DFxfSK4lX_l3",
"sha256": "a05fd01e04cf11ab781e28387c621d2e420f1e6044c8e27a25e603ea99ef7860"
},
{
"type": "archive",
"url": "https://github.com/mbadolato/iTerm2-Color-Schemes/archive/6fa671fdc1daf1fcfa025cb960ffa3e7373a2ed8.tar.gz",
"dest": "vendor/p/N-V-__8AAGHcWgTaKLjwmFkxToNT4jgz5VXUHR7hz8TQ2_AS",
"sha256": "83da3608873f4df598a144bf97f1cfe4a644083eea36c75052516bb9a2a4573e"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/libpng-1220aa013f0c83da3fb64ea6d327f9173fa008d10e28bc9349eac3463457723b1c66.tar.gz",
"dest": "vendor/p/N-V-__8AAJrvXQCqAT8Mg9o_tk6m0yf5Fz-gCNEOKLyTSerD",
"sha256": "fecc95b46cf05e8e3fc8a414750e0ba5aad00d89e9fdf175e94ff041caf1a03a"
},
{
"type": "archive",
"url": "https://github.com/mitchellh/libxev/archive/75a10d0fb374e8eb84948dcfc68d865e755e59c2.tar.gz",
"dest": "vendor/p/libxev-0.0.0-86vtcyMBEwA-UpcjfOICyI2GYG8o6MiRbinS1_8g1_rw",
"sha256": "fc248a4ae6597e7d1a2109556743bc721e4ee2009a8d80534eea1eb51768d27e"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/libxml2-2.11.5.tar.gz",
"dest": "vendor/p/N-V-__8AAG3RoQEyRC2Vw7Qoro5SYBf62IHn3HjqtNVY6aWK",
"sha256": "6c28059e2e3eeb42b5b4b16489e3916a6346c1095a74fee3bc65cdc5d89a6215"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/oniguruma-1220c15e72eadd0d9085a8af134904d9a0f5dfcbed5f606ad60edc60ebeccd9706bb.tar.gz",
"dest": "vendor/p/N-V-__8AAHjwMQDBXnLq3Q2QhaivE0kE2aD138vtX2Bq1g7c",
"sha256": "001aa1202e78448f4c0bf1a48c76e556876b36f16d92ce3207eccfd61d99f2a0"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/pixels-12207ff340169c7d40c570b4b6a97db614fe47e0d83b5801a932dcd44917424c8806.tar.gz",
"dest": "vendor/p/N-V-__8AADYiAAB_80AWnH1AxXC0tql9thT-R-DYO1gBqTLc",
"sha256": "55e83b16d091082502bf149bf457f31f42092c5982650e3ffbae7b48871bf11a"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/plasma_wayland_protocols-12207e0851c12acdeee0991e893e0132fc87bb763969a585dc16ecca33e88334c566.tar.gz",
"dest": "vendor/p/N-V-__8AAKYZBAB-CFHBKs3u4JkeiT4BMvyHu3Y5aaWF3Bbs",
"sha256": "5c58ba214acd8e6bca3426dc08b022c46a8dd997b29a1b3e28badf71c20df441"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/sentry-1220446be831adcca918167647c06c7b825849fa3fba5f22da394667974537a9c77e.tar.gz",
"dest": "vendor/p/N-V-__8AAPlZGwBEa-gxrcypGBZ2R8Bse4JYSfo_ul8i2jlG",
"sha256": "2ac6497cc8d61a8d31093e47addb8c9b2c45b16b0705bb334a835b6423c318df"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/spirv_cross-1220fb3b5586e8be67bc3feb34cbe749cf42a60d628d2953632c2f8141302748c8da.tar.gz",
"dest": "vendor/p/N-V-__8AANb6pwD7O1WG6L5nvD_rNMvnSc9Cpg1ijSlTYywv",
"sha256": "b52b6fcfc45e7fa69b1f06a1362c155473444e2cc09995556b156c53ba6657e3"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/utfcpp-1220d4d18426ca72fc2b7e56ce47273149815501d0d2395c2a98c726b31ba931e641.tar.gz",
"dest": "vendor/p/N-V-__8AAHffAgDU0YQmynL8K35WzkcnMUmBVQHQ0jlcKpjH",
"sha256": "ffc668a310e77607d393f3c18b32715f223da1eac4c4d6e0579a11df8e6b59cf"
},
{
"type": "git",
"url": "https://github.com/rockorager/libvaxis",
"commit": "1f41c121e8fc153d9ce8c6eb64b2bbab68ad7d23",
"dest": "vendor/p/vaxis-0.1.0-BWNV_FUICQAFZnTCL11TUvnUr1Y0_ZdqtXHhd51d76Rn"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/wayland-9cb3d7aa9dc995ffafdbdef7ab86a949d0fb0e7d.tar.gz",
"dest": "vendor/p/N-V-__8AAKrHGAAs2shYq8UkE6bGcR1QJtLTyOE_lcosMn6t",
"sha256": "ea4191d68e437677e51f3aacde27829810144e931d397a327dc6035e2c39c50d"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/wayland-protocols-258d8f88f2c8c25a830c6316f87d23ce1a0f12d9.tar.gz",
"dest": "vendor/p/N-V-__8AAKw-DAAaV8bOAAGqA0-oD7o-HNIlPFYKRXSPT03S",
"sha256": "5cedcadde81b75e60f23e5e83b5dd2b8eb4efb9f8f79bd7a347d148aeb0530f8"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/wuffs-122037b39d577ec2db3fd7b2130e7b69ef6cc1807d68607a7c232c958315d381b5cd.tar.gz",
"dest": "vendor/p/N-V-__8AAAzZywE3s51XfsLbP9eyEw57ae9swYB9aGB6fCMs",
"sha256": "9e4cd20abe96e6c4c6ede9c3057108860126e7be2e2c3e35515476c250be1c13"
},
{
"type": "archive",
"url": "https://github.com/vancluever/z2d/archive/8bbd035f4101f02b1d27947def0d7da3215df7fe.tar.gz",
"dest": "vendor/p/z2d-0.7.0-j5P_Hg_DDACq-2H2Zh7rAq6_TXWdQzv7JAUfnrdeDosg",
"sha256": "c1f69d7a07a2c5c6e0c51cd1b5fe8cd87df8093baf0ccdb65d5221bae7c5046e"
},
{
"type": "archive",
"url": "https://github.com/natecraddock/zf/archive/7aacbe6d155d64d15937ca95ca6c014905eb531f.tar.gz",
"dest": "vendor/p/zf-0.10.3-OIRy8aiIAACLrBllz0zjxaH0aOe5oNm3KtEMyCntST-9",
"sha256": "de7ba535077fe2b678a5a7972585f002588d37244db08397feadf3d4907c0bb2"
},
{
"type": "git",
"url": "https://codeberg.org/atman/zg",
"commit": "4a002763419a34d61dcbb1f415821b83b9bf8ddc",
"dest": "vendor/p/zg-0.13.4-AAAAAGiZ7QLz4pvECFa_wG4O4TP4FLABHHbemH2KakWM"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/zig_js-12205a66d423259567764fa0fc60c82be35365c21aeb76c5a7dc99698401f4f6fefc.tar.gz",
"dest": "vendor/p/N-V-__8AAB9YCQBaZtQjJZVndk-g_GDIK-NTZcIa63bFp9yZ",
"sha256": "7f235e0956c2f5401a28963a261019953d00e3bf4cfc029830f2161196c3583d"
},
{
"type": "archive",
"url": "https://github.com/mitchellh/zig-objc/archive/3ab0d37c7d6b933d6ded1b3a35b6b60f05590a98.tar.gz",
"dest": "vendor/p/zig_objc-0.0.0-Ir_Sp3TyAADEVRTxXlScq3t_uKAM91MYNerZkHfbD0yt",
"sha256": "ce7d6d47ac614a60e56b8509dedf869e2e0d8b747c75e48aded11eec31b3357c"
},
{
"type": "archive",
"url": "https://codeberg.org/ifreund/zig-wayland/archive/f3c5d503e540ada8cbcb056420de240af0c094f7.tar.gz",
"dest": "vendor/p/wayland-0.4.0-dev-lQa1kjfIAQCmhhQu3xF0KH-94-TzeMXOqfnP0-Dg6Wyy",
"sha256": "13bec6675e403d86db3b55b39ae262f1e1bdfe24056dcd82824341c6308b5219"
},
{
"type": "git",
"url": "https://github.com/TUSF/zigimg",
"commit": "31268548fe3276c0e95f318a6c0d2ab10565b58d",
"dest": "vendor/p/zigimg-0.1.0-lly-O6N2EABOxke8dqyzCwhtUCAafqP35zC7wsZ4Ddxj"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/ziglyph-b89d43d1e3fb01b6074bc1f7fc980324b04d26a5.tar.gz",
"dest": "vendor/p/ziglyph-0.11.2-AAAAAHPtHwB4Mbzn1KvOV7Wpjo82NYEc_v0WC8oCLrkf",
"sha256": "72c7bdf3e16df105235fe3fcf32c987dac49389190f4ced89b0ee31710f3f3d9"
},
{
"type": "archive",
"url": "https://deps.files.ghostty.org/zlib-1220fed0c74e1019b3ee29edae2051788b080cd96e90d56836eea857b0b966742efb.tar.gz",
"dest": "vendor/p/N-V-__8AAB0eQwD-0MdOEBmz7intriBReIsIDNlukNVoNu6o",
"sha256": "17e88863f3600672ab49182f217281b6fc4d3c762bde361935e436a95214d05c"
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 426 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -0,0 +1,170 @@
{
"color-space-for-untagged-svg-colors" : "display-p3",
"fill" : {
"linear-gradient" : [
"display-p3:0.87945,0.87945,0.87945,1.00000",
"display-p3:0.40000,0.40000,0.40392,1.00000"
]
},
"groups" : [
{
"blend-mode" : "normal",
"layers" : [
{
"blend-mode" : "overlay",
"fill" : {
"linear-gradient" : [
"srgb:1.00000,1.00000,1.00000,1.00000",
"srgb:0.00000,0.00000,0.00000,1.00000"
]
},
"hidden" : false,
"image-name" : "gloss.png",
"name" : "GlossTop",
"opacity" : 0.25,
"position" : {
"scale" : 0.98,
"translation-in-points" : [
0.90625,
-236.4609375
]
}
},
{
"blend-mode" : "normal",
"fill" : "automatic",
"hidden" : false,
"image-name" : "gloss.png",
"name" : "gloss",
"position" : {
"scale" : 0.98,
"translation-in-points" : [
0.90625,
-236.4609375
]
}
}
],
"lighting" : "individual",
"name" : "Group 4",
"shadow" : {
"kind" : "neutral",
"opacity" : 0.5
},
"translucency" : {
"enabled" : true,
"value" : 0.5
}
},
{
"blend-mode" : "overlay",
"layers" : [
{
"blend-mode" : "overlay",
"fill" : "automatic",
"glass" : false,
"hidden" : false,
"image-name" : "Screen Effects.png",
"name" : "Screen Effects"
},
{
"blend-mode" : "overlay",
"fill" : "automatic",
"glass" : true,
"hidden" : false,
"image-name" : "Screen Effects.png",
"name" : "Screen Effects"
}
],
"lighting" : "individual",
"name" : "Group 3",
"shadow" : {
"kind" : "neutral",
"opacity" : 0.5
},
"translucency" : {
"enabled" : false,
"value" : 0.5
}
},
{
"blur-material" : null,
"layers" : [
{
"blend-mode" : "normal",
"fill" : "automatic",
"hidden" : false,
"image-name" : "Ghostty.png",
"name" : "Ghostty",
"position" : {
"scale" : 1,
"translation-in-points" : [
-185.015625,
-143.8359375
]
}
},
{
"blend-mode" : "normal",
"fill" : {
"solid" : "extended-srgb:0.00000,0.47843,1.00000,1.00000"
},
"glass" : true,
"hidden" : false,
"image-name" : "Ghostty.png",
"name" : "GhosttyBlur",
"position" : {
"scale" : 1,
"translation-in-points" : [
-186.59375,
-143.8359375
]
}
},
{
"hidden" : false,
"image-name" : "Screen.png",
"name" : "Screen"
}
],
"lighting" : "individual",
"name" : "Group 2",
"shadow" : {
"kind" : "neutral",
"opacity" : 0.5
},
"translucency" : {
"enabled" : false,
"value" : 0.5
}
},
{
"blend-mode" : "normal",
"blur-material" : null,
"hidden" : false,
"layers" : [
{
"image-name" : "Inner Bevel 6px.png",
"name" : "Inner Bevel 6px"
}
],
"lighting" : "individual",
"name" : "Group 1",
"shadow" : {
"kind" : "layer-color",
"opacity" : 0.2
},
"specular" : false,
"translucency" : {
"enabled" : false,
"value" : 0.5
}
}
],
"supported-platforms" : {
"circles" : [
"watchOS"
],
"squares" : "shared"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

After

Width:  |  Height:  |  Size: 652 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 KiB

View File

@ -103,10 +103,30 @@ typedef enum {
GHOSTTY_ACTION_REPEAT, GHOSTTY_ACTION_REPEAT,
} ghostty_input_action_e; } ghostty_input_action_e;
// Based on: https://www.w3.org/TR/uievents-code/
typedef enum { typedef enum {
GHOSTTY_KEY_INVALID, GHOSTTY_KEY_UNIDENTIFIED,
// a-z // "Writing System Keys" § 3.1.1
GHOSTTY_KEY_BACKQUOTE,
GHOSTTY_KEY_BACKSLASH,
GHOSTTY_KEY_BRACKET_LEFT,
GHOSTTY_KEY_BRACKET_RIGHT,
GHOSTTY_KEY_COMMA,
GHOSTTY_KEY_DIGIT_0,
GHOSTTY_KEY_DIGIT_1,
GHOSTTY_KEY_DIGIT_2,
GHOSTTY_KEY_DIGIT_3,
GHOSTTY_KEY_DIGIT_4,
GHOSTTY_KEY_DIGIT_5,
GHOSTTY_KEY_DIGIT_6,
GHOSTTY_KEY_DIGIT_7,
GHOSTTY_KEY_DIGIT_8,
GHOSTTY_KEY_DIGIT_9,
GHOSTTY_KEY_EQUAL,
GHOSTTY_KEY_INTL_BACKSLASH,
GHOSTTY_KEY_INTL_RO,
GHOSTTY_KEY_INTL_YEN,
GHOSTTY_KEY_A, GHOSTTY_KEY_A,
GHOSTTY_KEY_B, GHOSTTY_KEY_B,
GHOSTTY_KEY_C, GHOSTTY_KEY_C,
@ -133,56 +153,91 @@ typedef enum {
GHOSTTY_KEY_X, GHOSTTY_KEY_X,
GHOSTTY_KEY_Y, GHOSTTY_KEY_Y,
GHOSTTY_KEY_Z, GHOSTTY_KEY_Z,
// numbers
GHOSTTY_KEY_ZERO,
GHOSTTY_KEY_ONE,
GHOSTTY_KEY_TWO,
GHOSTTY_KEY_THREE,
GHOSTTY_KEY_FOUR,
GHOSTTY_KEY_FIVE,
GHOSTTY_KEY_SIX,
GHOSTTY_KEY_SEVEN,
GHOSTTY_KEY_EIGHT,
GHOSTTY_KEY_NINE,
// puncuation
GHOSTTY_KEY_SEMICOLON,
GHOSTTY_KEY_SPACE,
GHOSTTY_KEY_APOSTROPHE,
GHOSTTY_KEY_COMMA,
GHOSTTY_KEY_GRAVE_ACCENT, // `
GHOSTTY_KEY_PERIOD,
GHOSTTY_KEY_SLASH,
GHOSTTY_KEY_MINUS, GHOSTTY_KEY_MINUS,
GHOSTTY_KEY_PLUS, GHOSTTY_KEY_PERIOD,
GHOSTTY_KEY_EQUAL, GHOSTTY_KEY_QUOTE,
GHOSTTY_KEY_LEFT_BRACKET, // [ GHOSTTY_KEY_SEMICOLON,
GHOSTTY_KEY_RIGHT_BRACKET, // ] GHOSTTY_KEY_SLASH,
GHOSTTY_KEY_BACKSLASH, // \
// control // "Functional Keys" § 3.1.2
GHOSTTY_KEY_UP, GHOSTTY_KEY_ALT_LEFT,
GHOSTTY_KEY_DOWN, GHOSTTY_KEY_ALT_RIGHT,
GHOSTTY_KEY_RIGHT,
GHOSTTY_KEY_LEFT,
GHOSTTY_KEY_HOME,
GHOSTTY_KEY_END,
GHOSTTY_KEY_INSERT,
GHOSTTY_KEY_DELETE,
GHOSTTY_KEY_CAPS_LOCK,
GHOSTTY_KEY_SCROLL_LOCK,
GHOSTTY_KEY_NUM_LOCK,
GHOSTTY_KEY_PAGE_UP,
GHOSTTY_KEY_PAGE_DOWN,
GHOSTTY_KEY_ESCAPE,
GHOSTTY_KEY_ENTER,
GHOSTTY_KEY_TAB,
GHOSTTY_KEY_BACKSPACE, GHOSTTY_KEY_BACKSPACE,
GHOSTTY_KEY_PRINT_SCREEN, GHOSTTY_KEY_CAPS_LOCK,
GHOSTTY_KEY_PAUSE, GHOSTTY_KEY_CONTEXT_MENU,
GHOSTTY_KEY_CONTROL_LEFT,
GHOSTTY_KEY_CONTROL_RIGHT,
GHOSTTY_KEY_ENTER,
GHOSTTY_KEY_META_LEFT,
GHOSTTY_KEY_META_RIGHT,
GHOSTTY_KEY_SHIFT_LEFT,
GHOSTTY_KEY_SHIFT_RIGHT,
GHOSTTY_KEY_SPACE,
GHOSTTY_KEY_TAB,
GHOSTTY_KEY_CONVERT,
GHOSTTY_KEY_KANA_MODE,
GHOSTTY_KEY_NON_CONVERT,
// function keys // "Control Pad Section" § 3.2
GHOSTTY_KEY_DELETE,
GHOSTTY_KEY_END,
GHOSTTY_KEY_HELP,
GHOSTTY_KEY_HOME,
GHOSTTY_KEY_INSERT,
GHOSTTY_KEY_PAGE_DOWN,
GHOSTTY_KEY_PAGE_UP,
// "Arrow Pad Section" § 3.3
GHOSTTY_KEY_ARROW_DOWN,
GHOSTTY_KEY_ARROW_LEFT,
GHOSTTY_KEY_ARROW_RIGHT,
GHOSTTY_KEY_ARROW_UP,
// "Numpad Section" § 3.4
GHOSTTY_KEY_NUM_LOCK,
GHOSTTY_KEY_NUMPAD_0,
GHOSTTY_KEY_NUMPAD_1,
GHOSTTY_KEY_NUMPAD_2,
GHOSTTY_KEY_NUMPAD_3,
GHOSTTY_KEY_NUMPAD_4,
GHOSTTY_KEY_NUMPAD_5,
GHOSTTY_KEY_NUMPAD_6,
GHOSTTY_KEY_NUMPAD_7,
GHOSTTY_KEY_NUMPAD_8,
GHOSTTY_KEY_NUMPAD_9,
GHOSTTY_KEY_NUMPAD_ADD,
GHOSTTY_KEY_NUMPAD_BACKSPACE,
GHOSTTY_KEY_NUMPAD_CLEAR,
GHOSTTY_KEY_NUMPAD_CLEAR_ENTRY,
GHOSTTY_KEY_NUMPAD_COMMA,
GHOSTTY_KEY_NUMPAD_DECIMAL,
GHOSTTY_KEY_NUMPAD_DIVIDE,
GHOSTTY_KEY_NUMPAD_ENTER,
GHOSTTY_KEY_NUMPAD_EQUAL,
GHOSTTY_KEY_NUMPAD_MEMORY_ADD,
GHOSTTY_KEY_NUMPAD_MEMORY_CLEAR,
GHOSTTY_KEY_NUMPAD_MEMORY_RECALL,
GHOSTTY_KEY_NUMPAD_MEMORY_STORE,
GHOSTTY_KEY_NUMPAD_MEMORY_SUBTRACT,
GHOSTTY_KEY_NUMPAD_MULTIPLY,
GHOSTTY_KEY_NUMPAD_PAREN_LEFT,
GHOSTTY_KEY_NUMPAD_PAREN_RIGHT,
GHOSTTY_KEY_NUMPAD_SUBTRACT,
GHOSTTY_KEY_NUMPAD_SEPARATOR,
GHOSTTY_KEY_NUMPAD_UP,
GHOSTTY_KEY_NUMPAD_DOWN,
GHOSTTY_KEY_NUMPAD_RIGHT,
GHOSTTY_KEY_NUMPAD_LEFT,
GHOSTTY_KEY_NUMPAD_BEGIN,
GHOSTTY_KEY_NUMPAD_HOME,
GHOSTTY_KEY_NUMPAD_END,
GHOSTTY_KEY_NUMPAD_INSERT,
GHOSTTY_KEY_NUMPAD_DELETE,
GHOSTTY_KEY_NUMPAD_PAGE_UP,
GHOSTTY_KEY_NUMPAD_PAGE_DOWN,
// "Function Section" § 3.5
GHOSTTY_KEY_ESCAPE,
GHOSTTY_KEY_F1, GHOSTTY_KEY_F1,
GHOSTTY_KEY_F2, GHOSTTY_KEY_F2,
GHOSTTY_KEY_F3, GHOSTTY_KEY_F3,
@ -208,59 +263,53 @@ typedef enum {
GHOSTTY_KEY_F23, GHOSTTY_KEY_F23,
GHOSTTY_KEY_F24, GHOSTTY_KEY_F24,
GHOSTTY_KEY_F25, GHOSTTY_KEY_F25,
GHOSTTY_KEY_FN,
GHOSTTY_KEY_FN_LOCK,
GHOSTTY_KEY_PRINT_SCREEN,
GHOSTTY_KEY_SCROLL_LOCK,
GHOSTTY_KEY_PAUSE,
// keypad // "Media Keys" § 3.6
GHOSTTY_KEY_KP_0, GHOSTTY_KEY_BROWSER_BACK,
GHOSTTY_KEY_KP_1, GHOSTTY_KEY_BROWSER_FAVORITES,
GHOSTTY_KEY_KP_2, GHOSTTY_KEY_BROWSER_FORWARD,
GHOSTTY_KEY_KP_3, GHOSTTY_KEY_BROWSER_HOME,
GHOSTTY_KEY_KP_4, GHOSTTY_KEY_BROWSER_REFRESH,
GHOSTTY_KEY_KP_5, GHOSTTY_KEY_BROWSER_SEARCH,
GHOSTTY_KEY_KP_6, GHOSTTY_KEY_BROWSER_STOP,
GHOSTTY_KEY_KP_7, GHOSTTY_KEY_EJECT,
GHOSTTY_KEY_KP_8, GHOSTTY_KEY_LAUNCH_APP_1,
GHOSTTY_KEY_KP_9, GHOSTTY_KEY_LAUNCH_APP_2,
GHOSTTY_KEY_KP_DECIMAL, GHOSTTY_KEY_LAUNCH_MAIL,
GHOSTTY_KEY_KP_DIVIDE, GHOSTTY_KEY_MEDIA_PLAY_PAUSE,
GHOSTTY_KEY_KP_MULTIPLY, GHOSTTY_KEY_MEDIA_SELECT,
GHOSTTY_KEY_KP_SUBTRACT, GHOSTTY_KEY_MEDIA_STOP,
GHOSTTY_KEY_KP_ADD, GHOSTTY_KEY_MEDIA_TRACK_NEXT,
GHOSTTY_KEY_KP_ENTER, GHOSTTY_KEY_MEDIA_TRACK_PREVIOUS,
GHOSTTY_KEY_KP_EQUAL, GHOSTTY_KEY_POWER,
GHOSTTY_KEY_KP_SEPARATOR, GHOSTTY_KEY_SLEEP,
GHOSTTY_KEY_KP_LEFT, GHOSTTY_KEY_AUDIO_VOLUME_DOWN,
GHOSTTY_KEY_KP_RIGHT, GHOSTTY_KEY_AUDIO_VOLUME_MUTE,
GHOSTTY_KEY_KP_UP, GHOSTTY_KEY_AUDIO_VOLUME_UP,
GHOSTTY_KEY_KP_DOWN, GHOSTTY_KEY_WAKE_UP,
GHOSTTY_KEY_KP_PAGE_UP,
GHOSTTY_KEY_KP_PAGE_DOWN,
GHOSTTY_KEY_KP_HOME,
GHOSTTY_KEY_KP_END,
GHOSTTY_KEY_KP_INSERT,
GHOSTTY_KEY_KP_DELETE,
GHOSTTY_KEY_KP_BEGIN,
// modifiers // "Legacy, Non-standard, and Special Keys" § 3.7
GHOSTTY_KEY_LEFT_SHIFT, GHOSTTY_KEY_COPY,
GHOSTTY_KEY_LEFT_CONTROL, GHOSTTY_KEY_CUT,
GHOSTTY_KEY_LEFT_ALT, GHOSTTY_KEY_PASTE,
GHOSTTY_KEY_LEFT_SUPER,
GHOSTTY_KEY_RIGHT_SHIFT,
GHOSTTY_KEY_RIGHT_CONTROL,
GHOSTTY_KEY_RIGHT_ALT,
GHOSTTY_KEY_RIGHT_SUPER,
} ghostty_input_key_e; } ghostty_input_key_e;
typedef struct { typedef struct {
ghostty_input_action_e action; ghostty_input_action_e action;
ghostty_input_mods_e mods; ghostty_input_mods_e mods;
ghostty_input_mods_e consumed_mods;
uint32_t keycode; uint32_t keycode;
const char* text; const char* text;
uint32_t unshifted_codepoint;
bool composing; bool composing;
} ghostty_input_key_s; } ghostty_input_key_s;
typedef enum { typedef enum {
GHOSTTY_TRIGGER_TRANSLATED,
GHOSTTY_TRIGGER_PHYSICAL, GHOSTTY_TRIGGER_PHYSICAL,
GHOSTTY_TRIGGER_UNICODE, GHOSTTY_TRIGGER_UNICODE,
} ghostty_input_trigger_tag_e; } ghostty_input_trigger_tag_e;
@ -277,6 +326,13 @@ typedef struct {
ghostty_input_mods_e mods; ghostty_input_mods_e mods;
} ghostty_input_trigger_s; } ghostty_input_trigger_s;
typedef struct {
const char* action_key;
const char* action;
const char* title;
const char* description;
} ghostty_command_s;
typedef enum { typedef enum {
GHOSTTY_BUILD_MODE_DEBUG, GHOSTTY_BUILD_MODE_DEBUG,
GHOSTTY_BUILD_MODE_RELEASE_SAFE, GHOSTTY_BUILD_MODE_RELEASE_SAFE,
@ -299,8 +355,41 @@ typedef struct {
double tl_px_y; double tl_px_y;
uint32_t offset_start; uint32_t offset_start;
uint32_t offset_len; uint32_t offset_len;
const char* text;
uintptr_t text_len;
} ghostty_text_s;
typedef enum {
GHOSTTY_POINT_ACTIVE,
GHOSTTY_POINT_VIEWPORT,
GHOSTTY_POINT_SCREEN,
GHOSTTY_POINT_SURFACE,
} ghostty_point_tag_e;
typedef enum {
GHOSTTY_POINT_COORD_EXACT,
GHOSTTY_POINT_COORD_TOP_LEFT,
GHOSTTY_POINT_COORD_BOTTOM_RIGHT,
} ghostty_point_coord_e;
typedef struct {
ghostty_point_tag_e tag;
ghostty_point_coord_e coord;
uint32_t x;
uint32_t y;
} ghostty_point_s;
typedef struct {
ghostty_point_s top_left;
ghostty_point_s bottom_right;
bool rectangle;
} ghostty_selection_s; } ghostty_selection_s;
typedef struct {
const char* key;
const char* value;
} ghostty_env_var_s;
typedef struct { typedef struct {
void* nsview; void* nsview;
} ghostty_platform_macos_s; } ghostty_platform_macos_s;
@ -322,6 +411,9 @@ typedef struct {
float font_size; float font_size;
const char* working_directory; const char* working_directory;
const char* command; const char* command;
ghostty_env_var_s* env_vars;
size_t env_var_count;
const char* initial_input;
} ghostty_surface_config_s; } ghostty_surface_config_s;
typedef struct { typedef struct {
@ -348,6 +440,11 @@ typedef struct {
size_t len; size_t len;
} ghostty_config_color_list_s; } ghostty_config_color_list_s;
// config.Palette
typedef struct {
ghostty_config_color_s colors[256];
} ghostty_config_palette_s;
// apprt.Target.Key // apprt.Target.Key
typedef enum { typedef enum {
GHOSTTY_TARGET_APP, GHOSTTY_TARGET_APP,
@ -412,8 +509,16 @@ typedef enum {
GHOSTTY_FULLSCREEN_NATIVE, GHOSTTY_FULLSCREEN_NATIVE,
GHOSTTY_FULLSCREEN_NON_NATIVE, GHOSTTY_FULLSCREEN_NON_NATIVE,
GHOSTTY_FULLSCREEN_NON_NATIVE_VISIBLE_MENU, GHOSTTY_FULLSCREEN_NON_NATIVE_VISIBLE_MENU,
GHOSTTY_FULLSCREEN_NON_NATIVE_PADDED_NOTCH,
} ghostty_action_fullscreen_e; } ghostty_action_fullscreen_e;
// apprt.action.FloatWindow
typedef enum {
GHOSTTY_FLOAT_WINDOW_ON,
GHOSTTY_FLOAT_WINDOW_OFF,
GHOSTTY_FLOAT_WINDOW_TOGGLE,
} ghostty_action_float_window_e;
// apprt.action.SecureInput // apprt.action.SecureInput
typedef enum { typedef enum {
GHOSTTY_SECURE_INPUT_ON, GHOSTTY_SECURE_INPUT_ON,
@ -570,6 +675,7 @@ typedef enum {
GHOSTTY_ACTION_TOGGLE_TAB_OVERVIEW, GHOSTTY_ACTION_TOGGLE_TAB_OVERVIEW,
GHOSTTY_ACTION_TOGGLE_WINDOW_DECORATIONS, GHOSTTY_ACTION_TOGGLE_WINDOW_DECORATIONS,
GHOSTTY_ACTION_TOGGLE_QUICK_TERMINAL, GHOSTTY_ACTION_TOGGLE_QUICK_TERMINAL,
GHOSTTY_ACTION_TOGGLE_COMMAND_PALETTE,
GHOSTTY_ACTION_TOGGLE_VISIBILITY, GHOSTTY_ACTION_TOGGLE_VISIBILITY,
GHOSTTY_ACTION_MOVE_TAB, GHOSTTY_ACTION_MOVE_TAB,
GHOSTTY_ACTION_GOTO_TAB, GHOSTTY_ACTION_GOTO_TAB,
@ -579,12 +685,15 @@ typedef enum {
GHOSTTY_ACTION_TOGGLE_SPLIT_ZOOM, GHOSTTY_ACTION_TOGGLE_SPLIT_ZOOM,
GHOSTTY_ACTION_PRESENT_TERMINAL, GHOSTTY_ACTION_PRESENT_TERMINAL,
GHOSTTY_ACTION_SIZE_LIMIT, GHOSTTY_ACTION_SIZE_LIMIT,
GHOSTTY_ACTION_RESET_WINDOW_SIZE,
GHOSTTY_ACTION_INITIAL_SIZE, GHOSTTY_ACTION_INITIAL_SIZE,
GHOSTTY_ACTION_CELL_SIZE, GHOSTTY_ACTION_CELL_SIZE,
GHOSTTY_ACTION_INSPECTOR, GHOSTTY_ACTION_INSPECTOR,
GHOSTTY_ACTION_SHOW_GTK_INSPECTOR,
GHOSTTY_ACTION_RENDER_INSPECTOR, GHOSTTY_ACTION_RENDER_INSPECTOR,
GHOSTTY_ACTION_DESKTOP_NOTIFICATION, GHOSTTY_ACTION_DESKTOP_NOTIFICATION,
GHOSTTY_ACTION_SET_TITLE, GHOSTTY_ACTION_SET_TITLE,
GHOSTTY_ACTION_PROMPT_TITLE,
GHOSTTY_ACTION_PWD, GHOSTTY_ACTION_PWD,
GHOSTTY_ACTION_MOUSE_SHAPE, GHOSTTY_ACTION_MOUSE_SHAPE,
GHOSTTY_ACTION_MOUSE_VISIBILITY, GHOSTTY_ACTION_MOUSE_VISIBILITY,
@ -592,11 +701,17 @@ typedef enum {
GHOSTTY_ACTION_RENDERER_HEALTH, GHOSTTY_ACTION_RENDERER_HEALTH,
GHOSTTY_ACTION_OPEN_CONFIG, GHOSTTY_ACTION_OPEN_CONFIG,
GHOSTTY_ACTION_QUIT_TIMER, GHOSTTY_ACTION_QUIT_TIMER,
GHOSTTY_ACTION_FLOAT_WINDOW,
GHOSTTY_ACTION_SECURE_INPUT, GHOSTTY_ACTION_SECURE_INPUT,
GHOSTTY_ACTION_KEY_SEQUENCE, GHOSTTY_ACTION_KEY_SEQUENCE,
GHOSTTY_ACTION_COLOR_CHANGE, GHOSTTY_ACTION_COLOR_CHANGE,
GHOSTTY_ACTION_RELOAD_CONFIG, GHOSTTY_ACTION_RELOAD_CONFIG,
GHOSTTY_ACTION_CONFIG_CHANGE, GHOSTTY_ACTION_CONFIG_CHANGE,
GHOSTTY_ACTION_CLOSE_WINDOW,
GHOSTTY_ACTION_RING_BELL,
GHOSTTY_ACTION_UNDO,
GHOSTTY_ACTION_REDO,
GHOSTTY_ACTION_CHECK_FOR_UPDATES
} ghostty_action_tag_e; } ghostty_action_tag_e;
typedef union { typedef union {
@ -618,6 +733,7 @@ typedef union {
ghostty_action_mouse_over_link_s mouse_over_link; ghostty_action_mouse_over_link_s mouse_over_link;
ghostty_action_renderer_health_e renderer_health; ghostty_action_renderer_health_e renderer_health;
ghostty_action_quit_timer_e quit_timer; ghostty_action_quit_timer_e quit_timer;
ghostty_action_float_window_e float_window;
ghostty_action_secure_input_e secure_input; ghostty_action_secure_input_e secure_input;
ghostty_action_key_sequence_s key_sequence; ghostty_action_key_sequence_s key_sequence;
ghostty_action_color_change_s color_change; ghostty_action_color_change_s color_change;
@ -665,6 +781,7 @@ typedef struct {
int ghostty_init(void); int ghostty_init(void);
void ghostty_cli_main(uintptr_t, char**); void ghostty_cli_main(uintptr_t, char**);
ghostty_info_s ghostty_info(void); ghostty_info_s ghostty_info(void);
const char* ghostty_translate(const char*);
ghostty_config_t ghostty_config_new(); ghostty_config_t ghostty_config_new();
void ghostty_config_free(ghostty_config_t); void ghostty_config_free(ghostty_config_t);
@ -698,13 +815,15 @@ void ghostty_app_set_color_scheme(ghostty_app_t, ghostty_color_scheme_e);
ghostty_surface_config_s ghostty_surface_config_new(); ghostty_surface_config_s ghostty_surface_config_new();
ghostty_surface_t ghostty_surface_new(ghostty_app_t, ghostty_surface_config_s*); ghostty_surface_t ghostty_surface_new(ghostty_app_t,
const ghostty_surface_config_s*);
void ghostty_surface_free(ghostty_surface_t); void ghostty_surface_free(ghostty_surface_t);
void* ghostty_surface_userdata(ghostty_surface_t); void* ghostty_surface_userdata(ghostty_surface_t);
ghostty_app_t ghostty_surface_app(ghostty_surface_t); ghostty_app_t ghostty_surface_app(ghostty_surface_t);
ghostty_surface_config_s ghostty_surface_inherited_config(ghostty_surface_t); ghostty_surface_config_s ghostty_surface_inherited_config(ghostty_surface_t);
void ghostty_surface_update_config(ghostty_surface_t, ghostty_config_t); void ghostty_surface_update_config(ghostty_surface_t, ghostty_config_t);
bool ghostty_surface_needs_confirm_quit(ghostty_surface_t); bool ghostty_surface_needs_confirm_quit(ghostty_surface_t);
bool ghostty_surface_process_exited(ghostty_surface_t);
void ghostty_surface_refresh(ghostty_surface_t); void ghostty_surface_refresh(ghostty_surface_t);
void ghostty_surface_draw(ghostty_surface_t); void ghostty_surface_draw(ghostty_surface_t);
void ghostty_surface_set_content_scale(ghostty_surface_t, double, double); void ghostty_surface_set_content_scale(ghostty_surface_t, double, double);
@ -716,9 +835,11 @@ void ghostty_surface_set_color_scheme(ghostty_surface_t,
ghostty_color_scheme_e); ghostty_color_scheme_e);
ghostty_input_mods_e ghostty_surface_key_translation_mods(ghostty_surface_t, ghostty_input_mods_e ghostty_surface_key_translation_mods(ghostty_surface_t,
ghostty_input_mods_e); ghostty_input_mods_e);
void ghostty_surface_commands(ghostty_surface_t, ghostty_command_s**, size_t*);
bool ghostty_surface_key(ghostty_surface_t, ghostty_input_key_s); bool ghostty_surface_key(ghostty_surface_t, ghostty_input_key_s);
bool ghostty_surface_key_is_binding(ghostty_surface_t, ghostty_input_key_s); bool ghostty_surface_key_is_binding(ghostty_surface_t, ghostty_input_key_s);
void ghostty_surface_text(ghostty_surface_t, const char*, uintptr_t); void ghostty_surface_text(ghostty_surface_t, const char*, uintptr_t);
void ghostty_surface_preedit(ghostty_surface_t, const char*, uintptr_t);
bool ghostty_surface_mouse_captured(ghostty_surface_t); bool ghostty_surface_mouse_captured(ghostty_surface_t);
bool ghostty_surface_mouse_button(ghostty_surface_t, bool ghostty_surface_mouse_button(ghostty_surface_t,
ghostty_input_mouse_state_e, ghostty_input_mouse_state_e,
@ -748,16 +869,16 @@ void ghostty_surface_complete_clipboard_request(ghostty_surface_t,
void*, void*,
bool); bool);
bool ghostty_surface_has_selection(ghostty_surface_t); bool ghostty_surface_has_selection(ghostty_surface_t);
uintptr_t ghostty_surface_selection(ghostty_surface_t, char*, uintptr_t); bool ghostty_surface_read_selection(ghostty_surface_t, ghostty_text_s*);
bool ghostty_surface_read_text(ghostty_surface_t,
ghostty_selection_s,
ghostty_text_s*);
void ghostty_surface_free_text(ghostty_surface_t, ghostty_text_s*);
#ifdef __APPLE__ #ifdef __APPLE__
void ghostty_surface_set_display_id(ghostty_surface_t, uint32_t); void ghostty_surface_set_display_id(ghostty_surface_t, uint32_t);
void* ghostty_surface_quicklook_font(ghostty_surface_t); void* ghostty_surface_quicklook_font(ghostty_surface_t);
uintptr_t ghostty_surface_quicklook_word(ghostty_surface_t, bool ghostty_surface_quicklook_word(ghostty_surface_t, ghostty_text_s*);
char*,
uintptr_t,
ghostty_selection_s*);
bool ghostty_surface_selection_info(ghostty_surface_t, ghostty_selection_s*);
#endif #endif
ghostty_inspector_t ghostty_surface_inspector(ghostty_surface_t); ghostty_inspector_t ghostty_surface_inspector(ghostty_surface_t);

View File

@ -1,74 +0,0 @@
{
"images" : [
{
"filename" : "macOS-AppIcon-1024px.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"filename" : "macOS-AppIcon-16px-16pt@1x.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "16x16"
},
{
"filename" : "macOS-AppIcon-32px-16pt@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "16x16"
},
{
"filename" : "macOS-AppIcon-32px-32pt@1x.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "32x32"
},
{
"filename" : "macOS-AppIcon-64px-32pt@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "32x32"
},
{
"filename" : "macOS-AppIcon-128px-128pt@1x.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "128x128"
},
{
"filename" : "macOS-AppIcon-256px-128pt@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "128x128"
},
{
"filename" : "macOS-AppIcon-256px-128pt@2x 1.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "256x256"
},
{
"filename" : "macOS-AppIcon-512px-256pt@2x.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "256x256"
},
{
"filename" : "macOS-AppIcon-512px.png",
"idiom" : "mac",
"scale" : "1x",
"size" : "512x512"
},
{
"filename" : "macOS-AppIcon-1024px 1.png",
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@ -12,10 +12,18 @@
552964E62B34A9B400030505 /* vim in Resources */ = {isa = PBXBuildFile; fileRef = 552964E52B34A9B400030505 /* vim */; }; 552964E62B34A9B400030505 /* vim in Resources */ = {isa = PBXBuildFile; fileRef = 552964E52B34A9B400030505 /* vim */; };
857F63812A5E64F200CA4815 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 857F63802A5E64F200CA4815 /* MainMenu.xib */; }; 857F63812A5E64F200CA4815 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 857F63802A5E64F200CA4815 /* MainMenu.xib */; };
9351BE8E3D22937F003B3499 /* nvim in Resources */ = {isa = PBXBuildFile; fileRef = 9351BE8E2D22937F003B3499 /* nvim */; }; 9351BE8E3D22937F003B3499 /* nvim in Resources */ = {isa = PBXBuildFile; fileRef = 9351BE8E2D22937F003B3499 /* nvim */; };
A50297352DFA0F3400B4E924 /* Double+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50297342DFA0F3300B4E924 /* Double+Extension.swift */; };
A511940F2E050595007258CC /* CloseTerminalIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A511940E2E050590007258CC /* CloseTerminalIntent.swift */; };
A51194112E05A483007258CC /* QuickTerminalIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51194102E05A480007258CC /* QuickTerminalIntent.swift */; };
A51194132E05D006007258CC /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51194122E05D003007258CC /* Optional+Extension.swift */; };
A51194172E05D964007258CC /* PermissionRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51194162E05D95E007258CC /* PermissionRequest.swift */; };
A51194192E05DFC4007258CC /* IntentPermission.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51194182E05DFBB007258CC /* IntentPermission.swift */; };
A514C8D62B54A16400493A16 /* Ghostty.Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514C8D52B54A16400493A16 /* Ghostty.Config.swift */; }; A514C8D62B54A16400493A16 /* Ghostty.Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514C8D52B54A16400493A16 /* Ghostty.Config.swift */; };
A514C8D72B54A16400493A16 /* Ghostty.Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514C8D52B54A16400493A16 /* Ghostty.Config.swift */; }; A514C8D72B54A16400493A16 /* Ghostty.Config.swift in Sources */ = {isa = PBXBuildFile; fileRef = A514C8D52B54A16400493A16 /* Ghostty.Config.swift */; };
A514C8D82B54DC6800493A16 /* Ghostty.App.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */; }; A514C8D82B54DC6800493A16 /* Ghostty.App.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */; };
A51B78472AF4B58B00F3EDB9 /* TerminalWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51B78462AF4B58B00F3EDB9 /* TerminalWindow.swift */; }; A51544FE2DFB111C009E85D8 /* TitlebarTabsTahoeTerminalWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51544FD2DFB1110009E85D8 /* TitlebarTabsTahoeTerminalWindow.swift */; };
A51545002DFB112E009E85D8 /* TerminalTabsTitlebarTahoe.xib in Resources */ = {isa = PBXBuildFile; fileRef = A51544FF2DFB112E009E85D8 /* TerminalTabsTitlebarTahoe.xib */; };
A51B78472AF4B58B00F3EDB9 /* TitlebarTabsVenturaTerminalWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51B78462AF4B58B00F3EDB9 /* TitlebarTabsVenturaTerminalWindow.swift */; };
A51BFC1E2B2FB5CE00E92F16 /* About.xib in Resources */ = {isa = PBXBuildFile; fileRef = A51BFC1D2B2FB5CE00E92F16 /* About.xib */; }; A51BFC1E2B2FB5CE00E92F16 /* About.xib in Resources */ = {isa = PBXBuildFile; fileRef = A51BFC1D2B2FB5CE00E92F16 /* About.xib */; };
A51BFC202B2FB64F00E92F16 /* AboutController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51BFC1F2B2FB64F00E92F16 /* AboutController.swift */; }; A51BFC202B2FB64F00E92F16 /* AboutController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51BFC1F2B2FB64F00E92F16 /* AboutController.swift */; };
A51BFC222B2FB6B400E92F16 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51BFC212B2FB6B400E92F16 /* AboutView.swift */; }; A51BFC222B2FB6B400E92F16 /* AboutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51BFC212B2FB6B400E92F16 /* AboutView.swift */; };
@ -34,18 +42,32 @@
A5333E242B5A22D9008AEFF7 /* Ghostty.Shell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D58852ACDDB4100508D2C /* Ghostty.Shell.swift */; }; A5333E242B5A22D9008AEFF7 /* Ghostty.Shell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A56D58852ACDDB4100508D2C /* Ghostty.Shell.swift */; };
A53426352A7DA53D00EBB7A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53426342A7DA53D00EBB7A2 /* AppDelegate.swift */; }; A53426352A7DA53D00EBB7A2 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53426342A7DA53D00EBB7A2 /* AppDelegate.swift */; };
A535B9DA299C569B0017E2E4 /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A535B9D9299C569B0017E2E4 /* ErrorView.swift */; }; A535B9DA299C569B0017E2E4 /* ErrorView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A535B9D9299C569B0017E2E4 /* ErrorView.swift */; };
A53A297B2DB2E49700B6E02C /* CommandPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53A297A2DB2E49400B6E02C /* CommandPalette.swift */; };
A53A297F2DB4480F00B6E02C /* EventModifiers+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53A297E2DB4480A00B6E02C /* EventModifiers+Extension.swift */; };
A53A29812DB44A6100B6E02C /* KeyboardShortcut+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53A29802DB44A5E00B6E02C /* KeyboardShortcut+Extension.swift */; };
A53A29882DB69D2F00B6E02C /* TerminalCommandPalette.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53A29872DB69D2C00B6E02C /* TerminalCommandPalette.swift */; };
A53A6C032CCC1B7F00943E98 /* Ghostty.Action.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53A6C022CCC1B7D00943E98 /* Ghostty.Action.swift */; }; A53A6C032CCC1B7F00943E98 /* Ghostty.Action.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53A6C022CCC1B7D00943E98 /* Ghostty.Action.swift */; };
A53D0C8E2B53B0EA00305CE6 /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */; }; A53D0C8E2B53B0EA00305CE6 /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */; };
A53D0C942B53B43700305CE6 /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D0C932B53B43700305CE6 /* iOSApp.swift */; }; A53D0C942B53B43700305CE6 /* iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D0C932B53B43700305CE6 /* iOSApp.swift */; };
A53D0C952B53B4D800305CE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B30538299BEAAB0047F10C /* Assets.xcassets */; }; A53D0C952B53B4D800305CE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B30538299BEAAB0047F10C /* Assets.xcassets */; };
A53D0C9B2B543F3B00305CE6 /* Ghostty.App.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */; }; A53D0C9B2B543F3B00305CE6 /* Ghostty.App.swift in Sources */ = {isa = PBXBuildFile; fileRef = A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */; };
A53D0C9C2B543F7B00305CE6 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55B7BB729B6F53A0055DE60 /* Package.swift */; }; A53D0C9C2B543F7B00305CE6 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55B7BB729B6F53A0055DE60 /* Package.swift */; };
A546F1142D7B68D7003B11A0 /* locale in Resources */ = {isa = PBXBuildFile; fileRef = A546F1132D7B68D7003B11A0 /* locale */; };
A54B0CE92D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CE82D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift */; }; A54B0CE92D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CE82D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift */; };
A54B0CEB2D0CFB4C00CBEFF8 /* NSImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CEA2D0CFB4A00CBEFF8 /* NSImage+Extension.swift */; }; A54B0CEB2D0CFB4C00CBEFF8 /* NSImage+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CEA2D0CFB4A00CBEFF8 /* NSImage+Extension.swift */; };
A54B0CED2D0CFB7700CBEFF8 /* ColorizedGhosttyIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CEC2D0CFB7300CBEFF8 /* ColorizedGhosttyIcon.swift */; }; A54B0CED2D0CFB7700CBEFF8 /* ColorizedGhosttyIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CEC2D0CFB7300CBEFF8 /* ColorizedGhosttyIcon.swift */; };
A54B0CEF2D0D2E2800CBEFF8 /* ColorizedGhosttyIconImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CEE2D0D2E2400CBEFF8 /* ColorizedGhosttyIconImage.swift */; }; A54B0CEF2D0D2E2800CBEFF8 /* ColorizedGhosttyIconImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54B0CEE2D0D2E2400CBEFF8 /* ColorizedGhosttyIconImage.swift */; };
A54D786C2CA7978E001B19B1 /* BaseTerminalController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54D786B2CA79788001B19B1 /* BaseTerminalController.swift */; }; A54D786C2CA7978E001B19B1 /* BaseTerminalController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A54D786B2CA79788001B19B1 /* BaseTerminalController.swift */; };
A55685E029A03A9F004303CE /* AppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55685DF29A03A9F004303CE /* AppError.swift */; }; A553F4062E05E93000257779 /* Optional+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A51194122E05D003007258CC /* Optional+Extension.swift */; };
A553F4072E05E93D00257779 /* Array+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A586366A2DF0A98900E04A10 /* Array+Extension.swift */; };
A553F4132E06EB1600257779 /* Ghostty.icon in Resources */ = {isa = PBXBuildFile; fileRef = A553F4122E06EB1600257779 /* Ghostty.icon */; };
A553F4142E06EB1600257779 /* Ghostty.icon in Resources */ = {isa = PBXBuildFile; fileRef = A553F4122E06EB1600257779 /* Ghostty.icon */; };
A5593FDF2DF8D57C00B47B10 /* TerminalWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5593FDE2DF8D57100B47B10 /* TerminalWindow.swift */; };
A5593FE12DF8D74000B47B10 /* HiddenTitlebarTerminalWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5593FE02DF8D73400B47B10 /* HiddenTitlebarTerminalWindow.swift */; };
A5593FE32DF8D78600B47B10 /* TerminalHiddenTitlebar.xib in Resources */ = {isa = PBXBuildFile; fileRef = A5593FE22DF8D78600B47B10 /* TerminalHiddenTitlebar.xib */; };
A5593FE52DF8DE3000B47B10 /* TerminalTabsTitlebarVentura.xib in Resources */ = {isa = PBXBuildFile; fileRef = A5593FE42DF8DE3000B47B10 /* TerminalTabsTitlebarVentura.xib */; };
A5593FE72DF927D200B47B10 /* TransparentTitlebarTerminalWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5593FE62DF927CC00B47B10 /* TransparentTitlebarTerminalWindow.swift */; };
A5593FE92DF927DF00B47B10 /* TerminalTransparentTitlebar.xib in Resources */ = {isa = PBXBuildFile; fileRef = A5593FE82DF927DF00B47B10 /* TerminalTransparentTitlebar.xib */; };
A55B7BB829B6F53A0055DE60 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55B7BB729B6F53A0055DE60 /* Package.swift */; }; A55B7BB829B6F53A0055DE60 /* Package.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55B7BB729B6F53A0055DE60 /* Package.swift */; };
A55B7BBC29B6FC330055DE60 /* SurfaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55B7BBB29B6FC330055DE60 /* SurfaceView.swift */; }; A55B7BBC29B6FC330055DE60 /* SurfaceView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55B7BBB29B6FC330055DE60 /* SurfaceView.swift */; };
A56B880B2A840447007A0E29 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A56B880A2A840447007A0E29 /* Carbon.framework */; }; A56B880B2A840447007A0E29 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A56B880A2A840447007A0E29 /* Carbon.framework */; };
@ -54,14 +76,19 @@
A571AB1D2A206FCF00248498 /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */; }; A571AB1D2A206FCF00248498 /* GhosttyKit.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5D495A1299BEC7E00DD1313 /* GhosttyKit.xcframework */; };
A57D79272C9C879B001D522E /* SecureInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57D79262C9C8798001D522E /* SecureInput.swift */; }; A57D79272C9C879B001D522E /* SecureInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = A57D79262C9C8798001D522E /* SecureInput.swift */; };
A586167C2B7703CC009BDB1D /* fish in Resources */ = {isa = PBXBuildFile; fileRef = A586167B2B7703CC009BDB1D /* fish */; }; A586167C2B7703CC009BDB1D /* fish in Resources */ = {isa = PBXBuildFile; fileRef = A586167B2B7703CC009BDB1D /* fish */; };
A586365F2DEE6C2300E04A10 /* SplitTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = A586365E2DEE6C2100E04A10 /* SplitTree.swift */; };
A58636662DEF964100E04A10 /* TerminalSplitTreeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58636652DEF963F00E04A10 /* TerminalSplitTreeView.swift */; };
A586366B2DF0A98C00E04A10 /* Array+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A586366A2DF0A98900E04A10 /* Array+Extension.swift */; };
A586366F2DF25D8600E04A10 /* Duration+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A586366E2DF25D8300E04A10 /* Duration+Extension.swift */; };
A58636712DF298FB00E04A10 /* ExpiringUndoManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58636702DF298F700E04A10 /* ExpiringUndoManager.swift */; };
A58636732DF4813400E04A10 /* UndoManager+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A58636722DF4813000E04A10 /* UndoManager+Extension.swift */; };
A5874D992DAD751B00E83852 /* CGS.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5874D982DAD751A00E83852 /* CGS.swift */; };
A5874D9D2DAD786100E83852 /* NSWindow+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5874D9C2DAD785F00E83852 /* NSWindow+Extension.swift */; };
A59444F729A2ED5200725BBA /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59444F629A2ED5200725BBA /* SettingsView.swift */; }; A59444F729A2ED5200725BBA /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59444F629A2ED5200725BBA /* SettingsView.swift */; };
A59630972AEE163600D64628 /* HostingWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59630962AEE163600D64628 /* HostingWindow.swift */; }; A59630972AEE163600D64628 /* HostingWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59630962AEE163600D64628 /* HostingWindow.swift */; };
A596309A2AEE1C6400D64628 /* Terminal.xib in Resources */ = {isa = PBXBuildFile; fileRef = A59630992AEE1C6400D64628 /* Terminal.xib */; }; A596309A2AEE1C6400D64628 /* Terminal.xib in Resources */ = {isa = PBXBuildFile; fileRef = A59630992AEE1C6400D64628 /* Terminal.xib */; };
A596309C2AEE1C9E00D64628 /* TerminalController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596309B2AEE1C9E00D64628 /* TerminalController.swift */; }; A596309C2AEE1C9E00D64628 /* TerminalController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596309B2AEE1C9E00D64628 /* TerminalController.swift */; };
A596309E2AEE1D6C00D64628 /* TerminalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596309D2AEE1D6C00D64628 /* TerminalView.swift */; }; A596309E2AEE1D6C00D64628 /* TerminalView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596309D2AEE1D6C00D64628 /* TerminalView.swift */; };
A59630A02AEF6AEB00D64628 /* TerminalManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = A596309F2AEF6AEB00D64628 /* TerminalManager.swift */; };
A59630A22AF0415000D64628 /* Ghostty.TerminalSplit.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59630A12AF0415000D64628 /* Ghostty.TerminalSplit.swift */; };
A59630A42AF059BB00D64628 /* Ghostty.SplitNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A59630A32AF059BB00D64628 /* Ghostty.SplitNode.swift */; };
A5985CD72C320C4500C57AD3 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5985CD62C320C4500C57AD3 /* String+Extension.swift */; }; A5985CD72C320C4500C57AD3 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5985CD62C320C4500C57AD3 /* String+Extension.swift */; };
A5985CD82C320C4500C57AD3 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5985CD62C320C4500C57AD3 /* String+Extension.swift */; }; A5985CD82C320C4500C57AD3 /* String+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5985CD62C320C4500C57AD3 /* String+Extension.swift */; };
A5985CE62C33060F00C57AD3 /* man in Resources */ = {isa = PBXBuildFile; fileRef = A5985CE52C33060F00C57AD3 /* man */; }; A5985CE62C33060F00C57AD3 /* man in Resources */ = {isa = PBXBuildFile; fileRef = A5985CE52C33060F00C57AD3 /* man */; };
@ -71,9 +98,10 @@
A5A1F8852A489D6800D1E8BC /* terminfo in Resources */ = {isa = PBXBuildFile; fileRef = A5A1F8842A489D6800D1E8BC /* terminfo */; }; A5A1F8852A489D6800D1E8BC /* terminfo in Resources */ = {isa = PBXBuildFile; fileRef = A5A1F8842A489D6800D1E8BC /* terminfo */; };
A5A2A3CA2D4445E30033CF96 /* Dock.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A2A3C92D4445E20033CF96 /* Dock.swift */; }; A5A2A3CA2D4445E30033CF96 /* Dock.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A2A3C92D4445E20033CF96 /* Dock.swift */; };
A5A2A3CC2D444ABB0033CF96 /* NSApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A2A3CB2D444AB80033CF96 /* NSApplication+Extension.swift */; }; A5A2A3CC2D444ABB0033CF96 /* NSApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A2A3CB2D444AB80033CF96 /* NSApplication+Extension.swift */; };
A5A6F72A2CC41B8900B232A5 /* Xcode.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A6F7292CC41B8700B232A5 /* Xcode.swift */; }; A5A6F72A2CC41B8900B232A5 /* AppInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5A6F7292CC41B8700B232A5 /* AppInfo.swift */; };
A5AEB1652D5BE7D000513529 /* LastWindowPosition.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AEB1642D5BE7BF00513529 /* LastWindowPosition.swift */; }; A5AEB1652D5BE7D000513529 /* LastWindowPosition.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AEB1642D5BE7BF00513529 /* LastWindowPosition.swift */; };
A5B30539299BEAAB0047F10C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B30538299BEAAB0047F10C /* Assets.xcassets */; }; A5B30539299BEAAB0047F10C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A5B30538299BEAAB0047F10C /* Assets.xcassets */; };
A5B4EA852DFE691B0022C3A2 /* NSMenuItem+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B4EA842DFE69140022C3A2 /* NSMenuItem+Extension.swift */; };
A5CA378C2D2A4DEB00931030 /* KeyboardLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CA378B2D2A4DE800931030 /* KeyboardLayout.swift */; }; A5CA378C2D2A4DEB00931030 /* KeyboardLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CA378B2D2A4DE800931030 /* KeyboardLayout.swift */; };
A5CA378E2D31D6C300931030 /* Weak.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CA378D2D31D6C100931030 /* Weak.swift */; }; A5CA378E2D31D6C300931030 /* Weak.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CA378D2D31D6C100931030 /* Weak.swift */; };
A5CBD0562C9E65B80017A1AE /* DraggableWindowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CBD0552C9E65A50017A1AE /* DraggableWindowView.swift */; }; A5CBD0562C9E65B80017A1AE /* DraggableWindowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5CBD0552C9E65A50017A1AE /* DraggableWindowView.swift */; };
@ -99,9 +127,20 @@
A5E112932AF73E6E00C6E0C2 /* ClipboardConfirmation.xib in Resources */ = {isa = PBXBuildFile; fileRef = A5E112922AF73E6E00C6E0C2 /* ClipboardConfirmation.xib */; }; A5E112932AF73E6E00C6E0C2 /* ClipboardConfirmation.xib in Resources */ = {isa = PBXBuildFile; fileRef = A5E112922AF73E6E00C6E0C2 /* ClipboardConfirmation.xib */; };
A5E112952AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E112942AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift */; }; A5E112952AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E112942AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift */; };
A5E112972AF7401B00C6E0C2 /* ClipboardConfirmationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E112962AF7401B00C6E0C2 /* ClipboardConfirmationView.swift */; }; A5E112972AF7401B00C6E0C2 /* ClipboardConfirmationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E112962AF7401B00C6E0C2 /* ClipboardConfirmationView.swift */; };
A5E4082A2E022E9E0035FEAC /* TabGroupCloseCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408292E022E9B0035FEAC /* TabGroupCloseCoordinator.swift */; };
A5E4082E2E0237460035FEAC /* NewTerminalIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E4082D2E0237410035FEAC /* NewTerminalIntent.swift */; };
A5E408302E0271320035FEAC /* GhosttyIntentError.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E4082F2E0271320035FEAC /* GhosttyIntentError.swift */; };
A5E408322E02FEDF0035FEAC /* TerminalEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408312E02FEDC0035FEAC /* TerminalEntity.swift */; };
A5E408342E0320140035FEAC /* GetTerminalDetailsIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408332E03200F0035FEAC /* GetTerminalDetailsIntent.swift */; };
A5E408382E03C7DA0035FEAC /* Ghostty.Surface.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408372E03C7D80035FEAC /* Ghostty.Surface.swift */; };
A5E4083A2E0449BD0035FEAC /* Ghostty.Command.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408392E0449BB0035FEAC /* Ghostty.Command.swift */; };
A5E4083C2E044DB50035FEAC /* Ghostty.Error.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E4083B2E044DB40035FEAC /* Ghostty.Error.swift */; };
A5E408402E04532C0035FEAC /* CommandEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E4083F2E04532A0035FEAC /* CommandEntity.swift */; };
A5E408432E047D0B0035FEAC /* CommandPaletteIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408422E047D060035FEAC /* CommandPaletteIntent.swift */; };
A5E408452E0483FD0035FEAC /* KeybindIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408442E0483F80035FEAC /* KeybindIntent.swift */; };
A5E408472E04852B0035FEAC /* InputIntent.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5E408462E0485270035FEAC /* InputIntent.swift */; };
A5FEB3002ABB69450068369E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FEB2FF2ABB69450068369E /* main.swift */; }; A5FEB3002ABB69450068369E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5FEB2FF2ABB69450068369E /* main.swift */; };
AEE8B3452B9AA39600260C5E /* NSPasteboard+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE8B3442B9AA39600260C5E /* NSPasteboard+Extension.swift */; }; AEE8B3452B9AA39600260C5E /* NSPasteboard+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEE8B3442B9AA39600260C5E /* NSPasteboard+Extension.swift */; };
AEF9CE242B6AD07A0017E195 /* TerminalToolbar.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF9CE232B6AD07A0017E195 /* TerminalToolbar.swift */; };
C159E81D2B66A06B00FDFE9C /* OSColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */; }; C159E81D2B66A06B00FDFE9C /* OSColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */; };
C159E89D2B69A2EF00FDFE9C /* OSColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */; }; C159E89D2B69A2EF00FDFE9C /* OSColor+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */; };
C1F26EA72B738B9900404083 /* NSView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1F26EA62B738B9900404083 /* NSView+Extension.swift */; }; C1F26EA72B738B9900404083 /* NSView+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = C1F26EA62B738B9900404083 /* NSView+Extension.swift */; };
@ -118,8 +157,16 @@
552964E52B34A9B400030505 /* vim */ = {isa = PBXFileReference; lastKnownFileType = folder; name = vim; path = "../zig-out/share/vim"; sourceTree = "<group>"; }; 552964E52B34A9B400030505 /* vim */ = {isa = PBXFileReference; lastKnownFileType = folder; name = vim; path = "../zig-out/share/vim"; sourceTree = "<group>"; };
857F63802A5E64F200CA4815 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = "<group>"; }; 857F63802A5E64F200CA4815 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = "<group>"; };
9351BE8E2D22937F003B3499 /* nvim */ = {isa = PBXFileReference; lastKnownFileType = folder; name = nvim; path = "../zig-out/share/nvim"; sourceTree = "<group>"; }; 9351BE8E2D22937F003B3499 /* nvim */ = {isa = PBXFileReference; lastKnownFileType = folder; name = nvim; path = "../zig-out/share/nvim"; sourceTree = "<group>"; };
A50297342DFA0F3300B4E924 /* Double+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Double+Extension.swift"; sourceTree = "<group>"; };
A511940E2E050590007258CC /* CloseTerminalIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CloseTerminalIntent.swift; sourceTree = "<group>"; };
A51194102E05A480007258CC /* QuickTerminalIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickTerminalIntent.swift; sourceTree = "<group>"; };
A51194122E05D003007258CC /* Optional+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Optional+Extension.swift"; sourceTree = "<group>"; };
A51194162E05D95E007258CC /* PermissionRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionRequest.swift; sourceTree = "<group>"; };
A51194182E05DFBB007258CC /* IntentPermission.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentPermission.swift; sourceTree = "<group>"; };
A514C8D52B54A16400493A16 /* Ghostty.Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Config.swift; sourceTree = "<group>"; }; A514C8D52B54A16400493A16 /* Ghostty.Config.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Config.swift; sourceTree = "<group>"; };
A51B78462AF4B58B00F3EDB9 /* TerminalWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalWindow.swift; sourceTree = "<group>"; }; A51544FD2DFB1110009E85D8 /* TitlebarTabsTahoeTerminalWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitlebarTabsTahoeTerminalWindow.swift; sourceTree = "<group>"; };
A51544FF2DFB112E009E85D8 /* TerminalTabsTitlebarTahoe.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TerminalTabsTitlebarTahoe.xib; sourceTree = "<group>"; };
A51B78462AF4B58B00F3EDB9 /* TitlebarTabsVenturaTerminalWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitlebarTabsVenturaTerminalWindow.swift; sourceTree = "<group>"; };
A51BFC1D2B2FB5CE00E92F16 /* About.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = About.xib; sourceTree = "<group>"; }; A51BFC1D2B2FB5CE00E92F16 /* About.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = About.xib; sourceTree = "<group>"; };
A51BFC1F2B2FB64F00E92F16 /* AboutController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutController.swift; sourceTree = "<group>"; }; A51BFC1F2B2FB64F00E92F16 /* AboutController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutController.swift; sourceTree = "<group>"; };
A51BFC212B2FB6B400E92F16 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; }; A51BFC212B2FB6B400E92F16 /* AboutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutView.swift; sourceTree = "<group>"; };
@ -135,15 +182,26 @@
A5333E212B5A2128008AEFF7 /* SurfaceView_AppKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurfaceView_AppKit.swift; sourceTree = "<group>"; }; A5333E212B5A2128008AEFF7 /* SurfaceView_AppKit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurfaceView_AppKit.swift; sourceTree = "<group>"; };
A53426342A7DA53D00EBB7A2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; A53426342A7DA53D00EBB7A2 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
A535B9D9299C569B0017E2E4 /* ErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = "<group>"; }; A535B9D9299C569B0017E2E4 /* ErrorView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorView.swift; sourceTree = "<group>"; };
A53A297A2DB2E49400B6E02C /* CommandPalette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandPalette.swift; sourceTree = "<group>"; };
A53A297E2DB4480A00B6E02C /* EventModifiers+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "EventModifiers+Extension.swift"; sourceTree = "<group>"; };
A53A29802DB44A5E00B6E02C /* KeyboardShortcut+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "KeyboardShortcut+Extension.swift"; sourceTree = "<group>"; };
A53A29872DB69D2C00B6E02C /* TerminalCommandPalette.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalCommandPalette.swift; sourceTree = "<group>"; };
A53A6C022CCC1B7D00943E98 /* Ghostty.Action.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Action.swift; sourceTree = "<group>"; }; A53A6C022CCC1B7D00943E98 /* Ghostty.Action.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Action.swift; sourceTree = "<group>"; };
A53D0C932B53B43700305CE6 /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; }; A53D0C932B53B43700305CE6 /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.App.swift; sourceTree = "<group>"; }; A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.App.swift; sourceTree = "<group>"; };
A546F1132D7B68D7003B11A0 /* locale */ = {isa = PBXFileReference; lastKnownFileType = folder; name = locale; path = "../zig-out/share/locale"; sourceTree = "<group>"; };
A54B0CE82D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorizedGhosttyIconView.swift; sourceTree = "<group>"; }; A54B0CE82D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorizedGhosttyIconView.swift; sourceTree = "<group>"; };
A54B0CEA2D0CFB4A00CBEFF8 /* NSImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Extension.swift"; sourceTree = "<group>"; }; A54B0CEA2D0CFB4A00CBEFF8 /* NSImage+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSImage+Extension.swift"; sourceTree = "<group>"; };
A54B0CEC2D0CFB7300CBEFF8 /* ColorizedGhosttyIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorizedGhosttyIcon.swift; sourceTree = "<group>"; }; A54B0CEC2D0CFB7300CBEFF8 /* ColorizedGhosttyIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorizedGhosttyIcon.swift; sourceTree = "<group>"; };
A54B0CEE2D0D2E2400CBEFF8 /* ColorizedGhosttyIconImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorizedGhosttyIconImage.swift; sourceTree = "<group>"; }; A54B0CEE2D0D2E2400CBEFF8 /* ColorizedGhosttyIconImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorizedGhosttyIconImage.swift; sourceTree = "<group>"; };
A54D786B2CA79788001B19B1 /* BaseTerminalController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTerminalController.swift; sourceTree = "<group>"; }; A54D786B2CA79788001B19B1 /* BaseTerminalController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseTerminalController.swift; sourceTree = "<group>"; };
A55685DF29A03A9F004303CE /* AppError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppError.swift; sourceTree = "<group>"; }; A553F4122E06EB1600257779 /* Ghostty.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; name = Ghostty.icon; path = ../images/Ghostty.icon; sourceTree = SOURCE_ROOT; };
A5593FDE2DF8D57100B47B10 /* TerminalWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalWindow.swift; sourceTree = "<group>"; };
A5593FE02DF8D73400B47B10 /* HiddenTitlebarTerminalWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HiddenTitlebarTerminalWindow.swift; sourceTree = "<group>"; };
A5593FE22DF8D78600B47B10 /* TerminalHiddenTitlebar.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TerminalHiddenTitlebar.xib; sourceTree = "<group>"; };
A5593FE42DF8DE3000B47B10 /* TerminalTabsTitlebarVentura.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TerminalTabsTitlebarVentura.xib; sourceTree = "<group>"; };
A5593FE62DF927CC00B47B10 /* TransparentTitlebarTerminalWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TransparentTitlebarTerminalWindow.swift; sourceTree = "<group>"; };
A5593FE82DF927DF00B47B10 /* TerminalTransparentTitlebar.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TerminalTransparentTitlebar.xib; sourceTree = "<group>"; };
A55B7BB729B6F53A0055DE60 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; }; A55B7BB729B6F53A0055DE60 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = "<group>"; };
A55B7BBB29B6FC330055DE60 /* SurfaceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurfaceView.swift; sourceTree = "<group>"; }; A55B7BBB29B6FC330055DE60 /* SurfaceView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurfaceView.swift; sourceTree = "<group>"; };
A56B880A2A840447007A0E29 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; }; A56B880A2A840447007A0E29 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = System/Library/Frameworks/Carbon.framework; sourceTree = SDKROOT; };
@ -152,14 +210,19 @@
A571AB1C2A206FC600248498 /* Ghostty-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Ghostty-Info.plist"; sourceTree = "<group>"; }; A571AB1C2A206FC600248498 /* Ghostty-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "Ghostty-Info.plist"; sourceTree = "<group>"; };
A57D79262C9C8798001D522E /* SecureInput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureInput.swift; sourceTree = "<group>"; }; A57D79262C9C8798001D522E /* SecureInput.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SecureInput.swift; sourceTree = "<group>"; };
A586167B2B7703CC009BDB1D /* fish */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fish; path = "../zig-out/share/fish"; sourceTree = "<group>"; }; A586167B2B7703CC009BDB1D /* fish */ = {isa = PBXFileReference; lastKnownFileType = folder; name = fish; path = "../zig-out/share/fish"; sourceTree = "<group>"; };
A586365E2DEE6C2100E04A10 /* SplitTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplitTree.swift; sourceTree = "<group>"; };
A58636652DEF963F00E04A10 /* TerminalSplitTreeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalSplitTreeView.swift; sourceTree = "<group>"; };
A586366A2DF0A98900E04A10 /* Array+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Extension.swift"; sourceTree = "<group>"; };
A586366E2DF25D8300E04A10 /* Duration+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Duration+Extension.swift"; sourceTree = "<group>"; };
A58636702DF298F700E04A10 /* ExpiringUndoManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExpiringUndoManager.swift; sourceTree = "<group>"; };
A58636722DF4813000E04A10 /* UndoManager+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UndoManager+Extension.swift"; sourceTree = "<group>"; };
A5874D982DAD751A00E83852 /* CGS.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CGS.swift; sourceTree = "<group>"; };
A5874D9C2DAD785F00E83852 /* NSWindow+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSWindow+Extension.swift"; sourceTree = "<group>"; };
A59444F629A2ED5200725BBA /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; }; A59444F629A2ED5200725BBA /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
A59630962AEE163600D64628 /* HostingWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostingWindow.swift; sourceTree = "<group>"; }; A59630962AEE163600D64628 /* HostingWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostingWindow.swift; sourceTree = "<group>"; };
A59630992AEE1C6400D64628 /* Terminal.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Terminal.xib; sourceTree = "<group>"; }; A59630992AEE1C6400D64628 /* Terminal.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Terminal.xib; sourceTree = "<group>"; };
A596309B2AEE1C9E00D64628 /* TerminalController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalController.swift; sourceTree = "<group>"; }; A596309B2AEE1C9E00D64628 /* TerminalController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalController.swift; sourceTree = "<group>"; };
A596309D2AEE1D6C00D64628 /* TerminalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalView.swift; sourceTree = "<group>"; }; A596309D2AEE1D6C00D64628 /* TerminalView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalView.swift; sourceTree = "<group>"; };
A596309F2AEF6AEB00D64628 /* TerminalManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalManager.swift; sourceTree = "<group>"; };
A59630A12AF0415000D64628 /* Ghostty.TerminalSplit.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.TerminalSplit.swift; sourceTree = "<group>"; };
A59630A32AF059BB00D64628 /* Ghostty.SplitNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.SplitNode.swift; sourceTree = "<group>"; };
A5985CD62C320C4500C57AD3 /* String+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; }; A5985CD62C320C4500C57AD3 /* String+Extension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+Extension.swift"; sourceTree = "<group>"; };
A5985CE52C33060F00C57AD3 /* man */ = {isa = PBXFileReference; lastKnownFileType = folder; name = man; path = "../zig-out/share/man"; sourceTree = "<group>"; }; A5985CE52C33060F00C57AD3 /* man */ = {isa = PBXFileReference; lastKnownFileType = folder; name = man; path = "../zig-out/share/man"; sourceTree = "<group>"; };
A599CDAF2CF103F20049FA26 /* NSAppearance+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSAppearance+Extension.swift"; sourceTree = "<group>"; }; A599CDAF2CF103F20049FA26 /* NSAppearance+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSAppearance+Extension.swift"; sourceTree = "<group>"; };
@ -168,11 +231,12 @@
A5A1F8842A489D6800D1E8BC /* terminfo */ = {isa = PBXFileReference; lastKnownFileType = folder; name = terminfo; path = "../zig-out/share/terminfo"; sourceTree = "<group>"; }; A5A1F8842A489D6800D1E8BC /* terminfo */ = {isa = PBXFileReference; lastKnownFileType = folder; name = terminfo; path = "../zig-out/share/terminfo"; sourceTree = "<group>"; };
A5A2A3C92D4445E20033CF96 /* Dock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dock.swift; sourceTree = "<group>"; }; A5A2A3C92D4445E20033CF96 /* Dock.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Dock.swift; sourceTree = "<group>"; };
A5A2A3CB2D444AB80033CF96 /* NSApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSApplication+Extension.swift"; sourceTree = "<group>"; }; A5A2A3CB2D444AB80033CF96 /* NSApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSApplication+Extension.swift"; sourceTree = "<group>"; };
A5A6F7292CC41B8700B232A5 /* Xcode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Xcode.swift; sourceTree = "<group>"; }; A5A6F7292CC41B8700B232A5 /* AppInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppInfo.swift; sourceTree = "<group>"; };
A5AEB1642D5BE7BF00513529 /* LastWindowPosition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LastWindowPosition.swift; sourceTree = "<group>"; }; A5AEB1642D5BE7BF00513529 /* LastWindowPosition.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LastWindowPosition.swift; sourceTree = "<group>"; };
A5B30531299BEAAA0047F10C /* Ghostty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ghostty.app; sourceTree = BUILT_PRODUCTS_DIR; }; A5B30531299BEAAA0047F10C /* Ghostty.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Ghostty.app; sourceTree = BUILT_PRODUCTS_DIR; };
A5B30538299BEAAB0047F10C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; A5B30538299BEAAB0047F10C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
A5B3053D299BEAAB0047F10C /* Ghostty.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Ghostty.entitlements; sourceTree = "<group>"; }; A5B3053D299BEAAB0047F10C /* Ghostty.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Ghostty.entitlements; sourceTree = "<group>"; };
A5B4EA842DFE69140022C3A2 /* NSMenuItem+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSMenuItem+Extension.swift"; sourceTree = "<group>"; };
A5CA378B2D2A4DE800931030 /* KeyboardLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardLayout.swift; sourceTree = "<group>"; }; A5CA378B2D2A4DE800931030 /* KeyboardLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardLayout.swift; sourceTree = "<group>"; };
A5CA378D2D31D6C100931030 /* Weak.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Weak.swift; sourceTree = "<group>"; }; A5CA378D2D31D6C100931030 /* Weak.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Weak.swift; sourceTree = "<group>"; };
A5CBD0552C9E65A50017A1AE /* DraggableWindowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DraggableWindowView.swift; sourceTree = "<group>"; }; A5CBD0552C9E65A50017A1AE /* DraggableWindowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DraggableWindowView.swift; sourceTree = "<group>"; };
@ -199,9 +263,20 @@
A5E112922AF73E6E00C6E0C2 /* ClipboardConfirmation.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ClipboardConfirmation.xib; sourceTree = "<group>"; }; A5E112922AF73E6E00C6E0C2 /* ClipboardConfirmation.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ClipboardConfirmation.xib; sourceTree = "<group>"; };
A5E112942AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClipboardConfirmationController.swift; sourceTree = "<group>"; }; A5E112942AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClipboardConfirmationController.swift; sourceTree = "<group>"; };
A5E112962AF7401B00C6E0C2 /* ClipboardConfirmationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClipboardConfirmationView.swift; sourceTree = "<group>"; }; A5E112962AF7401B00C6E0C2 /* ClipboardConfirmationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClipboardConfirmationView.swift; sourceTree = "<group>"; };
A5E408292E022E9B0035FEAC /* TabGroupCloseCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TabGroupCloseCoordinator.swift; sourceTree = "<group>"; };
A5E4082D2E0237410035FEAC /* NewTerminalIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTerminalIntent.swift; sourceTree = "<group>"; };
A5E4082F2E0271320035FEAC /* GhosttyIntentError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GhosttyIntentError.swift; sourceTree = "<group>"; };
A5E408312E02FEDC0035FEAC /* TerminalEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalEntity.swift; sourceTree = "<group>"; };
A5E408332E03200F0035FEAC /* GetTerminalDetailsIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetTerminalDetailsIntent.swift; sourceTree = "<group>"; };
A5E408372E03C7D80035FEAC /* Ghostty.Surface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Surface.swift; sourceTree = "<group>"; };
A5E408392E0449BB0035FEAC /* Ghostty.Command.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Command.swift; sourceTree = "<group>"; };
A5E4083B2E044DB40035FEAC /* Ghostty.Error.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Ghostty.Error.swift; sourceTree = "<group>"; };
A5E4083F2E04532A0035FEAC /* CommandEntity.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandEntity.swift; sourceTree = "<group>"; };
A5E408422E047D060035FEAC /* CommandPaletteIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommandPaletteIntent.swift; sourceTree = "<group>"; };
A5E408442E0483F80035FEAC /* KeybindIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeybindIntent.swift; sourceTree = "<group>"; };
A5E408462E0485270035FEAC /* InputIntent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputIntent.swift; sourceTree = "<group>"; };
A5FEB2FF2ABB69450068369E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; }; A5FEB2FF2ABB69450068369E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
AEE8B3442B9AA39600260C5E /* NSPasteboard+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSPasteboard+Extension.swift"; sourceTree = "<group>"; }; AEE8B3442B9AA39600260C5E /* NSPasteboard+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSPasteboard+Extension.swift"; sourceTree = "<group>"; };
AEF9CE232B6AD07A0017E195 /* TerminalToolbar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TerminalToolbar.swift; sourceTree = "<group>"; };
C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OSColor+Extension.swift"; sourceTree = "<group>"; }; C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "OSColor+Extension.swift"; sourceTree = "<group>"; };
C1F26EA62B738B9900404083 /* NSView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSView+Extension.swift"; sourceTree = "<group>"; }; C1F26EA62B738B9900404083 /* NSView+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSView+Extension.swift"; sourceTree = "<group>"; };
C1F26EE72B76CBFC00404083 /* VibrantLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VibrantLayer.h; sourceTree = "<group>"; }; C1F26EE72B76CBFC00404083 /* VibrantLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VibrantLayer.h; sourceTree = "<group>"; };
@ -259,8 +334,11 @@
A56D58872ACDE6BE00508D2C /* Services */, A56D58872ACDE6BE00508D2C /* Services */,
A59630982AEE1C4400D64628 /* Terminal */, A59630982AEE1C4400D64628 /* Terminal */,
A5CBD05A2CA0C5910017A1AE /* QuickTerminal */, A5CBD05A2CA0C5910017A1AE /* QuickTerminal */,
A5E4082C2E0237270035FEAC /* App Intents */,
A5E112912AF73E4D00C6E0C2 /* ClipboardConfirmation */, A5E112912AF73E4D00C6E0C2 /* ClipboardConfirmation */,
A57D79252C9C8782001D522E /* Secure Input */, A57D79252C9C8782001D522E /* Secure Input */,
A58636622DEF955100E04A10 /* Splits */,
A53A29742DB2E04900B6E02C /* Command Palette */,
A534263E2A7DCC5800EBB7A2 /* Settings */, A534263E2A7DCC5800EBB7A2 /* Settings */,
A51BFC1C2B2FB5AB00E92F16 /* About */, A51BFC1C2B2FB5AB00E92F16 /* About */,
A54B0CE72D0CEC9800CBEFF8 /* Colorized Ghostty Icon */, A54B0CE72D0CEC9800CBEFF8 /* Colorized Ghostty Icon */,
@ -272,31 +350,25 @@
A534263D2A7DCBB000EBB7A2 /* Helpers */ = { A534263D2A7DCBB000EBB7A2 /* Helpers */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A58636692DF0A98100E04A10 /* Extensions */,
A5874D9B2DAD781100E83852 /* Private */,
A5A6F7292CC41B8700B232A5 /* AppInfo.swift */,
A5AEB1642D5BE7BF00513529 /* LastWindowPosition.swift */, A5AEB1642D5BE7BF00513529 /* LastWindowPosition.swift */,
A5A6F7292CC41B8700B232A5 /* Xcode.swift */,
A5CEAFFE29C2410700646FDA /* Backport.swift */, A5CEAFFE29C2410700646FDA /* Backport.swift */,
A5333E1B2B5A1CE3008AEFF7 /* CrossKit.swift */, A5333E1B2B5A1CE3008AEFF7 /* CrossKit.swift */,
A5CBD0572C9F30860017A1AE /* Cursor.swift */, A5CBD0572C9F30860017A1AE /* Cursor.swift */,
A5D0AF3C2B37804400D21823 /* CodableBridge.swift */, A5D0AF3C2B37804400D21823 /* CodableBridge.swift */,
A5A2A3C92D4445E20033CF96 /* Dock.swift */, A5CBD0552C9E65A50017A1AE /* DraggableWindowView.swift */,
A58636702DF298F700E04A10 /* ExpiringUndoManager.swift */,
A52FFF582CAA4FF1000C6A5B /* Fullscreen.swift */, A52FFF582CAA4FF1000C6A5B /* Fullscreen.swift */,
A59630962AEE163600D64628 /* HostingWindow.swift */, A59630962AEE163600D64628 /* HostingWindow.swift */,
A5CA378B2D2A4DE800931030 /* KeyboardLayout.swift */, A5CA378B2D2A4DE800931030 /* KeyboardLayout.swift */,
A59FB5D02AE0DEA7009128F3 /* MetalView.swift */, A59FB5D02AE0DEA7009128F3 /* MetalView.swift */,
A5CBD0552C9E65A50017A1AE /* DraggableWindowView.swift */, A51194162E05D95E007258CC /* PermissionRequest.swift */,
C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */, A5E408292E022E9B0035FEAC /* TabGroupCloseCoordinator.swift */,
A599CDAF2CF103F20049FA26 /* NSAppearance+Extension.swift */,
A5A2A3CB2D444AB80033CF96 /* NSApplication+Extension.swift */,
A54B0CEA2D0CFB4A00CBEFF8 /* NSImage+Extension.swift */,
A52FFF5C2CAB4D05000C6A5B /* NSScreen+Extension.swift */,
C1F26EA62B738B9900404083 /* NSView+Extension.swift */,
AEE8B3442B9AA39600260C5E /* NSPasteboard+Extension.swift */,
A5985CD62C320C4500C57AD3 /* String+Extension.swift */,
A5CC36142C9CDA03004D6760 /* View+Extension.swift */,
A5CA378D2D31D6C100931030 /* Weak.swift */, A5CA378D2D31D6C100931030 /* Weak.swift */,
C1F26EE72B76CBFC00404083 /* VibrantLayer.h */, C1F26EE72B76CBFC00404083 /* VibrantLayer.h */,
C1F26EE82B76CBFC00404083 /* VibrantLayer.m */, C1F26EE82B76CBFC00404083 /* VibrantLayer.m */,
A5CEAFDA29B8005900646FDA /* SplitView */,
); );
path = Helpers; path = Helpers;
sourceTree = "<group>"; sourceTree = "<group>";
@ -312,6 +384,15 @@
path = Settings; path = Settings;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A53A29742DB2E04900B6E02C /* Command Palette */ = {
isa = PBXGroup;
children = (
A53A297A2DB2E49400B6E02C /* CommandPalette.swift */,
A53A29872DB69D2C00B6E02C /* TerminalCommandPalette.swift */,
);
path = "Command Palette";
sourceTree = "<group>";
};
A53D0C912B53B41900305CE6 /* App */ = { A53D0C912B53B41900305CE6 /* App */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -361,6 +442,23 @@
path = Sources; path = Sources;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A5593FDD2DF8D56000B47B10 /* Window Styles */ = {
isa = PBXGroup;
children = (
A59630992AEE1C6400D64628 /* Terminal.xib */,
A5593FE22DF8D78600B47B10 /* TerminalHiddenTitlebar.xib */,
A51544FF2DFB112E009E85D8 /* TerminalTabsTitlebarTahoe.xib */,
A5593FE42DF8DE3000B47B10 /* TerminalTabsTitlebarVentura.xib */,
A5593FE82DF927DF00B47B10 /* TerminalTransparentTitlebar.xib */,
A5593FDE2DF8D57100B47B10 /* TerminalWindow.swift */,
A5593FE02DF8D73400B47B10 /* HiddenTitlebarTerminalWindow.swift */,
A51B78462AF4B58B00F3EDB9 /* TitlebarTabsVenturaTerminalWindow.swift */,
A51544FD2DFB1110009E85D8 /* TitlebarTabsTahoeTerminalWindow.swift */,
A5593FE62DF927CC00B47B10 /* TransparentTitlebarTerminalWindow.swift */,
);
path = "Window Styles";
sourceTree = "<group>";
};
A55B7BB429B6F4410055DE60 /* Ghostty */ = { A55B7BB429B6F4410055DE60 /* Ghostty */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -370,14 +468,14 @@
A5333E152B59DE8E008AEFF7 /* SurfaceView_UIKit.swift */, A5333E152B59DE8E008AEFF7 /* SurfaceView_UIKit.swift */,
A59FB5CE2AE0DB50009128F3 /* InspectorView.swift */, A59FB5CE2AE0DB50009128F3 /* InspectorView.swift */,
A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */, A53D0C992B543F3B00305CE6 /* Ghostty.App.swift */,
A5E408392E0449BB0035FEAC /* Ghostty.Command.swift */,
A514C8D52B54A16400493A16 /* Ghostty.Config.swift */, A514C8D52B54A16400493A16 /* Ghostty.Config.swift */,
A53A6C022CCC1B7D00943E98 /* Ghostty.Action.swift */, A53A6C022CCC1B7D00943E98 /* Ghostty.Action.swift */,
A5E4083B2E044DB40035FEAC /* Ghostty.Error.swift */,
A5CF66D62D29DDB100139794 /* Ghostty.Event.swift */, A5CF66D62D29DDB100139794 /* Ghostty.Event.swift */,
A5278A9A2AA05B2600CD3039 /* Ghostty.Input.swift */, A5278A9A2AA05B2600CD3039 /* Ghostty.Input.swift */,
A56D58852ACDDB4100508D2C /* Ghostty.Shell.swift */, A56D58852ACDDB4100508D2C /* Ghostty.Shell.swift */,
A59630A32AF059BB00D64628 /* Ghostty.SplitNode.swift */, A5E408372E03C7D80035FEAC /* Ghostty.Surface.swift */,
A59630A12AF0415000D64628 /* Ghostty.TerminalSplit.swift */,
A55685DF29A03A9F004303CE /* AppError.swift */,
A52FFF5A2CAA54A8000C6A5B /* FullscreenMode+Extension.swift */, A52FFF5A2CAA54A8000C6A5B /* FullscreenMode+Extension.swift */,
A5CF66D32D289CEA00139794 /* NSEvent+Extension.swift */, A5CF66D32D289CEA00139794 /* NSEvent+Extension.swift */,
); );
@ -401,16 +499,58 @@
path = "Secure Input"; path = "Secure Input";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A58636622DEF955100E04A10 /* Splits */ = {
isa = PBXGroup;
children = (
A586365E2DEE6C2100E04A10 /* SplitTree.swift */,
A58636652DEF963F00E04A10 /* TerminalSplitTreeView.swift */,
A5CEAFDB29B8009000646FDA /* SplitView.swift */,
A5CEAFDD29B8058B00646FDA /* SplitView.Divider.swift */,
);
path = Splits;
sourceTree = "<group>";
};
A58636692DF0A98100E04A10 /* Extensions */ = {
isa = PBXGroup;
children = (
A586366A2DF0A98900E04A10 /* Array+Extension.swift */,
A50297342DFA0F3300B4E924 /* Double+Extension.swift */,
A586366E2DF25D8300E04A10 /* Duration+Extension.swift */,
A53A29802DB44A5E00B6E02C /* KeyboardShortcut+Extension.swift */,
A53A297E2DB4480A00B6E02C /* EventModifiers+Extension.swift */,
A51194122E05D003007258CC /* Optional+Extension.swift */,
C159E81C2B66A06B00FDFE9C /* OSColor+Extension.swift */,
A599CDAF2CF103F20049FA26 /* NSAppearance+Extension.swift */,
A5A2A3CB2D444AB80033CF96 /* NSApplication+Extension.swift */,
A54B0CEA2D0CFB4A00CBEFF8 /* NSImage+Extension.swift */,
A5B4EA842DFE69140022C3A2 /* NSMenuItem+Extension.swift */,
A52FFF5C2CAB4D05000C6A5B /* NSScreen+Extension.swift */,
AEE8B3442B9AA39600260C5E /* NSPasteboard+Extension.swift */,
C1F26EA62B738B9900404083 /* NSView+Extension.swift */,
A5874D9C2DAD785F00E83852 /* NSWindow+Extension.swift */,
A5985CD62C320C4500C57AD3 /* String+Extension.swift */,
A58636722DF4813000E04A10 /* UndoManager+Extension.swift */,
A5CC36142C9CDA03004D6760 /* View+Extension.swift */,
);
path = Extensions;
sourceTree = "<group>";
};
A5874D9B2DAD781100E83852 /* Private */ = {
isa = PBXGroup;
children = (
A5874D982DAD751A00E83852 /* CGS.swift */,
A5A2A3C92D4445E20033CF96 /* Dock.swift */,
);
path = Private;
sourceTree = "<group>";
};
A59630982AEE1C4400D64628 /* Terminal */ = { A59630982AEE1C4400D64628 /* Terminal */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A59630992AEE1C6400D64628 /* Terminal.xib */, A5593FDD2DF8D56000B47B10 /* Window Styles */,
A596309F2AEF6AEB00D64628 /* TerminalManager.swift */,
A596309B2AEE1C9E00D64628 /* TerminalController.swift */, A596309B2AEE1C9E00D64628 /* TerminalController.swift */,
A5D0AF3A2B36A1DE00D21823 /* TerminalRestorable.swift */, A5D0AF3A2B36A1DE00D21823 /* TerminalRestorable.swift */,
A596309D2AEE1D6C00D64628 /* TerminalView.swift */, A596309D2AEE1D6C00D64628 /* TerminalView.swift */,
A51B78462AF4B58B00F3EDB9 /* TerminalWindow.swift */,
AEF9CE232B6AD07A0017E195 /* TerminalToolbar.swift */,
A535B9D9299C569B0017E2E4 /* ErrorView.swift */, A535B9D9299C569B0017E2E4 /* ErrorView.swift */,
A54D786B2CA79788001B19B1 /* BaseTerminalController.swift */, A54D786B2CA79788001B19B1 /* BaseTerminalController.swift */,
); );
@ -424,6 +564,7 @@
29C15B1C2CDC3B2000520DD4 /* bat */, 29C15B1C2CDC3B2000520DD4 /* bat */,
A586167B2B7703CC009BDB1D /* fish */, A586167B2B7703CC009BDB1D /* fish */,
55154BDF2B33911F001622DC /* ghostty */, 55154BDF2B33911F001622DC /* ghostty */,
A546F1132D7B68D7003B11A0 /* locale */,
A5985CE52C33060F00C57AD3 /* man */, A5985CE52C33060F00C57AD3 /* man */,
9351BE8E2D22937F003B3499 /* nvim */, 9351BE8E2D22937F003B3499 /* nvim */,
A5A1F8842A489D6800D1E8BC /* terminfo */, A5A1F8842A489D6800D1E8BC /* terminfo */,
@ -438,6 +579,7 @@
children = ( children = (
A571AB1C2A206FC600248498 /* Ghostty-Info.plist */, A571AB1C2A206FC600248498 /* Ghostty-Info.plist */,
A5B30538299BEAAB0047F10C /* Assets.xcassets */, A5B30538299BEAAB0047F10C /* Assets.xcassets */,
A553F4122E06EB1600257779 /* Ghostty.icon */,
A5B3053D299BEAAB0047F10C /* Ghostty.entitlements */, A5B3053D299BEAAB0047F10C /* Ghostty.entitlements */,
A51BFC282B30F26D00E92F16 /* GhosttyDebug.entitlements */, A51BFC282B30F26D00E92F16 /* GhosttyDebug.entitlements */,
3B39CAA42B33949B00DABEB8 /* GhosttyReleaseLocal.entitlements */, 3B39CAA42B33949B00DABEB8 /* GhosttyReleaseLocal.entitlements */,
@ -478,15 +620,6 @@
path = "Global Keybinds"; path = "Global Keybinds";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A5CEAFDA29B8005900646FDA /* SplitView */ = {
isa = PBXGroup;
children = (
A5CEAFDB29B8009000646FDA /* SplitView.swift */,
A5CEAFDD29B8058B00646FDA /* SplitView.Divider.swift */,
);
path = SplitView;
sourceTree = "<group>";
};
A5D495A3299BECBA00DD1313 /* Frameworks */ = { A5D495A3299BECBA00DD1313 /* Frameworks */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -506,6 +639,32 @@
path = ClipboardConfirmation; path = ClipboardConfirmation;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
A5E4082C2E0237270035FEAC /* App Intents */ = {
isa = PBXGroup;
children = (
A5E408412E0453370035FEAC /* Entities */,
A511940E2E050590007258CC /* CloseTerminalIntent.swift */,
A5E4082D2E0237410035FEAC /* NewTerminalIntent.swift */,
A5E408332E03200F0035FEAC /* GetTerminalDetailsIntent.swift */,
A51194102E05A480007258CC /* QuickTerminalIntent.swift */,
A5E408422E047D060035FEAC /* CommandPaletteIntent.swift */,
A5E408462E0485270035FEAC /* InputIntent.swift */,
A5E408442E0483F80035FEAC /* KeybindIntent.swift */,
A5E4082F2E0271320035FEAC /* GhosttyIntentError.swift */,
A51194182E05DFBB007258CC /* IntentPermission.swift */,
);
path = "App Intents";
sourceTree = "<group>";
};
A5E408412E0453370035FEAC /* Entities */ = {
isa = PBXGroup;
children = (
A5E408312E02FEDC0035FEAC /* TerminalEntity.swift */,
A5E4083F2E04532A0035FEAC /* CommandEntity.swift */,
);
path = Entities;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -593,20 +752,26 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
FC9ABA9C2D0F53F80020D4C8 /* bash-completion in Resources */, FC9ABA9C2D0F53F80020D4C8 /* bash-completion in Resources */,
A553F4142E06EB1600257779 /* Ghostty.icon in Resources */,
A5593FE52DF8DE3000B47B10 /* TerminalTabsTitlebarVentura.xib in Resources */,
29C15B1D2CDC3B2900520DD4 /* bat in Resources */,
A586167C2B7703CC009BDB1D /* fish in Resources */,
55154BE02B33911F001622DC /* ghostty in Resources */,
A5593FE32DF8D78600B47B10 /* TerminalHiddenTitlebar.xib in Resources */,
A546F1142D7B68D7003B11A0 /* locale in Resources */,
A5985CE62C33060F00C57AD3 /* man in Resources */,
9351BE8E3D22937F003B3499 /* nvim in Resources */,
A5A1F8852A489D6800D1E8BC /* terminfo in Resources */,
552964E62B34A9B400030505 /* vim in Resources */,
FC5218FA2D10FFCE004C93E0 /* zsh in Resources */,
A5B30539299BEAAB0047F10C /* Assets.xcassets in Resources */, A5B30539299BEAAB0047F10C /* Assets.xcassets in Resources */,
A51BFC1E2B2FB5CE00E92F16 /* About.xib in Resources */, A51BFC1E2B2FB5CE00E92F16 /* About.xib in Resources */,
A5593FE92DF927DF00B47B10 /* TerminalTransparentTitlebar.xib in Resources */,
A5E112932AF73E6E00C6E0C2 /* ClipboardConfirmation.xib in Resources */, A5E112932AF73E6E00C6E0C2 /* ClipboardConfirmation.xib in Resources */,
A5CDF1912AAF9A5800513312 /* ConfigurationErrors.xib in Resources */, A5CDF1912AAF9A5800513312 /* ConfigurationErrors.xib in Resources */,
857F63812A5E64F200CA4815 /* MainMenu.xib in Resources */, 857F63812A5E64F200CA4815 /* MainMenu.xib in Resources */,
29C15B1D2CDC3B2900520DD4 /* bat in Resources */,
A596309A2AEE1C6400D64628 /* Terminal.xib in Resources */, A596309A2AEE1C6400D64628 /* Terminal.xib in Resources */,
A586167C2B7703CC009BDB1D /* fish in Resources */, A51545002DFB112E009E85D8 /* TerminalTabsTitlebarTahoe.xib in Resources */,
FC5218FA2D10FFCE004C93E0 /* zsh in Resources */,
55154BE02B33911F001622DC /* ghostty in Resources */,
A5985CE62C33060F00C57AD3 /* man in Resources */,
A5A1F8852A489D6800D1E8BC /* terminfo in Resources */,
552964E62B34A9B400030505 /* vim in Resources */,
9351BE8E3D22937F003B3499 /* nvim in Resources */,
A5CBD05C2CA0C5C70017A1AE /* QuickTerminal.xib in Resources */, A5CBD05C2CA0C5C70017A1AE /* QuickTerminal.xib in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -616,6 +781,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A53D0C952B53B4D800305CE6 /* Assets.xcassets in Resources */, A53D0C952B53B4D800305CE6 /* Assets.xcassets in Resources */,
A553F4132E06EB1600257779 /* Ghostty.icon in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -627,71 +793,101 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A5AEB1652D5BE7D000513529 /* LastWindowPosition.swift in Sources */, A5AEB1652D5BE7D000513529 /* LastWindowPosition.swift in Sources */,
A59630A42AF059BB00D64628 /* Ghostty.SplitNode.swift in Sources */, A5E408432E047D0B0035FEAC /* CommandPaletteIntent.swift in Sources */,
A514C8D62B54A16400493A16 /* Ghostty.Config.swift in Sources */, A514C8D62B54A16400493A16 /* Ghostty.Config.swift in Sources */,
A54B0CEB2D0CFB4C00CBEFF8 /* NSImage+Extension.swift in Sources */, A54B0CEB2D0CFB4C00CBEFF8 /* NSImage+Extension.swift in Sources */,
A5874D9D2DAD786100E83852 /* NSWindow+Extension.swift in Sources */,
A54D786C2CA7978E001B19B1 /* BaseTerminalController.swift in Sources */, A54D786C2CA7978E001B19B1 /* BaseTerminalController.swift in Sources */,
A58636732DF4813400E04A10 /* UndoManager+Extension.swift in Sources */,
A59FB5CF2AE0DB50009128F3 /* InspectorView.swift in Sources */, A59FB5CF2AE0DB50009128F3 /* InspectorView.swift in Sources */,
CFBB5FEA2D231E5000FD62EE /* QuickTerminalSpaceBehavior.swift in Sources */, CFBB5FEA2D231E5000FD62EE /* QuickTerminalSpaceBehavior.swift in Sources */,
A54B0CE92D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift in Sources */, A54B0CE92D0CECD100CBEFF8 /* ColorizedGhosttyIconView.swift in Sources */,
A5D0AF3D2B37804400D21823 /* CodableBridge.swift in Sources */, A5D0AF3D2B37804400D21823 /* CodableBridge.swift in Sources */,
A51194132E05D006007258CC /* Optional+Extension.swift in Sources */,
A5D0AF3B2B36A1DE00D21823 /* TerminalRestorable.swift in Sources */, A5D0AF3B2B36A1DE00D21823 /* TerminalRestorable.swift in Sources */,
C1F26EA72B738B9900404083 /* NSView+Extension.swift in Sources */, C1F26EA72B738B9900404083 /* NSView+Extension.swift in Sources */,
A586366F2DF25D8600E04A10 /* Duration+Extension.swift in Sources */,
A5CF66D42D289CEE00139794 /* NSEvent+Extension.swift in Sources */, A5CF66D42D289CEE00139794 /* NSEvent+Extension.swift in Sources */,
A5E408342E0320140035FEAC /* GetTerminalDetailsIntent.swift in Sources */,
A5CBD0642CA122E70017A1AE /* QuickTerminalPosition.swift in Sources */, A5CBD0642CA122E70017A1AE /* QuickTerminalPosition.swift in Sources */,
A596309C2AEE1C9E00D64628 /* TerminalController.swift in Sources */, A596309C2AEE1C9E00D64628 /* TerminalController.swift in Sources */,
A5E408322E02FEDF0035FEAC /* TerminalEntity.swift in Sources */,
A5CC36152C9CDA06004D6760 /* View+Extension.swift in Sources */, A5CC36152C9CDA06004D6760 /* View+Extension.swift in Sources */,
A56D58892ACDE6CA00508D2C /* ServiceProvider.swift in Sources */, A56D58892ACDE6CA00508D2C /* ServiceProvider.swift in Sources */,
A5CBD0602CA0C90A0017A1AE /* QuickTerminalWindow.swift in Sources */, A5CBD0602CA0C90A0017A1AE /* QuickTerminalWindow.swift in Sources */,
A5CBD05E2CA0C5EC0017A1AE /* QuickTerminalController.swift in Sources */, A5CBD05E2CA0C5EC0017A1AE /* QuickTerminalController.swift in Sources */,
A5CF66D72D29DDB500139794 /* Ghostty.Event.swift in Sources */, A5CF66D72D29DDB500139794 /* Ghostty.Event.swift in Sources */,
A511940F2E050595007258CC /* CloseTerminalIntent.swift in Sources */,
A5E408382E03C7DA0035FEAC /* Ghostty.Surface.swift in Sources */,
A5593FE72DF927D200B47B10 /* TransparentTitlebarTerminalWindow.swift in Sources */,
A5A2A3CA2D4445E30033CF96 /* Dock.swift in Sources */, A5A2A3CA2D4445E30033CF96 /* Dock.swift in Sources */,
A586365F2DEE6C2300E04A10 /* SplitTree.swift in Sources */,
A51BFC222B2FB6B400E92F16 /* AboutView.swift in Sources */, A51BFC222B2FB6B400E92F16 /* AboutView.swift in Sources */,
A5278A9B2AA05B2600CD3039 /* Ghostty.Input.swift in Sources */, A5278A9B2AA05B2600CD3039 /* Ghostty.Input.swift in Sources */,
A53A29812DB44A6100B6E02C /* KeyboardShortcut+Extension.swift in Sources */,
A50297352DFA0F3400B4E924 /* Double+Extension.swift in Sources */,
A5CBD0562C9E65B80017A1AE /* DraggableWindowView.swift in Sources */, A5CBD0562C9E65B80017A1AE /* DraggableWindowView.swift in Sources */,
A51194112E05A483007258CC /* QuickTerminalIntent.swift in Sources */,
C1F26EE92B76CBFC00404083 /* VibrantLayer.m in Sources */, C1F26EE92B76CBFC00404083 /* VibrantLayer.m in Sources */,
A5593FDF2DF8D57C00B47B10 /* TerminalWindow.swift in Sources */,
A58636712DF298FB00E04A10 /* ExpiringUndoManager.swift in Sources */,
A59630972AEE163600D64628 /* HostingWindow.swift in Sources */, A59630972AEE163600D64628 /* HostingWindow.swift in Sources */,
A59630A02AEF6AEB00D64628 /* TerminalManager.swift in Sources */,
A51BFC2B2B30F6BE00E92F16 /* UpdateDelegate.swift in Sources */, A51BFC2B2B30F6BE00E92F16 /* UpdateDelegate.swift in Sources */,
A5CBD06B2CA322430017A1AE /* GlobalEventTap.swift in Sources */, A5CBD06B2CA322430017A1AE /* GlobalEventTap.swift in Sources */,
AEE8B3452B9AA39600260C5E /* NSPasteboard+Extension.swift in Sources */, AEE8B3452B9AA39600260C5E /* NSPasteboard+Extension.swift in Sources */,
A51194172E05D964007258CC /* PermissionRequest.swift in Sources */,
A51194192E05DFC4007258CC /* IntentPermission.swift in Sources */,
A52FFF5D2CAB4D08000C6A5B /* NSScreen+Extension.swift in Sources */, A52FFF5D2CAB4D08000C6A5B /* NSScreen+Extension.swift in Sources */,
A53426352A7DA53D00EBB7A2 /* AppDelegate.swift in Sources */, A53426352A7DA53D00EBB7A2 /* AppDelegate.swift in Sources */,
A5CBD0582C9F30960017A1AE /* Cursor.swift in Sources */, A5CBD0582C9F30960017A1AE /* Cursor.swift in Sources */,
A5A6F72A2CC41B8900B232A5 /* Xcode.swift in Sources */, A5A6F72A2CC41B8900B232A5 /* AppInfo.swift in Sources */,
A52FFF5B2CAA54B1000C6A5B /* FullscreenMode+Extension.swift in Sources */, A52FFF5B2CAA54B1000C6A5B /* FullscreenMode+Extension.swift in Sources */,
A5333E222B5A2128008AEFF7 /* SurfaceView_AppKit.swift in Sources */, A5333E222B5A2128008AEFF7 /* SurfaceView_AppKit.swift in Sources */,
A5CA378E2D31D6C300931030 /* Weak.swift in Sources */, A5CA378E2D31D6C300931030 /* Weak.swift in Sources */,
A5CDF1952AAFA19600513312 /* ConfigurationErrorsView.swift in Sources */, A5CDF1952AAFA19600513312 /* ConfigurationErrorsView.swift in Sources */,
A55B7BBC29B6FC330055DE60 /* SurfaceView.swift in Sources */, A55B7BBC29B6FC330055DE60 /* SurfaceView.swift in Sources */,
A5333E1C2B5A1CE3008AEFF7 /* CrossKit.swift in Sources */, A5333E1C2B5A1CE3008AEFF7 /* CrossKit.swift in Sources */,
A5B4EA852DFE691B0022C3A2 /* NSMenuItem+Extension.swift in Sources */,
A5874D992DAD751B00E83852 /* CGS.swift in Sources */,
A586366B2DF0A98C00E04A10 /* Array+Extension.swift in Sources */,
A5E408472E04852B0035FEAC /* InputIntent.swift in Sources */,
A51544FE2DFB111C009E85D8 /* TitlebarTabsTahoeTerminalWindow.swift in Sources */,
A59444F729A2ED5200725BBA /* SettingsView.swift in Sources */, A59444F729A2ED5200725BBA /* SettingsView.swift in Sources */,
A56D58862ACDDB4100508D2C /* Ghostty.Shell.swift in Sources */, A56D58862ACDDB4100508D2C /* Ghostty.Shell.swift in Sources */,
A5985CD72C320C4500C57AD3 /* String+Extension.swift in Sources */, A5985CD72C320C4500C57AD3 /* String+Extension.swift in Sources */,
A5A2A3CC2D444ABB0033CF96 /* NSApplication+Extension.swift in Sources */, A5A2A3CC2D444ABB0033CF96 /* NSApplication+Extension.swift in Sources */,
A59630A22AF0415000D64628 /* Ghostty.TerminalSplit.swift in Sources */, A5E408302E0271320035FEAC /* GhosttyIntentError.swift in Sources */,
A5E4083A2E0449BD0035FEAC /* Ghostty.Command.swift in Sources */,
A5E408452E0483FD0035FEAC /* KeybindIntent.swift in Sources */,
A5FEB3002ABB69450068369E /* main.swift in Sources */, A5FEB3002ABB69450068369E /* main.swift in Sources */,
A53A297F2DB4480F00B6E02C /* EventModifiers+Extension.swift in Sources */,
A5E4082E2E0237460035FEAC /* NewTerminalIntent.swift in Sources */,
A53A297B2DB2E49700B6E02C /* CommandPalette.swift in Sources */,
A55B7BB829B6F53A0055DE60 /* Package.swift in Sources */, A55B7BB829B6F53A0055DE60 /* Package.swift in Sources */,
A51B78472AF4B58B00F3EDB9 /* TerminalWindow.swift in Sources */, A51B78472AF4B58B00F3EDB9 /* TitlebarTabsVenturaTerminalWindow.swift in Sources */,
A57D79272C9C879B001D522E /* SecureInput.swift in Sources */, A57D79272C9C879B001D522E /* SecureInput.swift in Sources */,
A5CEAFDC29B8009000646FDA /* SplitView.swift in Sources */, A5CEAFDC29B8009000646FDA /* SplitView.swift in Sources */,
A5593FE12DF8D74000B47B10 /* HiddenTitlebarTerminalWindow.swift in Sources */,
A5E4083C2E044DB50035FEAC /* Ghostty.Error.swift in Sources */,
A5CDF1932AAF9E0800513312 /* ConfigurationErrorsController.swift in Sources */, A5CDF1932AAF9E0800513312 /* ConfigurationErrorsController.swift in Sources */,
A53A6C032CCC1B7F00943E98 /* Ghostty.Action.swift in Sources */, A53A6C032CCC1B7F00943E98 /* Ghostty.Action.swift in Sources */,
A54B0CED2D0CFB7700CBEFF8 /* ColorizedGhosttyIcon.swift in Sources */, A54B0CED2D0CFB7700CBEFF8 /* ColorizedGhosttyIcon.swift in Sources */,
A5CA378C2D2A4DEB00931030 /* KeyboardLayout.swift in Sources */, A5CA378C2D2A4DEB00931030 /* KeyboardLayout.swift in Sources */,
A54B0CEF2D0D2E2800CBEFF8 /* ColorizedGhosttyIconImage.swift in Sources */, A54B0CEF2D0D2E2800CBEFF8 /* ColorizedGhosttyIconImage.swift in Sources */,
A59FB5D12AE0DEA7009128F3 /* MetalView.swift in Sources */, A59FB5D12AE0DEA7009128F3 /* MetalView.swift in Sources */,
A55685E029A03A9F004303CE /* AppError.swift in Sources */,
A599CDB02CF103F60049FA26 /* NSAppearance+Extension.swift in Sources */, A599CDB02CF103F60049FA26 /* NSAppearance+Extension.swift in Sources */,
A52FFF572CA90484000C6A5B /* QuickTerminalScreen.swift in Sources */, A52FFF572CA90484000C6A5B /* QuickTerminalScreen.swift in Sources */,
A5CC36132C9CD72D004D6760 /* SecureInputOverlay.swift in Sources */, A5CC36132C9CD72D004D6760 /* SecureInputOverlay.swift in Sources */,
A5E408402E04532C0035FEAC /* CommandEntity.swift in Sources */,
A5E4082A2E022E9E0035FEAC /* TabGroupCloseCoordinator.swift in Sources */,
A535B9DA299C569B0017E2E4 /* ErrorView.swift in Sources */, A535B9DA299C569B0017E2E4 /* ErrorView.swift in Sources */,
A53A29882DB69D2F00B6E02C /* TerminalCommandPalette.swift in Sources */,
A51BFC202B2FB64F00E92F16 /* AboutController.swift in Sources */, A51BFC202B2FB64F00E92F16 /* AboutController.swift in Sources */,
A5CEAFFF29C2410700646FDA /* Backport.swift in Sources */, A5CEAFFF29C2410700646FDA /* Backport.swift in Sources */,
A5E112952AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift in Sources */, A5E112952AF73E8A00C6E0C2 /* ClipboardConfirmationController.swift in Sources */,
A596309E2AEE1D6C00D64628 /* TerminalView.swift in Sources */, A596309E2AEE1D6C00D64628 /* TerminalView.swift in Sources */,
A58636662DEF964100E04A10 /* TerminalSplitTreeView.swift in Sources */,
A52FFF592CAA4FF3000C6A5B /* Fullscreen.swift in Sources */, A52FFF592CAA4FF3000C6A5B /* Fullscreen.swift in Sources */,
AEF9CE242B6AD07A0017E195 /* TerminalToolbar.swift in Sources */,
C159E81D2B66A06B00FDFE9C /* OSColor+Extension.swift in Sources */, C159E81D2B66A06B00FDFE9C /* OSColor+Extension.swift in Sources */,
A5CEAFDE29B8058B00646FDA /* SplitView.Divider.swift in Sources */, A5CEAFDE29B8058B00646FDA /* SplitView.Divider.swift in Sources */,
A5E112972AF7401B00C6E0C2 /* ClipboardConfirmationView.swift in Sources */, A5E112972AF7401B00C6E0C2 /* ClipboardConfirmationView.swift in Sources */,
@ -704,6 +900,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
A5CBD0592C9F37B10017A1AE /* Backport.swift in Sources */, A5CBD0592C9F37B10017A1AE /* Backport.swift in Sources */,
A553F4062E05E93000257779 /* Optional+Extension.swift in Sources */,
A53D0C942B53B43700305CE6 /* iOSApp.swift in Sources */, A53D0C942B53B43700305CE6 /* iOSApp.swift in Sources */,
A514C8D72B54A16400493A16 /* Ghostty.Config.swift in Sources */, A514C8D72B54A16400493A16 /* Ghostty.Config.swift in Sources */,
A5333E232B5A219A008AEFF7 /* SurfaceView.swift in Sources */, A5333E232B5A219A008AEFF7 /* SurfaceView.swift in Sources */,
@ -713,6 +910,7 @@
A53D0C9B2B543F3B00305CE6 /* Ghostty.App.swift in Sources */, A53D0C9B2B543F3B00305CE6 /* Ghostty.App.swift in Sources */,
A5333E242B5A22D9008AEFF7 /* Ghostty.Shell.swift in Sources */, A5333E242B5A22D9008AEFF7 /* Ghostty.Shell.swift in Sources */,
A5985CD82C320C4500C57AD3 /* String+Extension.swift in Sources */, A5985CD82C320C4500C57AD3 /* String+Extension.swift in Sources */,
A553F4072E05E93D00257779 /* Array+Extension.swift in Sources */,
C159E89D2B69A2EF00FDFE9C /* OSColor+Extension.swift in Sources */, C159E89D2B69A2EF00FDFE9C /* OSColor+Extension.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
@ -778,7 +976,7 @@
3B39CAA32B33946300DABEB8 /* ReleaseLocal */ = { 3B39CAA32B33946300DABEB8 /* ReleaseLocal */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -948,7 +1146,7 @@
A5B30541299BEAAB0047F10C /* Debug */ = { A5B30541299BEAAB0047F10C /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -1002,7 +1200,7 @@
A5B30542299BEAAB0047F10C /* Release */ = { A5B30542299BEAAB0047F10C /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = NO;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
@ -1055,7 +1253,7 @@
A5D449A82B53AE7B000F5B83 /* Debug */ = { A5D449A82B53AE7B000F5B83 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
@ -1094,7 +1292,7 @@
A5D449A92B53AE7B000F5B83 /* Release */ = { A5D449A92B53AE7B000F5B83 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
@ -1133,7 +1331,7 @@
A5D449AA2B53AE7B000F5B83 /* ReleaseLocal */ = { A5D449AA2B53AE7B000F5B83 /* ReleaseLocal */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = Ghostty;
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;

View File

@ -18,6 +18,7 @@ class AppDelegate: NSObject,
) )
/// Various menu items so that we can programmatically sync the keyboard shortcut with the Ghostty config /// Various menu items so that we can programmatically sync the keyboard shortcut with the Ghostty config
@IBOutlet private var menuAbout: NSMenuItem?
@IBOutlet private var menuServices: NSMenu? @IBOutlet private var menuServices: NSMenu?
@IBOutlet private var menuCheckForUpdates: NSMenuItem? @IBOutlet private var menuCheckForUpdates: NSMenuItem?
@IBOutlet private var menuOpenConfig: NSMenuItem? @IBOutlet private var menuOpenConfig: NSMenuItem?
@ -28,12 +29,16 @@ class AppDelegate: NSObject,
@IBOutlet private var menuNewWindow: NSMenuItem? @IBOutlet private var menuNewWindow: NSMenuItem?
@IBOutlet private var menuNewTab: NSMenuItem? @IBOutlet private var menuNewTab: NSMenuItem?
@IBOutlet private var menuSplitRight: NSMenuItem? @IBOutlet private var menuSplitRight: NSMenuItem?
@IBOutlet private var menuSplitLeft: NSMenuItem?
@IBOutlet private var menuSplitDown: NSMenuItem? @IBOutlet private var menuSplitDown: NSMenuItem?
@IBOutlet private var menuSplitUp: NSMenuItem?
@IBOutlet private var menuClose: NSMenuItem? @IBOutlet private var menuClose: NSMenuItem?
@IBOutlet private var menuCloseTab: NSMenuItem? @IBOutlet private var menuCloseTab: NSMenuItem?
@IBOutlet private var menuCloseWindow: NSMenuItem? @IBOutlet private var menuCloseWindow: NSMenuItem?
@IBOutlet private var menuCloseAllWindows: NSMenuItem? @IBOutlet private var menuCloseAllWindows: NSMenuItem?
@IBOutlet private var menuUndo: NSMenuItem?
@IBOutlet private var menuRedo: NSMenuItem?
@IBOutlet private var menuCopy: NSMenuItem? @IBOutlet private var menuCopy: NSMenuItem?
@IBOutlet private var menuPaste: NSMenuItem? @IBOutlet private var menuPaste: NSMenuItem?
@IBOutlet private var menuPasteSelection: NSMenuItem? @IBOutlet private var menuPasteSelection: NSMenuItem?
@ -41,6 +46,7 @@ class AppDelegate: NSObject,
@IBOutlet private var menuToggleVisibility: NSMenuItem? @IBOutlet private var menuToggleVisibility: NSMenuItem?
@IBOutlet private var menuToggleFullScreen: NSMenuItem? @IBOutlet private var menuToggleFullScreen: NSMenuItem?
@IBOutlet private var menuBringAllToFront: NSMenuItem?
@IBOutlet private var menuZoomSplit: NSMenuItem? @IBOutlet private var menuZoomSplit: NSMenuItem?
@IBOutlet private var menuPreviousSplit: NSMenuItem? @IBOutlet private var menuPreviousSplit: NSMenuItem?
@IBOutlet private var menuNextSplit: NSMenuItem? @IBOutlet private var menuNextSplit: NSMenuItem?
@ -48,12 +54,17 @@ class AppDelegate: NSObject,
@IBOutlet private var menuSelectSplitBelow: NSMenuItem? @IBOutlet private var menuSelectSplitBelow: NSMenuItem?
@IBOutlet private var menuSelectSplitLeft: NSMenuItem? @IBOutlet private var menuSelectSplitLeft: NSMenuItem?
@IBOutlet private var menuSelectSplitRight: NSMenuItem? @IBOutlet private var menuSelectSplitRight: NSMenuItem?
@IBOutlet private var menuReturnToDefaultSize: NSMenuItem?
@IBOutlet private var menuFloatOnTop: NSMenuItem?
@IBOutlet private var menuUseAsDefault: NSMenuItem?
@IBOutlet private var menuIncreaseFontSize: NSMenuItem? @IBOutlet private var menuIncreaseFontSize: NSMenuItem?
@IBOutlet private var menuDecreaseFontSize: NSMenuItem? @IBOutlet private var menuDecreaseFontSize: NSMenuItem?
@IBOutlet private var menuResetFontSize: NSMenuItem? @IBOutlet private var menuResetFontSize: NSMenuItem?
@IBOutlet private var menuChangeTitle: NSMenuItem?
@IBOutlet private var menuQuickTerminal: NSMenuItem? @IBOutlet private var menuQuickTerminal: NSMenuItem?
@IBOutlet private var menuTerminalInspector: NSMenuItem? @IBOutlet private var menuTerminalInspector: NSMenuItem?
@IBOutlet private var menuCommandPalette: NSMenuItem?
@IBOutlet private var menuEqualizeSplits: NSMenuItem? @IBOutlet private var menuEqualizeSplits: NSMenuItem?
@IBOutlet private var menuMoveSplitDividerUp: NSMenuItem? @IBOutlet private var menuMoveSplitDividerUp: NSMenuItem?
@ -77,11 +88,14 @@ class AppDelegate: NSObject,
/// The ghostty global state. Only one per process. /// The ghostty global state. Only one per process.
let ghostty: Ghostty.App = Ghostty.App() let ghostty: Ghostty.App = Ghostty.App()
/// Manages our terminal windows. /// The global undo manager for app-level state such as window restoration.
let terminalManager: TerminalManager lazy var undoManager = ExpiringUndoManager()
/// Our quick terminal. This starts out uninitialized and only initializes if used. /// Our quick terminal. This starts out uninitialized and only initializes if used.
private var quickController: QuickTerminalController? = nil private(set) lazy var quickController = QuickTerminalController(
ghostty,
position: derivedConfig.quickTerminalPosition
)
/// Manages updates /// Manages updates
let updaterController: SPUStandardUpdaterController let updaterController: SPUStandardUpdaterController
@ -98,6 +112,9 @@ class AppDelegate: NSObject,
/// The observer for the app appearance. /// The observer for the app appearance.
private var appearanceObserver: NSKeyValueObservation? = nil private var appearanceObserver: NSKeyValueObservation? = nil
/// Signals
private var signals: [DispatchSourceSignal] = []
/// The custom app icon image that is currently in use. /// The custom app icon image that is currently in use.
@Published private(set) var appIcon: NSImage? = nil { @Published private(set) var appIcon: NSImage? = nil {
didSet { didSet {
@ -106,7 +123,6 @@ class AppDelegate: NSObject,
} }
override init() { override init() {
terminalManager = TerminalManager(ghostty)
updaterController = SPUStandardUpdaterController( updaterController = SPUStandardUpdaterController(
// Important: we must not start the updater here because we need to read our configuration // Important: we must not start the updater here because we need to read our configuration
// first to determine whether we're automatically checking, downloading, etc. The updater // first to determine whether we're automatically checking, downloading, etc. The updater
@ -146,10 +162,6 @@ class AppDelegate: NSObject,
toggleSecureInput(self) toggleSecureInput(self)
} }
// Hook up updater menu
menuCheckForUpdates?.target = updaterController
menuCheckForUpdates?.action = #selector(SPUStandardUpdaterController.checkForUpdates(_:))
// Initial config loading // Initial config loading
ghosttyConfigDidChange(config: ghostty.config) ghosttyConfigDidChange(config: ghostty.config)
@ -169,6 +181,12 @@ class AppDelegate: NSObject,
handler: localEventHandler) handler: localEventHandler)
// Notifications // Notifications
NotificationCenter.default.addObserver(
self,
selector: #selector(windowDidBecomeKey),
name: NSWindow.didBecomeKeyNotification,
object: nil
)
NotificationCenter.default.addObserver( NotificationCenter.default.addObserver(
self, self,
selector: #selector(quickTerminalDidChangeVisibility), selector: #selector(quickTerminalDidChangeVisibility),
@ -181,6 +199,22 @@ class AppDelegate: NSObject,
name: .ghosttyConfigDidChange, name: .ghosttyConfigDidChange,
object: nil object: nil
) )
NotificationCenter.default.addObserver(
self,
selector: #selector(ghosttyBellDidRing(_:)),
name: .ghosttyBellDidRing,
object: nil
)
NotificationCenter.default.addObserver(
self,
selector: #selector(ghosttyNewWindow(_:)),
name: Ghostty.Notification.ghosttyNewWindow,
object: nil)
NotificationCenter.default.addObserver(
self,
selector: #selector(ghosttyNewTab(_:)),
name: Ghostty.Notification.ghosttyNewTab,
object: nil)
// Configure user notifications // Configure user notifications
let actions = [ let actions = [
@ -188,6 +222,7 @@ class AppDelegate: NSObject,
] ]
let center = UNUserNotificationCenter.current() let center = UNUserNotificationCenter.current()
center.setNotificationCategories([ center.setNotificationCategories([
UNNotificationCategory( UNNotificationCategory(
identifier: Ghostty.userNotificationCategory, identifier: Ghostty.userNotificationCategory,
@ -214,12 +249,21 @@ class AppDelegate: NSObject,
ghostty_app_set_color_scheme(app, scheme) ghostty_app_set_color_scheme(app, scheme)
} }
// Setup our menu
setupMenuImages()
// Setup signal handlers
setupSignals()
} }
func applicationDidBecomeActive(_ notification: Notification) { func applicationDidBecomeActive(_ notification: Notification) {
// If we're back manually then clear the hidden state because macOS handles it. // If we're back manually then clear the hidden state because macOS handles it.
self.hiddenState = nil self.hiddenState = nil
// Clear the dock badge when the app becomes active
self.setDockBadge(nil)
// First launch stuff // First launch stuff
if (!applicationHasBecomeActive) { if (!applicationHasBecomeActive) {
applicationHasBecomeActive = true applicationHasBecomeActive = true
@ -228,8 +272,10 @@ class AppDelegate: NSObject,
// is possible to have other windows in a few scenarios: // is possible to have other windows in a few scenarios:
// - if we're opening a URL since `application(_:openFile:)` is called before this. // - if we're opening a URL since `application(_:openFile:)` is called before this.
// - if we're restoring from persisted state // - if we're restoring from persisted state
if terminalManager.windows.count == 0 && derivedConfig.initialWindow { if TerminalController.all.isEmpty && derivedConfig.initialWindow {
terminalManager.newWindow() undoManager.disableUndoRegistration()
_ = TerminalController.newWindow(ghostty)
undoManager.enableUndoRegistration()
} }
} }
} }
@ -249,7 +295,7 @@ class AppDelegate: NSObject,
// NOTE(mitchellh): I don't think we need this check at all anymore. I'm keeping it // NOTE(mitchellh): I don't think we need this check at all anymore. I'm keeping it
// here because I don't want to remove it in a patch release cycle but we should // here because I don't want to remove it in a patch release cycle but we should
// target removing it soon. // target removing it soon.
if (self.quickController == nil && windows.allSatisfy { !$0.isVisible }) { if (windows.allSatisfy { !$0.isVisible }) {
return .terminateNow return .terminateNow
} }
@ -296,6 +342,13 @@ class AppDelegate: NSObject,
} }
} }
func applicationWillTerminate(_ notification: Notification) {
// We have no notifications we want to persist after death,
// so remove them all now. In the future we may want to be
// more selective and only remove surface-targeted notifications.
UNUserNotificationCenter.current().removeAllDeliveredNotifications()
}
/// This is called when the application is already open and someone double-clicks the icon /// This is called when the application is already open and someone double-clicks the icon
/// or clicks the dock icon. /// or clicks the dock icon.
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
@ -307,10 +360,15 @@ class AppDelegate: NSObject,
// This is possible with flag set to false if there a race where the // This is possible with flag set to false if there a race where the
// window is still initializing and is not visible but the user clicked // window is still initializing and is not visible but the user clicked
// the dock icon. // the dock icon.
guard terminalManager.windows.count == 0 else { return true } guard TerminalController.all.isEmpty else { return true }
// If the application isn't active yet then we don't want to process
// this because we're not ready. This happens sometimes in Xcode runs
// but I haven't seen it happen in releases. I'm unsure why.
guard applicationHasBecomeActive else { return true }
// No visible windows, open a new one. // No visible windows, open a new one.
terminalManager.newWindow() _ = TerminalController.newWindow(ghostty)
return false return false
} }
@ -326,16 +384,24 @@ class AppDelegate: NSObject,
var config = Ghostty.SurfaceConfiguration() var config = Ghostty.SurfaceConfiguration()
if (isDirectory.boolValue) { if (isDirectory.boolValue) {
// When opening a directory, create a new tab in the main window with that as the working directory. // When opening a directory, create a new tab in the main
// window with that as the working directory.
// If no windows exist, a new one will be created. // If no windows exist, a new one will be created.
config.workingDirectory = filename config.workingDirectory = filename
terminalManager.newTab(withBaseConfig: config) _ = TerminalController.newTab(ghostty, withBaseConfig: config)
} else { } else {
// When opening a file, open a new window with that file as the command, // When opening a file, we want to execute the file. To do this, we
// and its parent directory as the working directory. // don't override the command directly, because it won't load the
config.command = filename // profile/rc files for the shell, which is super important on macOS
// due to things like Homebrew. Instead, we set the command to
// `<filename>; exit` which is what Terminal and iTerm2 do.
config.initialInput = "\(filename); exit\n"
// Set the parent directory to our working directory so that relative
// paths in scripts work.
config.workingDirectory = (filename as NSString).deletingLastPathComponent config.workingDirectory = (filename as NSString).deletingLastPathComponent
terminalManager.newWindow(withBaseConfig: config)
_ = TerminalController.newWindow(ghostty, withBaseConfig: config)
} }
return true return true
@ -346,10 +412,79 @@ class AppDelegate: NSObject,
return dockMenu return dockMenu
} }
/// Setup signal handlers
private func setupSignals() {
// Register a signal handler for config reloading. It appears that all
// of this is required. I've commented each line because its a bit unclear.
// Warning: signal handlers don't work when run via Xcode. They have to be
// run on a real app bundle.
// We need to ignore signals we register with makeSignalSource or they
// don't seem to handle.
signal(SIGUSR2, SIG_IGN)
// Make the signal source and register our event handle. We keep a weak
// ref to ourself so we don't create a retain cycle.
let sigusr2 = DispatchSource.makeSignalSource(signal: SIGUSR2, queue: .main)
sigusr2.setEventHandler { [weak self] in
guard let self else { return }
Ghostty.logger.info("reloading configuration in response to SIGUSR2")
self.ghostty.reloadConfig()
}
// The signal source starts unactivated, so we have to resume it once
// we setup the event handler.
sigusr2.resume()
// We need to keep a strong reference to it so it isn't disabled.
signals.append(sigusr2)
}
/// Setup all the images for our menu items.
private func setupMenuImages() {
// Note: This COULD Be done all in the xib file, but I find it easier to
// modify this stuff as code.
self.menuAbout?.setImageIfDesired(systemSymbolName: "info.circle")
self.menuCheckForUpdates?.setImageIfDesired(systemSymbolName: "square.and.arrow.down")
self.menuOpenConfig?.setImageIfDesired(systemSymbolName: "gear")
self.menuReloadConfig?.setImageIfDesired(systemSymbolName: "arrow.trianglehead.2.clockwise.rotate.90")
self.menuSecureInput?.setImageIfDesired(systemSymbolName: "lock.display")
self.menuNewWindow?.setImageIfDesired(systemSymbolName: "macwindow.badge.plus")
self.menuNewTab?.setImageIfDesired(systemSymbolName: "macwindow")
self.menuSplitRight?.setImageIfDesired(systemSymbolName: "rectangle.righthalf.inset.filled")
self.menuSplitLeft?.setImageIfDesired(systemSymbolName: "rectangle.leadinghalf.inset.filled")
self.menuSplitUp?.setImageIfDesired(systemSymbolName: "rectangle.tophalf.inset.filled")
self.menuSplitDown?.setImageIfDesired(systemSymbolName: "rectangle.bottomhalf.inset.filled")
self.menuClose?.setImageIfDesired(systemSymbolName: "xmark")
self.menuIncreaseFontSize?.setImageIfDesired(systemSymbolName: "textformat.size.larger")
self.menuResetFontSize?.setImageIfDesired(systemSymbolName: "textformat.size")
self.menuDecreaseFontSize?.setImageIfDesired(systemSymbolName: "textformat.size.smaller")
self.menuCommandPalette?.setImageIfDesired(systemSymbolName: "filemenu.and.selection")
self.menuQuickTerminal?.setImageIfDesired(systemSymbolName: "apple.terminal")
self.menuChangeTitle?.setImageIfDesired(systemSymbolName: "pencil.line")
self.menuTerminalInspector?.setImageIfDesired(systemSymbolName: "scope")
self.menuToggleFullScreen?.setImageIfDesired(systemSymbolName: "square.arrowtriangle.4.outward")
self.menuToggleVisibility?.setImageIfDesired(systemSymbolName: "eye")
self.menuZoomSplit?.setImageIfDesired(systemSymbolName: "arrow.up.left.and.arrow.down.right")
self.menuPreviousSplit?.setImageIfDesired(systemSymbolName: "chevron.backward.2")
self.menuNextSplit?.setImageIfDesired(systemSymbolName: "chevron.forward.2")
self.menuEqualizeSplits?.setImageIfDesired(systemSymbolName: "inset.filled.topleft.topright.bottomleft.bottomright.rectangle")
self.menuSelectSplitLeft?.setImageIfDesired(systemSymbolName: "arrow.left")
self.menuSelectSplitRight?.setImageIfDesired(systemSymbolName: "arrow.right")
self.menuSelectSplitAbove?.setImageIfDesired(systemSymbolName: "arrow.up")
self.menuSelectSplitBelow?.setImageIfDesired(systemSymbolName: "arrow.down")
self.menuMoveSplitDividerUp?.setImageIfDesired(systemSymbolName: "arrow.up.to.line")
self.menuMoveSplitDividerDown?.setImageIfDesired(systemSymbolName: "arrow.down.to.line")
self.menuMoveSplitDividerLeft?.setImageIfDesired(systemSymbolName: "arrow.left.to.line")
self.menuMoveSplitDividerRight?.setImageIfDesired(systemSymbolName: "arrow.right.to.line")
self.menuFloatOnTop?.setImageIfDesired(systemSymbolName: "square.3.layers.3d.top.filled")
}
/// Sync all of our menu item keyboard shortcuts with the Ghostty configuration. /// Sync all of our menu item keyboard shortcuts with the Ghostty configuration.
private func syncMenuShortcuts(_ config: Ghostty.Config) { private func syncMenuShortcuts(_ config: Ghostty.Config) {
guard ghostty.readiness == .ready else { return } guard ghostty.readiness == .ready else { return }
syncMenuShortcut(config, action: "check_for_updates", menuItem: self.menuCheckForUpdates)
syncMenuShortcut(config, action: "open_config", menuItem: self.menuOpenConfig) syncMenuShortcut(config, action: "open_config", menuItem: self.menuOpenConfig)
syncMenuShortcut(config, action: "reload_config", menuItem: self.menuReloadConfig) syncMenuShortcut(config, action: "reload_config", menuItem: self.menuReloadConfig)
syncMenuShortcut(config, action: "quit", menuItem: self.menuQuit) syncMenuShortcut(config, action: "quit", menuItem: self.menuQuit)
@ -361,8 +496,12 @@ class AppDelegate: NSObject,
syncMenuShortcut(config, action: "close_window", menuItem: self.menuCloseWindow) syncMenuShortcut(config, action: "close_window", menuItem: self.menuCloseWindow)
syncMenuShortcut(config, action: "close_all_windows", menuItem: self.menuCloseAllWindows) syncMenuShortcut(config, action: "close_all_windows", menuItem: self.menuCloseAllWindows)
syncMenuShortcut(config, action: "new_split:right", menuItem: self.menuSplitRight) syncMenuShortcut(config, action: "new_split:right", menuItem: self.menuSplitRight)
syncMenuShortcut(config, action: "new_split:left", menuItem: self.menuSplitLeft)
syncMenuShortcut(config, action: "new_split:down", menuItem: self.menuSplitDown) syncMenuShortcut(config, action: "new_split:down", menuItem: self.menuSplitDown)
syncMenuShortcut(config, action: "new_split:up", menuItem: self.menuSplitUp)
syncMenuShortcut(config, action: "undo", menuItem: self.menuUndo)
syncMenuShortcut(config, action: "redo", menuItem: self.menuRedo)
syncMenuShortcut(config, action: "copy_to_clipboard", menuItem: self.menuCopy) syncMenuShortcut(config, action: "copy_to_clipboard", menuItem: self.menuCopy)
syncMenuShortcut(config, action: "paste_from_clipboard", menuItem: self.menuPaste) syncMenuShortcut(config, action: "paste_from_clipboard", menuItem: self.menuPaste)
syncMenuShortcut(config, action: "paste_from_selection", menuItem: self.menuPasteSelection) syncMenuShortcut(config, action: "paste_from_selection", menuItem: self.menuPasteSelection)
@ -380,13 +519,17 @@ class AppDelegate: NSObject,
syncMenuShortcut(config, action: "resize_split:right,10", menuItem: self.menuMoveSplitDividerRight) syncMenuShortcut(config, action: "resize_split:right,10", menuItem: self.menuMoveSplitDividerRight)
syncMenuShortcut(config, action: "resize_split:left,10", menuItem: self.menuMoveSplitDividerLeft) syncMenuShortcut(config, action: "resize_split:left,10", menuItem: self.menuMoveSplitDividerLeft)
syncMenuShortcut(config, action: "equalize_splits", menuItem: self.menuEqualizeSplits) syncMenuShortcut(config, action: "equalize_splits", menuItem: self.menuEqualizeSplits)
syncMenuShortcut(config, action: "reset_window_size", menuItem: self.menuReturnToDefaultSize)
syncMenuShortcut(config, action: "increase_font_size:1", menuItem: self.menuIncreaseFontSize) syncMenuShortcut(config, action: "increase_font_size:1", menuItem: self.menuIncreaseFontSize)
syncMenuShortcut(config, action: "decrease_font_size:1", menuItem: self.menuDecreaseFontSize) syncMenuShortcut(config, action: "decrease_font_size:1", menuItem: self.menuDecreaseFontSize)
syncMenuShortcut(config, action: "reset_font_size", menuItem: self.menuResetFontSize) syncMenuShortcut(config, action: "reset_font_size", menuItem: self.menuResetFontSize)
syncMenuShortcut(config, action: "prompt_surface_title", menuItem: self.menuChangeTitle)
syncMenuShortcut(config, action: "toggle_quick_terminal", menuItem: self.menuQuickTerminal) syncMenuShortcut(config, action: "toggle_quick_terminal", menuItem: self.menuQuickTerminal)
syncMenuShortcut(config, action: "toggle_visibility", menuItem: self.menuToggleVisibility) syncMenuShortcut(config, action: "toggle_visibility", menuItem: self.menuToggleVisibility)
syncMenuShortcut(config, action: "toggle_window_float_on_top", menuItem: self.menuFloatOnTop)
syncMenuShortcut(config, action: "inspector:toggle", menuItem: self.menuTerminalInspector) syncMenuShortcut(config, action: "inspector:toggle", menuItem: self.menuTerminalInspector)
syncMenuShortcut(config, action: "toggle_command_palette", menuItem: self.menuCommandPalette)
syncMenuShortcut(config, action: "toggle_secure_input", menuItem: self.menuSecureInput) syncMenuShortcut(config, action: "toggle_secure_input", menuItem: self.menuSecureInput)
@ -404,19 +547,15 @@ class AppDelegate: NSObject,
/// action string used for the Ghostty configuration. /// action string used for the Ghostty configuration.
private func syncMenuShortcut(_ config: Ghostty.Config, action: String, menuItem: NSMenuItem?) { private func syncMenuShortcut(_ config: Ghostty.Config, action: String, menuItem: NSMenuItem?) {
guard let menu = menuItem else { return } guard let menu = menuItem else { return }
guard let equiv = config.keyEquivalent(for: action) else { guard let shortcut = config.keyboardShortcut(for: action) else {
// No shortcut, clear the menu item // No shortcut, clear the menu item
menu.keyEquivalent = "" menu.keyEquivalent = ""
menu.keyEquivalentModifierMask = [] menu.keyEquivalentModifierMask = []
return return
} }
menu.keyEquivalent = equiv.key menu.keyEquivalent = shortcut.key.character.description
menu.keyEquivalentModifierMask = equiv.modifiers menu.keyEquivalentModifierMask = .init(swiftUIFlags: shortcut.modifiers)
}
private func focusedSurface() -> ghostty_surface_t? {
return terminalManager.focusedSurface?.surface
} }
// MARK: Notifications and Events // MARK: Notifications and Events
@ -439,17 +578,22 @@ class AppDelegate: NSObject,
guard NSApp.mainWindow == nil else { return event } guard NSApp.mainWindow == nil else { return event }
// If this event as-is would result in a key binding then we send it. // If this event as-is would result in a key binding then we send it.
if let app = ghostty.app, if let app = ghostty.app {
ghostty_app_key_is_binding( var ghosttyEvent = event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)
app, let match = (event.characters ?? "").withCString { ptr in
event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)) { ghosttyEvent.text = ptr
if !ghostty_app_key_is_binding(app, ghosttyEvent) {
return false
}
return ghostty_app_key(app, ghosttyEvent)
}
// If the key was handled by Ghostty we stop the event chain. If // If the key was handled by Ghostty we stop the event chain. If
// the key wasn't handled then we let it fall through and continue // the key wasn't handled then we let it fall through and continue
// processing. This is important because some bindings may have no // processing. This is important because some bindings may have no
// affect at this scope. // affect at this scope.
if (ghostty_app_key( if match {
app,
event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS))) {
return nil return nil
} }
} }
@ -476,6 +620,10 @@ class AppDelegate: NSObject,
return event return event
} }
@objc private func windowDidBecomeKey(_ notification: Notification) {
syncFloatOnTopMenu(notification.object as? NSWindow)
}
@objc private func quickTerminalDidChangeVisibility(_ notification: Notification) { @objc private func quickTerminalDidChangeVisibility(_ notification: Notification) {
guard let quickController = notification.object as? QuickTerminalController else { return } guard let quickController = notification.object as? QuickTerminalController else { return }
self.menuQuickTerminal?.state = if (quickController.visible) { .on } else { .off } self.menuQuickTerminal?.state = if (quickController.visible) { .on } else { .off }
@ -493,6 +641,80 @@ class AppDelegate: NSObject,
ghosttyConfigDidChange(config: config) ghosttyConfigDidChange(config: config)
} }
@objc private func ghosttyBellDidRing(_ notification: Notification) {
if (ghostty.config.bellFeatures.contains(.attention)) {
// Bounce the dock icon if we're not focused.
NSApp.requestUserAttention(.informationalRequest)
// Handle setting the dock badge based on permissions
ghosttyUpdateBadgeForBell()
}
}
private func ghosttyUpdateBadgeForBell() {
let center = UNUserNotificationCenter.current()
center.getNotificationSettings { settings in
switch settings.authorizationStatus {
case .authorized:
// Already authorized, check badge setting and set if enabled
if settings.badgeSetting == .enabled {
DispatchQueue.main.async {
self.setDockBadge()
}
}
case .notDetermined:
// Not determined yet, request authorization for badge
center.requestAuthorization(options: [.badge]) { granted, error in
if let error = error {
Self.logger.warning("Error requesting badge authorization: \(error)")
return
}
if granted {
// Permission granted, set the badge
DispatchQueue.main.async {
self.setDockBadge()
}
}
}
case .denied, .provisional, .ephemeral:
// In these known non-authorized states, do not attempt to set the badge.
break
@unknown default:
// Handle future unknown states by doing nothing.
break
}
}
}
@objc private func ghosttyNewWindow(_ notification: Notification) {
let configAny = notification.userInfo?[Ghostty.Notification.NewSurfaceConfigKey]
let config = configAny as? Ghostty.SurfaceConfiguration
_ = TerminalController.newWindow(ghostty, withBaseConfig: config)
}
@objc private func ghosttyNewTab(_ notification: Notification) {
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
guard let window = surfaceView.window else { return }
// We only want to listen to new tabs if the focused parent is
// a regular terminal controller.
guard window.windowController is TerminalController else { return }
let configAny = notification.userInfo?[Ghostty.Notification.NewSurfaceConfigKey]
let config = configAny as? Ghostty.SurfaceConfiguration
_ = TerminalController.newTab(ghostty, from: window, withBaseConfig: config)
}
private func setDockBadge(_ label: String? = "") {
NSApp.dockTile.badgeLabel = label
NSApp.dockTile.display()
}
private func ghosttyConfigDidChange(config: Ghostty.Config) { private func ghosttyConfigDidChange(config: Ghostty.Config) {
// Update the config we need to store // Update the config we need to store
self.derivedConfig = DerivedConfig(config) self.derivedConfig = DerivedConfig(config)
@ -523,13 +745,22 @@ class AppDelegate: NSObject,
// Config could change keybindings, so update everything that depends on that // Config could change keybindings, so update everything that depends on that
syncMenuShortcuts(config) syncMenuShortcuts(config)
terminalManager.relabelAllTabs() TerminalController.all.forEach { $0.relabelTabs() }
// Config could change window appearance. We wrap this in an async queue because when // Config could change window appearance. We wrap this in an async queue because when
// this is called as part of application launch it can deadlock with an internal // this is called as part of application launch it can deadlock with an internal
// AppKit mutex on the appearance. // AppKit mutex on the appearance.
DispatchQueue.main.async { self.syncAppearance(config: config) } DispatchQueue.main.async { self.syncAppearance(config: config) }
// Decide whether to hide/unhide app from dock and app switcher
switch (config.macosHidden) {
case .never:
NSApp.setActivationPolicy(.regular)
case .always:
NSApp.setActivationPolicy(.accessory)
}
// If we have configuration errors, we need to show them. // If we have configuration errors, we need to show them.
let c = ConfigurationErrorsController.sharedInstance let c = ConfigurationErrorsController.sharedInstance
c.errors = config.errors c.errors = config.errors
@ -643,9 +874,11 @@ class AppDelegate: NSObject,
//MARK: - GhosttyAppDelegate //MARK: - GhosttyAppDelegate
func findSurface(forUUID uuid: UUID) -> Ghostty.SurfaceView? { func findSurface(forUUID uuid: UUID) -> Ghostty.SurfaceView? {
for c in terminalManager.windows { for c in TerminalController.all {
if let v = c.controller.surfaceTree?.findUUID(uuid: uuid) { for view in c.surfaceTree {
return v if view.uuid == uuid {
return view
}
} }
} }
@ -691,8 +924,12 @@ class AppDelegate: NSObject,
ghostty.reloadConfig() ghostty.reloadConfig()
} }
@IBAction func checkForUpdates(_ sender: Any?) {
updaterController.checkForUpdates(sender)
}
@IBAction func newWindow(_ sender: Any?) { @IBAction func newWindow(_ sender: Any?) {
terminalManager.newWindow() _ = TerminalController.newWindow(ghostty)
// We also activate our app so that it becomes front. This may be // We also activate our app so that it becomes front. This may be
// necessary for the dock menu. // necessary for the dock menu.
@ -700,7 +937,7 @@ class AppDelegate: NSObject,
} }
@IBAction func newTab(_ sender: Any?) { @IBAction func newTab(_ sender: Any?) {
terminalManager.newTab() _ = TerminalController.newTab(ghostty)
// We also activate our app so that it becomes front. This may be // We also activate our app so that it becomes front. This may be
// necessary for the dock menu. // necessary for the dock menu.
@ -708,7 +945,7 @@ class AppDelegate: NSObject,
} }
@IBAction func closeAllWindows(_ sender: Any?) { @IBAction func closeAllWindows(_ sender: Any?) {
terminalManager.closeAllWindows() TerminalController.closeAllWindows()
AboutController.shared.hide() AboutController.shared.hide()
} }
@ -726,14 +963,6 @@ class AppDelegate: NSObject,
} }
@IBAction func toggleQuickTerminal(_ sender: Any) { @IBAction func toggleQuickTerminal(_ sender: Any) {
if quickController == nil {
quickController = QuickTerminalController(
ghostty,
position: derivedConfig.quickTerminalPosition
)
}
guard let quickController = self.quickController else { return }
quickController.toggle() quickController.toggle()
} }
@ -762,6 +991,22 @@ class AppDelegate: NSObject,
hiddenState = nil hiddenState = nil
} }
@IBAction func bringAllToFront(_ sender: Any) {
if !NSApp.isActive {
NSApp.activate(ignoringOtherApps: true)
}
NSApplication.shared.arrangeInFront(sender)
}
@IBAction func undo(_ sender: Any?) {
undoManager.undo()
}
@IBAction func redo(_ sender: Any?) {
undoManager.redo()
}
private struct DerivedConfig { private struct DerivedConfig {
let initialWindow: Bool let initialWindow: Bool
let shouldQuitAfterLastWindowClosed: Bool let shouldQuitAfterLastWindowClosed: Bool
@ -809,3 +1054,66 @@ class AppDelegate: NSObject,
} }
} }
} }
// MARK: Floating Windows
extension AppDelegate {
func syncFloatOnTopMenu(_ window: NSWindow?) {
guard let window = (window ?? NSApp.keyWindow) as? TerminalWindow else {
// If some other window became key we always turn this off
self.menuFloatOnTop?.state = .off
return
}
self.menuFloatOnTop?.state = window.level == .floating ? .on : .off
}
@IBAction func floatOnTop(_ menuItem: NSMenuItem) {
menuItem.state = menuItem.state == .on ? .off : .on
guard let window = NSApp.keyWindow else { return }
window.level = menuItem.state == .on ? .floating : .normal
}
@IBAction func useAsDefault(_ sender: NSMenuItem) {
let ud = UserDefaults.standard
let key = TerminalWindow.defaultLevelKey
if (menuFloatOnTop?.state == .on) {
ud.set(NSWindow.Level.floating, forKey: key)
} else {
ud.removeObject(forKey: key)
}
}
}
// MARK: NSMenuItemValidation
extension AppDelegate: NSMenuItemValidation {
func validateMenuItem(_ item: NSMenuItem) -> Bool {
switch item.action {
case #selector(floatOnTop(_:)),
#selector(useAsDefault(_:)):
// Float on top items only active if the key window is a primary
// terminal window (not quick terminal).
return NSApp.keyWindow is TerminalWindow
case #selector(undo(_:)):
if undoManager.canUndo {
item.title = "Undo \(undoManager.undoActionName)"
} else {
item.title = "Undo"
}
return undoManager.canUndo
case #selector(redo(_:)):
if undoManager.canRedo {
item.title = "Redo \(undoManager.redoActionName)"
} else {
item.title = "Redo"
}
return undoManager.canRedo
default:
return true
}
}
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies> <dependencies>
<deployment identifier="macosx"/> <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.7"/>
</dependencies> </dependencies>
<objects> <objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"> <customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@ -14,14 +14,19 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="bbz-4X-AYv" userLabel="AppDelegate" customClass="AppDelegate" customModule="Ghostty" customModuleProvider="target"> <customObject id="bbz-4X-AYv" userLabel="AppDelegate" customClass="AppDelegate" customModule="Ghostty" customModuleProvider="target">
<connections> <connections>
<outlet property="menuAbout" destination="5kV-Vb-QxS" id="Y5y-UO-NK6"/>
<outlet property="menuBringAllToFront" destination="LE2-aR-0XJ" id="AP9-oK-60V"/>
<outlet property="menuChangeTitle" destination="24I-xg-qIq" id="kg6-kT-jNL"/>
<outlet property="menuCheckForUpdates" destination="GEA-5y-yzH" id="0nV-Tf-nJQ"/> <outlet property="menuCheckForUpdates" destination="GEA-5y-yzH" id="0nV-Tf-nJQ"/>
<outlet property="menuClose" destination="DVo-aG-piG" id="R3t-0C-aSU"/> <outlet property="menuClose" destination="DVo-aG-piG" id="R3t-0C-aSU"/>
<outlet property="menuCloseAllWindows" destination="yKr-Vi-Yqw" id="Zet-Ir-zbm"/> <outlet property="menuCloseAllWindows" destination="yKr-Vi-Yqw" id="Zet-Ir-zbm"/>
<outlet property="menuCloseTab" destination="Obb-Mk-j8J" id="Gda-L0-gdz"/> <outlet property="menuCloseTab" destination="Obb-Mk-j8J" id="Gda-L0-gdz"/>
<outlet property="menuCloseWindow" destination="W5w-UZ-crk" id="6ff-BT-ENV"/> <outlet property="menuCloseWindow" destination="W5w-UZ-crk" id="6ff-BT-ENV"/>
<outlet property="menuCommandPalette" destination="et6-de-Mh7" id="53t-cu-dm5"/>
<outlet property="menuCopy" destination="Jqf-pv-Zcu" id="bKd-1C-oy9"/> <outlet property="menuCopy" destination="Jqf-pv-Zcu" id="bKd-1C-oy9"/>
<outlet property="menuDecreaseFontSize" destination="kzb-SZ-dOA" id="Y1B-Vh-6Z2"/> <outlet property="menuDecreaseFontSize" destination="kzb-SZ-dOA" id="Y1B-Vh-6Z2"/>
<outlet property="menuEqualizeSplits" destination="3gH-VD-vL9" id="SiZ-ce-FOF"/> <outlet property="menuEqualizeSplits" destination="3gH-VD-vL9" id="SiZ-ce-FOF"/>
<outlet property="menuFloatOnTop" destination="uRj-7z-1Nh" id="94n-o9-Jol"/>
<outlet property="menuIncreaseFontSize" destination="CIH-ey-Z6x" id="hkc-9C-80E"/> <outlet property="menuIncreaseFontSize" destination="CIH-ey-Z6x" id="hkc-9C-80E"/>
<outlet property="menuMoveSplitDividerDown" destination="Zj7-2W-fdF" id="997-LL-nlN"/> <outlet property="menuMoveSplitDividerDown" destination="Zj7-2W-fdF" id="997-LL-nlN"/>
<outlet property="menuMoveSplitDividerLeft" destination="wSR-ny-j1a" id="HCZ-CI-2ob"/> <outlet property="menuMoveSplitDividerLeft" destination="wSR-ny-j1a" id="HCZ-CI-2ob"/>
@ -36,8 +41,10 @@
<outlet property="menuPreviousSplit" destination="Lic-px-1wg" id="Rto-CG-yRe"/> <outlet property="menuPreviousSplit" destination="Lic-px-1wg" id="Rto-CG-yRe"/>
<outlet property="menuQuickTerminal" destination="1pv-LF-NBJ" id="glN-5B-IGi"/> <outlet property="menuQuickTerminal" destination="1pv-LF-NBJ" id="glN-5B-IGi"/>
<outlet property="menuQuit" destination="4sb-4s-VLi" id="qYN-S1-6UW"/> <outlet property="menuQuit" destination="4sb-4s-VLi" id="qYN-S1-6UW"/>
<outlet property="menuRedo" destination="EX8-lB-4s7" id="wON-2J-yT1"/>
<outlet property="menuReloadConfig" destination="KKH-XX-5py" id="Wvp-7J-wqX"/> <outlet property="menuReloadConfig" destination="KKH-XX-5py" id="Wvp-7J-wqX"/>
<outlet property="menuResetFontSize" destination="Jah-MY-aLX" id="ger-qM-wrm"/> <outlet property="menuResetFontSize" destination="Jah-MY-aLX" id="ger-qM-wrm"/>
<outlet property="menuReturnToDefaultSize" destination="Gbx-Vi-OGC" id="po9-qC-Iz6"/>
<outlet property="menuSecureInput" destination="oC6-w4-qI7" id="PCc-pe-Mda"/> <outlet property="menuSecureInput" destination="oC6-w4-qI7" id="PCc-pe-Mda"/>
<outlet property="menuSelectAll" destination="q2h-lq-e4r" id="s98-r1-Jcv"/> <outlet property="menuSelectAll" destination="q2h-lq-e4r" id="s98-r1-Jcv"/>
<outlet property="menuSelectSplitAbove" destination="0yU-hC-8xF" id="aPc-lS-own"/> <outlet property="menuSelectSplitAbove" destination="0yU-hC-8xF" id="aPc-lS-own"/>
@ -45,11 +52,15 @@
<outlet property="menuSelectSplitLeft" destination="cTK-oy-KuV" id="Jpr-5q-dqz"/> <outlet property="menuSelectSplitLeft" destination="cTK-oy-KuV" id="Jpr-5q-dqz"/>
<outlet property="menuSelectSplitRight" destination="upj-mc-L7X" id="nLY-o1-lky"/> <outlet property="menuSelectSplitRight" destination="upj-mc-L7X" id="nLY-o1-lky"/>
<outlet property="menuServices" destination="aQe-vS-j8Q" id="uWQ-Wo-T1L"/> <outlet property="menuServices" destination="aQe-vS-j8Q" id="uWQ-Wo-T1L"/>
<outlet property="menuSplitDown" destination="UDZ-4y-6xL" id="fgZ-Wb-8OR"/> <outlet property="menuSplitDown" destination="UDZ-4y-6xL" id="ptr-mj-Azh"/>
<outlet property="menuSplitLeft" destination="Ppv-GP-lQU" id="Xd5-Cd-Jut"/>
<outlet property="menuSplitRight" destination="VUR-Ld-nLx" id="RxO-Zw-ovb"/> <outlet property="menuSplitRight" destination="VUR-Ld-nLx" id="RxO-Zw-ovb"/>
<outlet property="menuSplitUp" destination="Ggp-7N-GbX" id="YJF-uq-S4Y"/>
<outlet property="menuTerminalInspector" destination="QwP-M5-fvh" id="wJi-Dh-S9f"/> <outlet property="menuTerminalInspector" destination="QwP-M5-fvh" id="wJi-Dh-S9f"/>
<outlet property="menuToggleFullScreen" destination="8kY-Pi-KaY" id="yQg-6V-OO6"/> <outlet property="menuToggleFullScreen" destination="8kY-Pi-KaY" id="yQg-6V-OO6"/>
<outlet property="menuToggleVisibility" destination="DOX-wA-ilh" id="iBj-Bc-2bq"/> <outlet property="menuToggleVisibility" destination="DOX-wA-ilh" id="iBj-Bc-2bq"/>
<outlet property="menuUndo" destination="r83-CV-syt" id="bU9-0b-xgQ"/>
<outlet property="menuUseAsDefault" destination="TrB-O8-g8H" id="af4-Jh-2HU"/>
<outlet property="menuZoomSplit" destination="oPd-mn-IEH" id="wTu-jK-egI"/> <outlet property="menuZoomSplit" destination="oPd-mn-IEH" id="wTu-jK-egI"/>
</connections> </connections>
</customObject> </customObject>
@ -68,6 +79,9 @@
</menuItem> </menuItem>
<menuItem title="Check for Updates..." id="GEA-5y-yzH"> <menuItem title="Check for Updates..." id="GEA-5y-yzH">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkForUpdates:" target="bbz-4X-AYv" id="z2n-lC-48f"/>
</connections>
</menuItem> </menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/> <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"> <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW">
@ -143,10 +157,22 @@
<action selector="splitRight:" target="-1" id="cv2-Xg-FR4"/> <action selector="splitRight:" target="-1" id="cv2-Xg-FR4"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem title="Split Left" id="Ppv-GP-lQU">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="splitLeft:" target="-1" id="Cey-Mf-bD2"/>
</connections>
</menuItem>
<menuItem title="Split Down" id="UDZ-4y-6xL"> <menuItem title="Split Down" id="UDZ-4y-6xL">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
<action selector="splitDown:" target="-1" id="c6x-CF-u52"/> <action selector="splitDown:" target="-1" id="Zej-CF-6nO"/>
</connections>
</menuItem>
<menuItem title="Split Up" id="Ggp-7N-GbX">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="splitUp:" target="-1" id="bbi-dK-pOS"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem isSeparatorItem="YES" id="sjq-M1-UGS"/> <menuItem isSeparatorItem="YES" id="sjq-M1-UGS"/>
@ -181,6 +207,19 @@
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="iU4-OB-ccf"> <menu key="submenu" title="Edit" id="iU4-OB-ccf">
<items> <items>
<menuItem title="Undo" id="r83-CV-syt">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="undo:" target="-1" id="jrW-j3-OZj"/>
</connections>
</menuItem>
<menuItem title="Redo" id="EX8-lB-4s7">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="redo:" target="-1" id="7UK-Hj-s4O"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="4O9-zO-zB9"/>
<menuItem title="Copy" id="Jqf-pv-Zcu"> <menuItem title="Copy" id="Jqf-pv-Zcu">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
@ -213,18 +252,18 @@
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="View" id="m6z-2H-VW7"> <menu key="submenu" title="View" id="m6z-2H-VW7">
<items> <items>
<menuItem title="Increase Font Size" id="CIH-ey-Z6x" userLabel="Increase Font Size">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="increaseFontSize:" target="-1" id="361-5E-7PY"/>
</connections>
</menuItem>
<menuItem title="Reset Font Size" id="Jah-MY-aLX"> <menuItem title="Reset Font Size" id="Jah-MY-aLX">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
<action selector="resetFontSize:" target="-1" id="3dh-T9-IkH"/> <action selector="resetFontSize:" target="-1" id="3dh-T9-IkH"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem title="Increase Font Size" id="CIH-ey-Z6x" userLabel="Increase Font Size">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="increaseFontSize:" target="-1" id="361-5E-7PY"/>
</connections>
</menuItem>
<menuItem title="Decrease Font Size" id="kzb-SZ-dOA"> <menuItem title="Decrease Font Size" id="kzb-SZ-dOA">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
@ -232,6 +271,19 @@
</connections> </connections>
</menuItem> </menuItem>
<menuItem isSeparatorItem="YES" id="L3L-I8-sqk"/> <menuItem isSeparatorItem="YES" id="L3L-I8-sqk"/>
<menuItem title="Command Palette" id="et6-de-Mh7">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleCommandPalette:" target="-1" id="FcT-XD-gM1"/>
</connections>
</menuItem>
<menuItem title="Change Title..." id="24I-xg-qIq">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="changeTitle:" target="-1" id="XuL-QB-Q9l"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Vkj-tP-dMZ"/>
<menuItem title="Quick Terminal" id="1pv-LF-NBJ"> <menuItem title="Quick Terminal" id="1pv-LF-NBJ">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
@ -270,12 +322,6 @@
<action selector="toggleGhosttyFullScreen:" target="-1" id="QB9-7R-xyc"/> <action selector="toggleGhosttyFullScreen:" target="-1" id="QB9-7R-xyc"/>
</connections> </connections>
</menuItem> </menuItem>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
</connections>
</menuItem>
<menuItem title="Show/Hide All Terminals" id="DOX-wA-ilh"> <menuItem title="Show/Hide All Terminals" id="DOX-wA-ilh">
<modifierMask key="keyEquivalentModifierMask"/> <modifierMask key="keyEquivalentModifierMask"/>
<connections> <connections>
@ -370,6 +416,33 @@
</items> </items>
</menu> </menu>
</menuItem> </menuItem>
<menuItem isSeparatorItem="YES" id="dgt-Tx-d4e"/>
<menuItem title="Return To Default Size" id="Gbx-Vi-OGC" userLabel="Return To Default Size">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="returnToDefaultSize:" target="-1" id="Bpt-GO-UU1"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="Cm3-gn-vtj"/>
<menuItem title="Float on Top" id="uRj-7z-1Nh">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="floatOnTop:" target="bbz-4X-AYv" id="N58-PO-7pj"/>
</connections>
</menuItem>
<menuItem title="Use as Default" id="TrB-O8-g8H">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="useAsDefault:" target="bbz-4X-AYv" id="RHA-Nl-L2U"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="CpM-rI-Sc1"/>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
</connections>
</menuItem>
</items> </items>
</menu> </menu>
</menuItem> </menuItem>

View File

@ -0,0 +1,35 @@
import AppKit
import AppIntents
import GhosttyKit
struct CloseTerminalIntent: AppIntent {
static var title: LocalizedStringResource = "Close Terminal"
static var description = IntentDescription("Close an existing terminal.")
@Parameter(
title: "Terminal",
description: "The terminal to close.",
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
@MainActor
func perform() async throws -> some IntentResult {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surfaceView = terminal.surfaceView else {
throw GhosttyIntentError.surfaceNotFound
}
guard let controller = surfaceView.window?.windowController as? BaseTerminalController else {
return .result()
}
controller.closeSurface(surfaceView, withConfirmation: false)
return .result()
}
}

View File

@ -0,0 +1,38 @@
import AppKit
import AppIntents
/// App intent that invokes a command palette entry.
@available(macOS 14.0, *)
struct CommandPaletteIntent: AppIntent {
static var title: LocalizedStringResource = "Invoke Command Palette Action"
@Parameter(
title: "Terminal",
description: "The terminal to base available commands from."
)
var terminal: TerminalEntity
@Parameter(
title: "Command",
description: "The command to invoke.",
optionsProvider: CommandQuery()
)
var command: CommandEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<Bool> {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
let performed = surface.perform(action: command.action)
return .result(value: performed)
}
}

View File

@ -0,0 +1,128 @@
import AppIntents
// MARK: AppEntity
@available(macOS 14.0, *)
struct CommandEntity: AppEntity {
let id: ID
// Note: for macOS 26 we can move all the properties to @ComputedProperty.
@Property(title: "Title")
var title: String
@Property(title: "Description")
var description: String
@Property(title: "Action")
var action: String
/// The underlying data model
let command: Ghostty.Command
/// A command identifier is a composite key based on the terminal and action.
struct ID: Hashable {
let terminalId: TerminalEntity.ID
let actionKey: String
init(terminalId: TerminalEntity.ID, actionKey: String) {
self.terminalId = terminalId
self.actionKey = actionKey
}
}
static var typeDisplayRepresentation: TypeDisplayRepresentation {
TypeDisplayRepresentation(name: "Command Palette Command")
}
var displayRepresentation: DisplayRepresentation {
DisplayRepresentation(
title: LocalizedStringResource(stringLiteral: command.title),
subtitle: LocalizedStringResource(stringLiteral: command.description),
)
}
static var defaultQuery = CommandQuery()
init(_ command: Ghostty.Command, for terminal: TerminalEntity) {
self.id = .init(terminalId: terminal.id, actionKey: command.actionKey)
self.command = command
self.title = command.title
self.description = command.description
self.action = command.action
}
}
@available(macOS 14.0, *)
extension CommandEntity.ID: RawRepresentable {
var rawValue: String {
return "\(terminalId):\(actionKey)"
}
init?(rawValue: String) {
let components = rawValue.split(separator: ":", maxSplits: 1)
guard components.count == 2 else { return nil }
guard let terminalId = TerminalEntity.ID(uuidString: String(components[0])) else {
return nil
}
self.terminalId = terminalId
self.actionKey = String(components[1])
}
}
// Required by AppEntity
@available(macOS 14.0, *)
extension CommandEntity.ID: EntityIdentifierConvertible {
static func entityIdentifier(for entityIdentifierString: String) -> CommandEntity.ID? {
.init(rawValue: entityIdentifierString)
}
var entityIdentifierString: String {
rawValue
}
}
// MARK: EntityQuery
@available(macOS 14.0, *)
struct CommandQuery: EntityQuery {
// Inject our terminal parameter from our command palette intent.
@IntentParameterDependency<CommandPaletteIntent>(\.$terminal)
var commandPaletteIntent
@MainActor
func entities(for identifiers: [CommandEntity.ID]) async throws -> [CommandEntity] {
// Extract unique terminal IDs to avoid fetching duplicates
let terminalIds = Set(identifiers.map(\.terminalId))
let terminals = try await TerminalEntity.defaultQuery.entities(for: Array(terminalIds))
// Build a cache of terminals and their available commands
// This avoids repeated command fetching for the same terminal
typealias Tuple = (terminal: TerminalEntity, commands: [Ghostty.Command])
let commandMap: [TerminalEntity.ID: Tuple] =
terminals.reduce(into: [:]) { result, terminal in
guard let commands = try? terminal.surfaceModel?.commands() else { return }
result[terminal.id] = (terminal: terminal, commands: commands)
}
// Map each identifier to its corresponding CommandEntity. If a command doesn't
// exist it maps to nil and is removed via compactMap.
return identifiers.compactMap { id in
guard let (terminal, commands) = commandMap[id.terminalId],
let command = commands.first(where: { $0.actionKey == id.actionKey }) else {
return nil
}
return CommandEntity(command, for: terminal)
}
}
@MainActor
func suggestedEntities() async throws -> [CommandEntity] {
guard let terminal = commandPaletteIntent?.terminal,
let surface = terminal.surfaceModel else { return [] }
return try surface.commands().map { CommandEntity($0, for: terminal) }
}
}

View File

@ -0,0 +1,139 @@
import AppKit
import AppIntents
import SwiftUI
struct TerminalEntity: AppEntity {
let id: UUID
@Property(title: "Title")
var title: String
@Property(title: "Working Directory")
var workingDirectory: String?
@Property(title: "Kind")
var kind: Kind
@MainActor
@DeferredProperty(title: "Full Contents")
@available(macOS 26.0, *)
var screenContents: String? {
get async {
guard let surfaceView else { return nil }
return surfaceView.cachedScreenContents.get()
}
}
@MainActor
@DeferredProperty(title: "Visible Contents")
@available(macOS 26.0, *)
var visibleContents: String? {
get async {
guard let surfaceView else { return nil }
return surfaceView.cachedVisibleContents.get()
}
}
var screenshot: Image?
static var typeDisplayRepresentation: TypeDisplayRepresentation {
TypeDisplayRepresentation(name: "Terminal")
}
@MainActor
var displayRepresentation: DisplayRepresentation {
var rep = DisplayRepresentation(title: "\(title)")
if let screenshot,
let nsImage = ImageRenderer(content: screenshot).nsImage,
let data = nsImage.tiffRepresentation {
rep.image = .init(data: data)
}
return rep
}
/// Returns the view associated with this entity. This may no longer exist.
@MainActor
var surfaceView: Ghostty.SurfaceView? {
Self.defaultQuery.all.first { $0.uuid == self.id }
}
@MainActor
var surfaceModel: Ghostty.Surface? {
surfaceView?.surfaceModel
}
static var defaultQuery = TerminalQuery()
init(_ view: Ghostty.SurfaceView) {
self.id = view.uuid
self.title = view.title
self.workingDirectory = view.pwd
self.screenshot = view.screenshot()
// Determine the kind based on the window controller type
if view.window?.windowController is QuickTerminalController {
self.kind = .quick
} else {
self.kind = .normal
}
}
}
extension TerminalEntity {
enum Kind: String, AppEnum {
case normal
case quick
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Terminal Kind")
static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [
.normal: .init(title: "Normal"),
.quick: .init(title: "Quick")
]
}
}
struct TerminalQuery: EntityStringQuery, EnumerableEntityQuery {
@MainActor
func entities(for identifiers: [TerminalEntity.ID]) async throws -> [TerminalEntity] {
return all.filter {
identifiers.contains($0.uuid)
}.map {
TerminalEntity($0)
}
}
@MainActor
func entities(matching string: String) async throws -> [TerminalEntity] {
return all.filter {
$0.title.localizedCaseInsensitiveContains(string)
}.map {
TerminalEntity($0)
}
}
@MainActor
func allEntities() async throws -> [TerminalEntity] {
return all.map { TerminalEntity($0) }
}
@MainActor
func suggestedEntities() async throws -> [TerminalEntity] {
return try await allEntities()
}
@MainActor
var all: [Ghostty.SurfaceView] {
// Find all of our terminal windows. This will include the quick terminal
// but only if it was previously opened.
let controllers = NSApp.windows.compactMap {
$0.windowController as? BaseTerminalController
}
// Get all our surfaces
return controllers.flatMap {
$0.surfaceTree.root?.leaves() ?? []
}
}
}

View File

@ -0,0 +1,69 @@
import AppKit
import AppIntents
/// App intent that retrieves details about a specific terminal.
struct GetTerminalDetailsIntent: AppIntent {
static var title: LocalizedStringResource = "Get Details of Terminal"
@Parameter(
title: "Detail",
description: "The detail to extract about a terminal."
)
var detail: TerminalDetail
@Parameter(
title: "Terminal",
description: "The terminal to extract information about."
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
static var parameterSummary: some ParameterSummary {
Summary("Get \(\.$detail) from \(\.$terminal)")
}
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<String?> {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
switch detail {
case .title: return .result(value: terminal.title)
case .workingDirectory: return .result(value: terminal.workingDirectory)
case .allContents:
guard let view = terminal.surfaceView else { throw GhosttyIntentError.surfaceNotFound }
return .result(value: view.cachedScreenContents.get())
case .selectedText:
guard let view = terminal.surfaceView else { throw GhosttyIntentError.surfaceNotFound }
return .result(value: view.accessibilitySelectedText())
case .visibleText:
guard let view = terminal.surfaceView else { throw GhosttyIntentError.surfaceNotFound }
return .result(value: view.cachedVisibleContents.get())
}
}
}
// MARK: TerminalDetail
enum TerminalDetail: String {
case title
case workingDirectory
case allContents
case selectedText
case visibleText
}
extension TerminalDetail: AppEnum {
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Terminal Detail")
static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [
.title: .init(title: "Title"),
.workingDirectory: .init(title: "Working Directory"),
.allContents: .init(title: "Full Contents"),
.selectedText: .init(title: "Selected Text"),
.visibleText: .init(title: "Visible Text"),
]
}

View File

@ -0,0 +1,13 @@
enum GhosttyIntentError: Error, CustomLocalizedStringResourceConvertible {
case appUnavailable
case surfaceNotFound
case permissionDenied
var localizedStringResource: LocalizedStringResource {
switch self {
case .appUnavailable: "The Ghostty app isn't properly initialized."
case .surfaceNotFound: "The terminal no longer exists."
case .permissionDenied: "Ghostty doesn't allow Shortcuts."
}
}
}

View File

@ -0,0 +1,317 @@
import AppKit
import AppIntents
/// App intent to input text in a terminal.
struct InputTextIntent: AppIntent {
static var title: LocalizedStringResource = "Input Text to Terminal"
@Parameter(
title: "Text",
description: "The text to input to the terminal. The text will be inputted as if it was pasted.",
inputOptions: String.IntentInputOptions(
capitalizationType: .none,
multiline: true,
autocorrect: false,
smartQuotes: false,
smartDashes: false
)
)
var text: String
@Parameter(
title: "Terminal",
description: "The terminal to scope this action to."
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
@MainActor
func perform() async throws -> some IntentResult {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
surface.sendText(text)
return .result()
}
}
/// App intent to trigger a keyboard event.
struct KeyEventIntent: AppIntent {
static var title: LocalizedStringResource = "Send Keyboard Event to Terminal"
static var description = IntentDescription("Simulate a keyboard event. This will not handle text encoding; use the 'Input Text' action for that.")
@Parameter(
title: "Key",
description: "The key to send to the terminal.",
default: .enter
)
var key: Ghostty.Input.Key
@Parameter(
title: "Modifier(s)",
description: "The modifiers to send with the key event.",
default: []
)
var mods: [KeyEventMods]
@Parameter(
title: "Event Type",
description: "A key press or release.",
default: .press
)
var action: Ghostty.Input.Action
@Parameter(
title: "Terminal",
description: "The terminal to scope this action to."
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
@MainActor
func perform() async throws -> some IntentResult {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
// Convert KeyEventMods array to Ghostty.Input.Mods
let ghosttyMods = mods.reduce(Ghostty.Input.Mods()) { result, mod in
result.union(mod.ghosttyMod)
}
let keyEvent = Ghostty.Input.KeyEvent(
key: key,
action: action,
mods: ghosttyMods
)
surface.sendKeyEvent(keyEvent)
return .result()
}
}
// MARK: MouseButtonIntent
/// App intent to trigger a mouse button event.
struct MouseButtonIntent: AppIntent {
static var title: LocalizedStringResource = "Send Mouse Button Event to Terminal"
@Parameter(
title: "Button",
description: "The mouse button to press or release.",
default: .left
)
var button: Ghostty.Input.MouseButton
@Parameter(
title: "Action",
description: "Whether to press or release the button.",
default: .press
)
var action: Ghostty.Input.MouseState
@Parameter(
title: "Modifier(s)",
description: "The modifiers to send with the mouse event.",
default: []
)
var mods: [KeyEventMods]
@Parameter(
title: "Terminal",
description: "The terminal to scope this action to."
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
@MainActor
func perform() async throws -> some IntentResult {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
// Convert KeyEventMods array to Ghostty.Input.Mods
let ghosttyMods = mods.reduce(Ghostty.Input.Mods()) { result, mod in
result.union(mod.ghosttyMod)
}
let mouseEvent = Ghostty.Input.MouseButtonEvent(
action: action,
button: button,
mods: ghosttyMods
)
surface.sendMouseButton(mouseEvent)
return .result()
}
}
/// App intent to send a mouse position event.
struct MousePosIntent: AppIntent {
static var title: LocalizedStringResource = "Send Mouse Position Event to Terminal"
static var description = IntentDescription("Send a mouse position event to the terminal. This reports the cursor position for mouse tracking.")
@Parameter(
title: "X Position",
description: "The horizontal position of the mouse cursor in pixels.",
default: 0
)
var x: Double
@Parameter(
title: "Y Position",
description: "The vertical position of the mouse cursor in pixels.",
default: 0
)
var y: Double
@Parameter(
title: "Modifier(s)",
description: "The modifiers to send with the mouse position event.",
default: []
)
var mods: [KeyEventMods]
@Parameter(
title: "Terminal",
description: "The terminal to scope this action to."
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
@MainActor
func perform() async throws -> some IntentResult {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
// Convert KeyEventMods array to Ghostty.Input.Mods
let ghosttyMods = mods.reduce(Ghostty.Input.Mods()) { result, mod in
result.union(mod.ghosttyMod)
}
let mousePosEvent = Ghostty.Input.MousePosEvent(
x: x,
y: y,
mods: ghosttyMods
)
surface.sendMousePos(mousePosEvent)
return .result()
}
}
/// App intent to send a mouse scroll event.
struct MouseScrollIntent: AppIntent {
static var title: LocalizedStringResource = "Send Mouse Scroll Event to Terminal"
static var description = IntentDescription("Send a mouse scroll event to the terminal with configurable precision and momentum.")
@Parameter(
title: "X Scroll Delta",
description: "The horizontal scroll amount.",
default: 0
)
var x: Double
@Parameter(
title: "Y Scroll Delta",
description: "The vertical scroll amount.",
default: 0
)
var y: Double
@Parameter(
title: "High Precision",
description: "Whether this is a high-precision scroll event (e.g., from trackpad).",
default: false
)
var precision: Bool
@Parameter(
title: "Momentum Phase",
description: "The momentum phase for inertial scrolling.",
default: Ghostty.Input.Momentum.none
)
var momentum: Ghostty.Input.Momentum
@Parameter(
title: "Terminal",
description: "The terminal to scope this action to."
)
var terminal: TerminalEntity
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
@MainActor
func perform() async throws -> some IntentResult {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
let scrollEvent = Ghostty.Input.MouseScrollEvent(
x: x,
y: y,
mods: .init(precision: precision, momentum: momentum)
)
surface.sendMouseScroll(scrollEvent)
return .result()
}
}
// MARK: Mods
enum KeyEventMods: String, AppEnum, CaseIterable {
case shift
case control
case option
case command
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Modifier Key")
static var caseDisplayRepresentations: [KeyEventMods : DisplayRepresentation] = [
.shift: "Shift",
.control: "Control",
.option: "Option",
.command: "Command"
]
var ghosttyMod: Ghostty.Input.Mods {
switch self {
case .shift: .shift
case .control: .ctrl
case .option: .alt
case .command: .super
}
}
}

View File

@ -0,0 +1,57 @@
import AppKit
/// Requests permission for Shortcuts app to interact with Ghostty
///
/// This function displays a permission dialog asking the user to allow Shortcuts
/// to interact with Ghostty. The permission is automatically cached for 10 minutes
/// if the user selects "Allow", meaning subsequent intent calls won't show the dialog
/// again during that time period.
///
/// The permission uses a shared UserDefaults key across all intents, so granting
/// permission for one intent allows all Ghostty intents to execute without additional
/// prompts for the duration of the cache period.
///
/// - Returns: `true` if permission is granted, `false` if denied
///
/// ## Usage
/// Add this check at the beginning of any App Intent's `perform()` method:
/// ```swift
/// @MainActor
/// func perform() async throws -> some IntentResult {
/// guard await requestIntentPermission() else {
/// throw GhosttyIntentError.permissionDenied
/// }
/// // ... continue with intent implementation
/// }
/// ```
func requestIntentPermission() async -> Bool {
await withCheckedContinuation { continuation in
Task { @MainActor in
if let delegate = NSApp.delegate as? AppDelegate {
switch (delegate.ghostty.config.macosShortcuts) {
case .allow:
continuation.resume(returning: true)
return
case .deny:
continuation.resume(returning: false)
return
case .ask:
// Continue with the permission dialog
break
}
}
PermissionRequest.show(
"com.mitchellh.ghostty.shortcutsPermission",
message: "Allow Shortcuts to interact with Ghostty?",
allowDuration: .forever,
rememberDuration: nil,
) { response in
continuation.resume(returning: response)
}
}
}
}

View File

@ -0,0 +1,35 @@
import AppKit
import AppIntents
struct KeybindIntent: AppIntent {
static var title: LocalizedStringResource = "Invoke a Keybind Action"
@Parameter(
title: "Terminal",
description: "The terminal to invoke the action on."
)
var terminal: TerminalEntity
@Parameter(
title: "Action",
description: "The keybind action to invoke. This can be any valid keybind action you could put in a configuration file."
)
var action: String
@available(macOS 26.0, *)
static var supportedModes: IntentModes = [.background, .foreground]
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<Bool> {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let surface = terminal.surfaceModel else {
throw GhosttyIntentError.surfaceNotFound
}
let performed = surface.perform(action: action)
return .result(value: performed)
}
}

View File

@ -0,0 +1,168 @@
import AppKit
import AppIntents
import GhosttyKit
/// App intent that allows creating a new terminal window or tab.
///
/// This requires macOS 15 or greater because we use features of macOS 15 here.
@available(macOS 15.0, *)
struct NewTerminalIntent: AppIntent {
static var title: LocalizedStringResource = "New Terminal"
static var description = IntentDescription("Create a new terminal.")
@Parameter(
title: "Location",
description: "The location that the terminal should be created.",
default: .window
)
var location: NewTerminalLocation
@Parameter(
title: "Command",
description: "Command to execute within your configured shell.",
)
var command: String?
@Parameter(
title: "Working Directory",
description: "The working directory to open in the terminal.",
supportedContentTypes: [.folder]
)
var workingDirectory: IntentFile?
@Parameter(
title: "Environment Variables",
description: "Environment variables in `KEY=VALUE` format.",
default: []
)
var env: [String]
@Parameter(
title: "Parent Terminal",
description: "The terminal to inherit the base configuration from."
)
var parent: TerminalEntity?
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .foreground(.immediate)
@available(macOS, obsoleted: 26.0, message: "Replaced by supportedModes")
static var openAppWhenRun = true
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<TerminalEntity?> {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let appDelegate = NSApp.delegate as? AppDelegate else {
throw GhosttyIntentError.appUnavailable
}
let ghostty = appDelegate.ghostty
var config = Ghostty.SurfaceConfiguration()
// We don't run command as "command" and instead use "initialInput" so
// that we can get all the login scripts to setup things like PATH.
if let command {
config.initialInput = "\(command); exit\n"
}
// If we were given a working directory then open that directory
if let url = workingDirectory?.fileURL {
let dir = url.hasDirectoryPath ? url : url.deletingLastPathComponent()
config.workingDirectory = dir.path(percentEncoded: false)
}
// Parse environment variables from KEY=VALUE format
for envVar in env {
if let separatorIndex = envVar.firstIndex(of: "=") {
let key = String(envVar[..<separatorIndex])
let value = String(envVar[envVar.index(after: separatorIndex)...])
config.environmentVariables[key] = value
}
}
// Determine if we have a parent and get it
let parent: Ghostty.SurfaceView?
if let parentParam = self.parent {
guard let view = parentParam.surfaceView else {
throw GhosttyIntentError.surfaceNotFound
}
parent = view
} else if let preferred = TerminalController.preferredParent {
parent = preferred.focusedSurface ?? preferred.surfaceTree.root?.leftmostLeaf()
} else {
parent = nil
}
switch location {
case .window:
let newController = TerminalController.newWindow(
ghostty,
withBaseConfig: config,
withParent: parent?.window)
if let view = newController.surfaceTree.root?.leftmostLeaf() {
return .result(value: TerminalEntity(view))
}
case .tab:
let newController = TerminalController.newTab(
ghostty,
from: parent?.window,
withBaseConfig: config)
if let view = newController?.surfaceTree.root?.leftmostLeaf() {
return .result(value: TerminalEntity(view))
}
case .splitLeft, .splitRight, .splitUp, .splitDown:
guard let parent,
let controller = parent.window?.windowController as? BaseTerminalController else {
throw GhosttyIntentError.surfaceNotFound
}
if let view = controller.newSplit(
at: parent,
direction: location.splitDirection!
) {
return .result(value: TerminalEntity(view))
}
}
return .result(value: .none)
}
}
// MARK: NewTerminalLocation
enum NewTerminalLocation: String {
case tab
case window
case splitLeft = "split:left"
case splitRight = "split:right"
case splitUp = "split:up"
case splitDown = "split:down"
var splitDirection: SplitTree<Ghostty.SurfaceView>.NewDirection? {
switch self {
case .splitLeft: return .left
case .splitRight: return .right
case .splitUp: return .up
case .splitDown: return .down
default: return nil
}
}
}
extension NewTerminalLocation: AppEnum {
static var typeDisplayRepresentation = TypeDisplayRepresentation(name: "Terminal Location")
static var caseDisplayRepresentations: [Self: DisplayRepresentation] = [
.tab: .init(title: "Tab"),
.window: .init(title: "Window"),
.splitLeft: .init(title: "Split Left"),
.splitRight: .init(title: "Split Right"),
.splitUp: .init(title: "Split Up"),
.splitDown: .init(title: "Split Down"),
]
}

View File

@ -0,0 +1,32 @@
import AppKit
import AppIntents
struct QuickTerminalIntent: AppIntent {
static var title: LocalizedStringResource = "Open the Quick Terminal"
static var description = IntentDescription("Open the Quick Terminal. If it is already open, then do nothing.")
@available(macOS 26.0, *)
static var supportedModes: IntentModes = .background
@MainActor
func perform() async throws -> some IntentResult & ReturnsValue<[TerminalEntity]> {
guard await requestIntentPermission() else {
throw GhosttyIntentError.permissionDenied
}
guard let delegate = NSApp.delegate as? AppDelegate else {
throw GhosttyIntentError.appUnavailable
}
// This is safe to call even if it is already shown.
let c = delegate.quickController
c.animateIn()
// Grab all our terminals
let terminals = c.surfaceTree.root?.leaves().map {
TerminalEntity($0)
} ?? []
return .result(value: terminals)
}
}

View File

@ -4,12 +4,26 @@ extension View {
/// Returns the ghostty icon to use for views. /// Returns the ghostty icon to use for views.
func ghosttyIconImage() -> Image { func ghosttyIconImage() -> Image {
#if os(macOS) #if os(macOS)
// If we have a specific icon set, then use that
if let delegate = NSApplication.shared.delegate as? AppDelegate, if let delegate = NSApplication.shared.delegate as? AppDelegate,
let nsImage = delegate.appIcon { let nsImage = delegate.appIcon {
return Image(nsImage: nsImage) return Image(nsImage: nsImage)
} }
// Grab the icon from the running application. This is the best way
// I've found so far to get the proper icon for our current icon
// tinting and so on with macOS Tahoe
if let icon = NSRunningApplication.current.icon {
return Image(nsImage: icon)
}
// Get our defined application icon image.
if let nsImage = NSApp.applicationIconImage {
return Image(nsImage: nsImage)
}
#endif #endif
// Fall back to a static representation
return Image("AppIconImage") return Image("AppIconImage")
} }
} }

View File

@ -0,0 +1,276 @@
import SwiftUI
struct CommandOption: Identifiable, Hashable {
let id = UUID()
let title: String
let description: String?
let symbols: [String]?
let action: () -> Void
static func == (lhs: CommandOption, rhs: CommandOption) -> Bool {
lhs.id == rhs.id
}
func hash(into hasher: inout Hasher) {
hasher.combine(id)
}
}
struct CommandPaletteView: View {
@Binding var isPresented: Bool
var backgroundColor: Color = Color(nsColor: .windowBackgroundColor)
var options: [CommandOption]
@State private var query = ""
@State private var selectedIndex: UInt?
@State private var hoveredOptionID: UUID?
// The options that we should show, taking into account any filtering from
// the query.
var filteredOptions: [CommandOption] {
if query.isEmpty {
return options
} else {
return options.filter { $0.title.localizedCaseInsensitiveContains(query) }
}
}
var selectedOption: CommandOption? {
guard let selectedIndex else { return nil }
return if selectedIndex < filteredOptions.count {
filteredOptions[Int(selectedIndex)]
} else {
filteredOptions.last
}
}
var body: some View {
let scheme: ColorScheme = if OSColor(backgroundColor).isLightColor {
.light
} else {
.dark
}
VStack(alignment: .leading, spacing: 0) {
CommandPaletteQuery(query: $query) { event in
switch (event) {
case .exit:
isPresented = false
case .submit:
isPresented = false
selectedOption?.action()
case .move(.up):
if filteredOptions.isEmpty { break }
let current = selectedIndex ?? UInt(filteredOptions.count)
selectedIndex = (current == 0)
? UInt(filteredOptions.count - 1)
: current - 1
case .move(.down):
if filteredOptions.isEmpty { break }
let current = selectedIndex ?? UInt.max
selectedIndex = (current >= UInt(filteredOptions.count - 1))
? 0
: current + 1
case .move(_):
// Unknown, ignore
break
}
}
.onChange(of: query) { newValue in
// If the user types a query then we want to make sure the first
// value is selected. If the user clears the query and we were selecting
// the first, we unset any selection.
if !newValue.isEmpty {
if selectedIndex == nil {
selectedIndex = 0
}
} else {
if let selectedIndex, selectedIndex == 0 {
self.selectedIndex = nil
}
}
}
Divider()
CommandTable(
options: filteredOptions,
selectedIndex: $selectedIndex,
hoveredOptionID: $hoveredOptionID) { option in
isPresented = false
option.action()
}
}
.frame(maxWidth: 500)
.background(
ZStack {
Rectangle()
.fill(.ultraThinMaterial)
Rectangle()
.fill(backgroundColor)
.blendMode(.color)
}
.compositingGroup()
)
.clipShape(RoundedRectangle(cornerRadius: 10))
.overlay(
RoundedRectangle(cornerRadius: 10)
.stroke(Color(nsColor: .tertiaryLabelColor).opacity(0.75))
)
.shadow(radius: 32, x: 0, y: 12)
.padding()
.environment(\.colorScheme, scheme)
}
}
/// The text field for building the query for the command palette.
fileprivate struct CommandPaletteQuery: View {
@Binding var query: String
var onEvent: ((KeyboardEvent) -> Void)? = nil
@FocusState private var isTextFieldFocused: Bool
enum KeyboardEvent {
case exit
case submit
case move(MoveCommandDirection)
}
var body: some View {
ZStack {
Group {
Button { onEvent?(.move(.up)) } label: { Color.clear }
.buttonStyle(PlainButtonStyle())
.keyboardShortcut(.upArrow, modifiers: [])
Button { onEvent?(.move(.down)) } label: { Color.clear }
.buttonStyle(PlainButtonStyle())
.keyboardShortcut(.downArrow, modifiers: [])
Button { onEvent?(.move(.up)) } label: { Color.clear }
.buttonStyle(PlainButtonStyle())
.keyboardShortcut(.init("p"), modifiers: [.control])
Button { onEvent?(.move(.down)) } label: { Color.clear }
.buttonStyle(PlainButtonStyle())
.keyboardShortcut(.init("n"), modifiers: [.control])
}
.frame(width: 0, height: 0)
.accessibilityHidden(true)
TextField("Execute a command…", text: $query)
.padding()
.font(.system(size: 20, weight: .light))
.frame(height: 48)
.textFieldStyle(.plain)
.focused($isTextFieldFocused)
.onAppear {
isTextFieldFocused = true
}
.onChange(of: isTextFieldFocused) { focused in
if !focused {
onEvent?(.exit)
}
}
.onExitCommand { onEvent?(.exit) }
.onMoveCommand { onEvent?(.move($0)) }
.onSubmit { onEvent?(.submit) }
}
}
}
fileprivate struct CommandTable: View {
var options: [CommandOption]
@Binding var selectedIndex: UInt?
@Binding var hoveredOptionID: UUID?
var action: (CommandOption) -> Void
var body: some View {
if options.isEmpty {
Text("No matches")
.foregroundStyle(.secondary)
.padding()
} else {
ScrollViewReader { proxy in
ScrollView {
VStack(alignment: .leading, spacing: 0) {
ForEach(Array(options.enumerated()), id: \.1.id) { index, option in
CommandRow(
option: option,
isSelected: {
if let selected = selectedIndex {
return selected == index ||
(selected >= options.count &&
index == options.count - 1)
} else {
return false
}
}(),
hoveredID: $hoveredOptionID
) {
action(option)
}
}
}
.padding(10)
}
.frame(maxHeight: 200)
.onChange(of: selectedIndex) { _ in
guard let selectedIndex,
selectedIndex < options.count else { return }
proxy.scrollTo(
options[Int(selectedIndex)].id)
}
}
}
}
}
/// A single row in the command palette.
fileprivate struct CommandRow: View {
let option: CommandOption
var isSelected: Bool
@Binding var hoveredID: UUID?
var action: () -> Void
var body: some View {
Button(action: action) {
HStack {
Text(option.title)
Spacer()
if let symbols = option.symbols {
ShortcutSymbolsView(symbols: symbols)
.foregroundStyle(.secondary)
}
}
.padding(8)
.background(
isSelected
? Color.accentColor.opacity(0.2)
: (hoveredID == option.id
? Color.secondary.opacity(0.2)
: Color.clear)
)
.cornerRadius(5)
}
.help(option.description ?? "")
.buttonStyle(.plain)
.onHover { hovering in
hoveredID = hovering ? option.id : nil
}
}
}
/// A row of Text representing a shortcut.
fileprivate struct ShortcutSymbolsView: View {
let symbols: [String]
var body: some View {
HStack(spacing: 1) {
ForEach(symbols, id: \.self) { symbol in
Text(symbol)
.frame(minWidth: 13)
}
}
}
}

View File

@ -0,0 +1,92 @@
import SwiftUI
import GhosttyKit
struct TerminalCommandPaletteView: View {
/// The surface that this command palette represents.
let surfaceView: Ghostty.SurfaceView
/// Set this to true to show the view, this will be set to false if any actions
/// result in the view disappearing.
@Binding var isPresented: Bool
/// The configuration so we can lookup keyboard shortcuts.
@ObservedObject var ghosttyConfig: Ghostty.Config
/// The callback when an action is submitted.
var onAction: ((String) -> Void)
// The commands available to the command palette.
private var commandOptions: [CommandOption] {
guard let surface = surfaceView.surfaceModel else { return [] }
do {
return try surface.commands().map { c in
return CommandOption(
title: c.title,
description: c.description,
symbols: ghosttyConfig.keyboardShortcut(for: c.action)?.keyList
) {
onAction(c.action)
}
}
} catch {
return []
}
}
var body: some View {
ZStack {
if isPresented {
GeometryReader { geometry in
VStack {
Spacer().frame(height: geometry.size.height * 0.05)
ResponderChainInjector(responder: surfaceView)
.frame(width: 0, height: 0)
CommandPaletteView(
isPresented: $isPresented,
backgroundColor: ghosttyConfig.backgroundColor,
options: commandOptions
)
.transition(
.move(edge: .top)
.combined(with: .opacity)
.animation(.spring(response: 0.4, dampingFraction: 0.8))
) // Spring animation
.zIndex(1) // Ensure it's on top
Spacer()
}
.frame(width: geometry.size.width, height: geometry.size.height, alignment: .top)
}
}
}
.onChange(of: isPresented) { newValue in
// When the command palette disappears we need to send focus back to the
// surface view we were overlaid on top of. There's probably a better way
// to handle the first responder state here but I don't know it.
if !newValue {
// Has to be on queue because onChange happens on a user-interactive
// thread and Xcode is mad about this call on that.
DispatchQueue.main.async {
surfaceView.window?.makeFirstResponder(surfaceView)
}
}
}
}
}
/// This is done to ensure that the given view is in the responder chain.
fileprivate struct ResponderChainInjector: NSViewRepresentable {
let responder: NSResponder
func makeNSView(context: Context) -> NSView {
let dummy = NSView()
DispatchQueue.main.async {
dummy.nextResponder = responder
}
return dummy
}
func updateNSView(_ nsView: NSView, context: Context) {}
}

View File

@ -141,12 +141,7 @@ fileprivate func cgEventFlagsChangedHandler(
guard let event: NSEvent = .init(cgEvent: cgEvent) else { return result } guard let event: NSEvent = .init(cgEvent: cgEvent) else { return result }
// Build our event input and call ghostty // Build our event input and call ghostty
var key_ev = ghostty_input_key_s() let key_ev = event.ghosttyKeyEvent(GHOSTTY_ACTION_PRESS)
key_ev.action = GHOSTTY_ACTION_PRESS
key_ev.mods = Ghostty.ghosttyMods(event.modifierFlags)
key_ev.keycode = UInt32(event.keyCode)
key_ev.text = nil
key_ev.composing = false
if (ghostty_app_key(ghostty, key_ev)) { if (ghostty_app_key(ghostty, key_ev)) {
GlobalEventTap.logger.info("global key event handled event=\(event)") GlobalEventTap.logger.info("global key event handled event=\(event)")
return nil return nil

View File

@ -3,12 +3,6 @@ import Cocoa
import SwiftUI import SwiftUI
import GhosttyKit import GhosttyKit
// This is a Apple's private function that we need to call to get the active space.
@_silgen_name("CGSGetActiveSpace")
func CGSGetActiveSpace(_ cid: Int) -> size_t
@_silgen_name("CGSMainConnectionID")
func CGSMainConnectionID() -> Int
/// Controller for the "quick" terminal. /// Controller for the "quick" terminal.
class QuickTerminalController: BaseTerminalController { class QuickTerminalController: BaseTerminalController {
override var windowNibName: NSNib.Name? { "QuickTerminal" } override var windowNibName: NSNib.Name? { "QuickTerminal" }
@ -25,7 +19,15 @@ class QuickTerminalController: BaseTerminalController {
private var previousApp: NSRunningApplication? = nil private var previousApp: NSRunningApplication? = nil
// The active space when the quick terminal was last shown. // The active space when the quick terminal was last shown.
private var previousActiveSpace: size_t = 0 private var previousActiveSpace: CGSSpace? = nil
/// The window frame saved when the quick terminal's surface tree becomes empty.
///
/// This preserves the user's window size and position when all terminal surfaces
/// are closed (e.g., via the `exit` command). When a new surface is created,
/// the window will be restored to this frame, preventing SwiftUI from resetting
/// the window to its default minimum size.
private var lastClosedFrame: NSRect? = nil
/// Non-nil if we have hidden dock state. /// Non-nil if we have hidden dock state.
private var hiddenDock: HiddenDock? = nil private var hiddenDock: HiddenDock? = nil
@ -36,11 +38,15 @@ class QuickTerminalController: BaseTerminalController {
init(_ ghostty: Ghostty.App, init(_ ghostty: Ghostty.App,
position: QuickTerminalPosition = .top, position: QuickTerminalPosition = .top,
baseConfig base: Ghostty.SurfaceConfiguration? = nil, baseConfig base: Ghostty.SurfaceConfiguration? = nil,
surfaceTree tree: Ghostty.SplitNode? = nil surfaceTree tree: SplitTree<Ghostty.SurfaceView>? = nil
) { ) {
self.position = position self.position = position
self.derivedConfig = DerivedConfig(ghostty.config) self.derivedConfig = DerivedConfig(ghostty.config)
super.init(ghostty, baseConfig: base, surfaceTree: tree)
// Important detail here: we initialize with an empty surface tree so
// that we don't start a terminal process. This gets started when the
// first terminal is shown in `animateIn`.
super.init(ghostty, baseConfig: base, surfaceTree: .init())
// Setup our notifications for behaviors // Setup our notifications for behaviors
let center = NotificationCenter.default let center = NotificationCenter.default
@ -51,7 +57,7 @@ class QuickTerminalController: BaseTerminalController {
object: nil) object: nil)
center.addObserver( center.addObserver(
self, self,
selector: #selector(onToggleFullscreen), selector: #selector(onToggleFullscreen(notification:)),
name: Ghostty.Notification.ghosttyToggleFullscreen, name: Ghostty.Notification.ghosttyToggleFullscreen,
object: nil) object: nil)
center.addObserver( center.addObserver(
@ -59,6 +65,17 @@ class QuickTerminalController: BaseTerminalController {
selector: #selector(ghosttyConfigDidChange(_:)), selector: #selector(ghosttyConfigDidChange(_:)),
name: .ghosttyConfigDidChange, name: .ghosttyConfigDidChange,
object: nil) object: nil)
center.addObserver(
self,
selector: #selector(closeWindow(_:)),
name: .ghosttyCloseWindow,
object: nil
)
center.addObserver(
self,
selector: #selector(onNewTab),
name: Ghostty.Notification.ghosttyNewTab,
object: nil)
} }
required init?(coder: NSCoder) { required init?(coder: NSCoder) {
@ -149,14 +166,24 @@ class QuickTerminalController: BaseTerminalController {
animateOut() animateOut()
case .move: case .move:
let currentActiveSpace = CGSGetActiveSpace(CGSMainConnectionID()) let currentActiveSpace = CGSSpace.active()
if previousActiveSpace == currentActiveSpace { if previousActiveSpace == currentActiveSpace {
// We haven't moved spaces. We lost focus to another app on the // We haven't moved spaces. We lost focus to another app on the
// current space. Animate out. // current space. Animate out.
animateOut() animateOut()
} else { } else {
// We've moved to a different space. Bring the quick terminal back // We've moved to a different space.
// into view.
// If we're fullscreen, we need to exit fullscreen because the visible
// bounds may have changed causing a new behavior.
if let fullscreenStyle, fullscreenStyle.isFullscreen {
fullscreenStyle.exit()
DispatchQueue.main.async {
self.onToggleFullscreen()
}
}
// Make the window visible again on this space
DispatchQueue.main.async { DispatchQueue.main.async {
self.window?.makeKeyAndOrderFront(nil) self.window?.makeKeyAndOrderFront(nil)
} }
@ -176,13 +203,51 @@ class QuickTerminalController: BaseTerminalController {
// MARK: Base Controller Overrides // MARK: Base Controller Overrides
override func surfaceTreeDidChange(from: Ghostty.SplitNode?, to: Ghostty.SplitNode?) { override func surfaceTreeDidChange(from: SplitTree<Ghostty.SurfaceView>, to: SplitTree<Ghostty.SurfaceView>) {
super.surfaceTreeDidChange(from: from, to: to) super.surfaceTreeDidChange(from: from, to: to)
// If our surface tree is nil then we animate the window out. // If our surface tree is nil then we animate the window out. We
if (to == nil) { // defer reinitializing the tree to save some memory here.
if to.isEmpty {
animateOut() animateOut()
return
} }
// If we're not empty (e.g. this isn't the first set) and we're
// not visible, then we animate in. This allows us to show the quick
// terminal when things such as undo/redo are done.
if !from.isEmpty && !visible {
animateIn()
return
}
}
override func closeSurface(
_ node: SplitTree<Ghostty.SurfaceView>.Node,
withConfirmation: Bool = true
) {
// If this isn't the root then we're dealing with a split closure.
if surfaceTree.root != node {
super.closeSurface(node, withConfirmation: withConfirmation)
return
}
// If this isn't a final leaf then we're dealing with a split closure
guard case .leaf(let surface) = node else {
super.closeSurface(node, withConfirmation: withConfirmation)
return
}
// If its the root, we check if the process exited. If it did,
// then we do empty the tree.
if surface.processExited {
surfaceTree = .init()
return
}
// If its the root then we just animate out. We never actually allow
// the surface to fully close.
animateOut()
} }
// MARK: Methods // MARK: Methods
@ -219,19 +284,20 @@ class QuickTerminalController: BaseTerminalController {
} }
// Set previous active space // Set previous active space
self.previousActiveSpace = CGSGetActiveSpace(CGSMainConnectionID()) self.previousActiveSpace = CGSSpace.active()
// If our surface tree is empty then we initialize a new terminal. The surface
// tree can be empty if for example we run "exit" in the terminal and force
// animate out.
if surfaceTree.isEmpty,
let ghostty_app = ghostty.app {
let view = Ghostty.SurfaceView(ghostty_app, baseConfig: nil)
surfaceTree = SplitTree(view: view)
focusedSurface = view
}
// Animate the window in // Animate the window in
animateWindowIn(window: window, from: position) animateWindowIn(window: window, from: position)
// If our surface tree is nil then we initialize a new terminal. The surface
// tree can be nil if for example we run "eixt" in the terminal and force
// animate out.
if (surfaceTree == nil) {
let leaf: Ghostty.SplitNode.Leaf = .init(ghostty.app!, baseConfig: nil)
surfaceTree = .leaf(leaf)
focusedSurface = leaf.surface
}
} }
func animateOut() { func animateOut() {
@ -253,6 +319,12 @@ class QuickTerminalController: BaseTerminalController {
private func animateWindowIn(window: NSWindow, from position: QuickTerminalPosition) { private func animateWindowIn(window: NSWindow, from position: QuickTerminalPosition) {
guard let screen = derivedConfig.quickTerminalScreen.screen else { return } guard let screen = derivedConfig.quickTerminalScreen.screen else { return }
// Restore our previous frame if we have one
if let lastClosedFrame {
window.setFrame(lastClosedFrame, display: false)
self.lastClosedFrame = nil
}
// Move our window off screen to the top // Move our window off screen to the top
position.setInitial(in: window, on: screen) position.setInitial(in: window, on: screen)
@ -363,6 +435,12 @@ class QuickTerminalController: BaseTerminalController {
} }
private func animateWindowOut(window: NSWindow, to position: QuickTerminalPosition) { private func animateWindowOut(window: NSWindow, to position: QuickTerminalPosition) {
// Save the current window frame before animating out. This preserves
// the user's preferred window size and position for when the quick
// terminal is reactivated with a new surface. Without this, SwiftUI
// would reset the window to its minimum content size.
lastClosedFrame = window.frame
// If we hid the dock then we unhide it. // If we hid the dock then we unhide it.
hiddenDock = nil hiddenDock = nil
@ -437,14 +515,7 @@ class QuickTerminalController: BaseTerminalController {
} }
} }
// MARK: First Responder private func showNoNewTabAlert() {
@IBAction override func closeWindow(_ sender: Any) {
// Instead of closing the window, we animate it out.
animateOut()
}
@IBAction func newTab(_ sender: Any?) {
guard let window else { return } guard let window else { return }
let alert = NSAlert() let alert = NSAlert()
alert.messageText = "Cannot Create New Tab" alert.messageText = "Cannot Create New Tab"
@ -454,11 +525,27 @@ class QuickTerminalController: BaseTerminalController {
alert.beginSheetModal(for: window) alert.beginSheetModal(for: window)
} }
// MARK: First Responder
@IBAction override func closeWindow(_ sender: Any) {
// Instead of closing the window, we animate it out.
animateOut()
}
@IBAction func newTab(_ sender: Any?) {
showNoNewTabAlert()
}
@IBAction func toggleGhosttyFullScreen(_ sender: Any) { @IBAction func toggleGhosttyFullScreen(_ sender: Any) {
guard let surface = focusedSurface?.surface else { return } guard let surface = focusedSurface?.surface else { return }
ghostty.toggleFullscreen(surface: surface) ghostty.toggleFullscreen(surface: surface)
} }
@IBAction func toggleTerminalInspector(_ sender: Any?) {
guard let surface = focusedSurface?.surface else { return }
ghostty.toggleTerminalInspector(surface: surface)
}
// MARK: Notifications // MARK: Notifications
@objc private func applicationWillTerminate(_ notification: Notification) { @objc private func applicationWillTerminate(_ notification: Notification) {
@ -471,9 +558,29 @@ class QuickTerminalController: BaseTerminalController {
@objc private func onToggleFullscreen(notification: SwiftUI.Notification) { @objc private func onToggleFullscreen(notification: SwiftUI.Notification) {
guard let target = notification.object as? Ghostty.SurfaceView else { return } guard let target = notification.object as? Ghostty.SurfaceView else { return }
guard target == self.focusedSurface else { return } guard target == self.focusedSurface else { return }
onToggleFullscreen()
}
// We ignore the requested mode and always use non-native for the quick terminal private func onToggleFullscreen() {
toggleFullscreen(mode: .nonNative) // We ignore the configured fullscreen style and always use non-native
// because the way the quick terminal works doesn't support native.
let mode: FullscreenMode
if (NSApp.isFrontmost) {
// If we're frontmost and we have a notch then we keep padding
// so all lines of the terminal are visible.
if (window?.screen?.hasNotch ?? false) {
mode = .nonNativePaddedNotch
} else {
mode = .nonNative
}
} else {
// An additional detail is that if the is NOT frontmost, then our
// NSApp.presentationOptions will not take effect so we must always
// do the visible menu mode since we can't get rid of the menu.
mode = .nonNativeVisibleMenu
}
toggleFullscreen(mode: mode)
} }
@objc private func ghosttyConfigDidChange(_ notification: Notification) { @objc private func ghosttyConfigDidChange(_ notification: Notification) {
@ -492,6 +599,14 @@ class QuickTerminalController: BaseTerminalController {
syncAppearance() syncAppearance()
} }
@objc private func onNewTab(notification: SwiftUI.Notification) {
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
guard let window = surfaceView.window else { return }
guard window.windowController is QuickTerminalController else { return }
// Tabs aren't supported with Quick Terminals or derivatives
showNoNewTabAlert()
}
private struct DerivedConfig { private struct DerivedConfig {
let quickTerminalScreen: QuickTerminalScreen let quickTerminalScreen: QuickTerminalScreen
let quickTerminalAnimationDuration: Double let quickTerminalAnimationDuration: Double

View File

@ -5,7 +5,7 @@ class ServiceProvider: NSObject {
static private let errorNoString = NSString(string: "Could not load any text from the clipboard.") static private let errorNoString = NSString(string: "Could not load any text from the clipboard.")
/// The target for an open operation /// The target for an open operation
enum OpenTarget { private enum OpenTarget {
case tab case tab
case window case window
} }
@ -15,7 +15,7 @@ class ServiceProvider: NSObject {
userData: String?, userData: String?,
error: AutoreleasingUnsafeMutablePointer<NSString> error: AutoreleasingUnsafeMutablePointer<NSString>
) { ) {
openTerminalFromPasteboard(pasteboard: pasteboard, target: .tab, error: error) openTerminal(from: pasteboard, target: .tab, error: error)
} }
@objc func openWindow( @objc func openWindow(
@ -23,45 +23,39 @@ class ServiceProvider: NSObject {
userData: String?, userData: String?,
error: AutoreleasingUnsafeMutablePointer<NSString> error: AutoreleasingUnsafeMutablePointer<NSString>
) { ) {
openTerminalFromPasteboard(pasteboard: pasteboard, target: .window, error: error) openTerminal(from: pasteboard, target: .window, error: error)
} }
@inline(__always) private func openTerminal(
private func openTerminalFromPasteboard( from pasteboard: NSPasteboard,
pasteboard: NSPasteboard,
target: OpenTarget, target: OpenTarget,
error: AutoreleasingUnsafeMutablePointer<NSString> error: AutoreleasingUnsafeMutablePointer<NSString>
) { ) {
guard let objs = pasteboard.readObjects(forClasses: [NSURL.self]) as? [NSURL] else { guard let delegate = NSApp.delegate as? AppDelegate else { return }
guard let pathURLs = pasteboard.readObjects(forClasses: [NSURL.self]) as? [URL] else {
error.pointee = Self.errorNoString error.pointee = Self.errorNoString
return return
} }
let filePaths = objs.map { $0.path }.compactMap { $0 }
openTerminal(filePaths, target: target) // Build a set of unique directory URLs to open. File paths are truncated
} // to their directories because that's the only thing we can open.
let directoryURLs = Set(
pathURLs.map { url -> URL in
url.hasDirectoryPath ? url : url.deletingLastPathComponent()
}
)
private func openTerminal(_ paths: [String], target: OpenTarget) { for url in directoryURLs {
guard let delegateRaw = NSApp.delegate else { return }
guard let delegate = delegateRaw as? AppDelegate else { return }
let terminalManager = delegate.terminalManager
for path in paths {
// We only open in directories.
var isDirectory = ObjCBool(true)
guard FileManager.default.fileExists(atPath: path, isDirectory: &isDirectory) else { continue }
guard isDirectory.boolValue else { continue }
// Build our config
var config = Ghostty.SurfaceConfiguration() var config = Ghostty.SurfaceConfiguration()
config.workingDirectory = path config.workingDirectory = url.path(percentEncoded: false)
switch (target) { switch (target) {
case .window: case .window:
terminalManager.newWindow(withBaseConfig: config) _ = TerminalController.newWindow(delegate.ghostty, withBaseConfig: config)
case .tab: case .tab:
terminalManager.newTab(withBaseConfig: config) _ = TerminalController.newTab(delegate.ghostty, withBaseConfig: config)
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -7,6 +7,7 @@ extension SplitView {
let visibleSize: CGFloat let visibleSize: CGFloat
let invisibleSize: CGFloat let invisibleSize: CGFloat
let color: Color let color: Color
@Binding var split: CGFloat
private var visibleWidth: CGFloat? { private var visibleWidth: CGFloat? {
switch (direction) { switch (direction) {
@ -79,6 +80,40 @@ extension SplitView {
NSCursor.pop() NSCursor.pop()
} }
} }
.accessibilityElement(children: .ignore)
.accessibilityLabel(axLabel)
.accessibilityValue("\(Int(split * 100))%")
.accessibilityHint(axHint)
.accessibilityAddTraits(.isButton)
.accessibilityAdjustableAction { direction in
let adjustment: CGFloat = 0.025
switch direction {
case .increment:
split = min(split + adjustment, 0.9)
case .decrement:
split = max(split - adjustment, 0.1)
@unknown default:
break
}
}
}
private var axLabel: String {
switch direction {
case .horizontal:
return "Horizontal split divider"
case .vertical:
return "Vertical split divider"
}
}
private var axHint: String {
switch direction {
case .horizontal:
return "Drag to resize the left and right panes"
case .vertical:
return "Drag to resize the top and bottom panes"
}
} }
} }
} }

View File

@ -1,5 +1,4 @@
import SwiftUI import SwiftUI
import Combine
/// A split view shows a left and right (or top and bottom) view with a divider in the middle to do resizing. /// A split view shows a left and right (or top and bottom) view with a divider in the middle to do resizing.
/// The terminlogy "left" and "right" is always used but for vertical splits "left" is "top" and "right" is "bottom". /// The terminlogy "left" and "right" is always used but for vertical splits "left" is "top" and "right" is "bottom".
@ -13,12 +12,10 @@ struct SplitView<L: View, R: View>: View {
/// Divider color /// Divider color
let dividerColor: Color let dividerColor: Color
/// If set, the split view supports programmatic resizing via events sent via the publisher.
/// Minimum increment (in points) that this split can be resized by, in /// Minimum increment (in points) that this split can be resized by, in
/// each direction. Both `height` and `width` should be whole numbers /// each direction. Both `height` and `width` should be whole numbers
/// greater than or equal to 1.0 /// greater than or equal to 1.0
let resizeIncrements: NSSize let resizeIncrements: NSSize
let resizePublisher: PassthroughSubject<Double, Never>
/// The left and right views to render. /// The left and right views to render.
let left: L let left: L
@ -45,47 +42,32 @@ struct SplitView<L: View, R: View>: View {
left left
.frame(width: leftRect.size.width, height: leftRect.size.height) .frame(width: leftRect.size.width, height: leftRect.size.height)
.offset(x: leftRect.origin.x, y: leftRect.origin.y) .offset(x: leftRect.origin.x, y: leftRect.origin.y)
.accessibilityElement(children: .contain)
.accessibilityLabel(leftPaneLabel)
right right
.frame(width: rightRect.size.width, height: rightRect.size.height) .frame(width: rightRect.size.width, height: rightRect.size.height)
.offset(x: rightRect.origin.x, y: rightRect.origin.y) .offset(x: rightRect.origin.x, y: rightRect.origin.y)
.accessibilityElement(children: .contain)
.accessibilityLabel(rightPaneLabel)
Divider(direction: direction, Divider(direction: direction,
visibleSize: splitterVisibleSize, visibleSize: splitterVisibleSize,
invisibleSize: splitterInvisibleSize, invisibleSize: splitterInvisibleSize,
color: dividerColor) color: dividerColor,
split: $split)
.position(splitterPoint) .position(splitterPoint)
.gesture(dragGesture(geo.size, splitterPoint: splitterPoint)) .gesture(dragGesture(geo.size, splitterPoint: splitterPoint))
} }
.onReceive(resizePublisher) { value in .accessibilityElement(children: .contain)
resize(for: geo.size, amount: value) .accessibilityLabel(splitViewLabel)
}
} }
} }
/// Initialize a split view. This view isn't programmatically resizable; it can only be resized /// Initialize a split view that can be resized by manually dragging the divider.
/// by manually dragging the divider.
init(_ direction: SplitViewDirection,
_ split: Binding<CGFloat>,
dividerColor: Color,
@ViewBuilder left: (() -> L),
@ViewBuilder right: (() -> R)) {
self.init(
direction,
split,
dividerColor: dividerColor,
resizeIncrements: .init(width: 1, height: 1),
resizePublisher: .init(),
left: left,
right: right
)
}
/// Initialize a split view that supports programmatic resizing.
init( init(
_ direction: SplitViewDirection, _ direction: SplitViewDirection,
_ split: Binding<CGFloat>, _ split: Binding<CGFloat>,
dividerColor: Color, dividerColor: Color,
resizeIncrements: NSSize, resizeIncrements: NSSize = .init(width: 1, height: 1),
resizePublisher: PassthroughSubject<Double, Never>,
@ViewBuilder left: (() -> L), @ViewBuilder left: (() -> L),
@ViewBuilder right: (() -> R) @ViewBuilder right: (() -> R)
) { ) {
@ -93,25 +75,10 @@ struct SplitView<L: View, R: View>: View {
self._split = split self._split = split
self.dividerColor = dividerColor self.dividerColor = dividerColor
self.resizeIncrements = resizeIncrements self.resizeIncrements = resizeIncrements
self.resizePublisher = resizePublisher
self.left = left() self.left = left()
self.right = right() self.right = right()
} }
private func resize(for size: CGSize, amount: Double) {
let dim: CGFloat
switch (direction) {
case .horizontal:
dim = size.width
case .vertical:
dim = size.height
}
let pos = split * dim
let new = min(max(minSize, pos + amount), dim - minSize)
split = new / dim
}
private func dragGesture(_ size: CGSize, splitterPoint: CGPoint) -> some Gesture { private func dragGesture(_ size: CGSize, splitterPoint: CGPoint) -> some Gesture {
return DragGesture() return DragGesture()
.onChanged { gesture in .onChanged { gesture in
@ -177,6 +144,35 @@ struct SplitView<L: View, R: View>: View {
return CGPoint(x: size.width / 2, y: leftRect.size.height) return CGPoint(x: size.width / 2, y: leftRect.size.height)
} }
} }
// MARK: Accessibility
private var splitViewLabel: String {
switch direction {
case .horizontal:
return "Horizontal split view"
case .vertical:
return "Vertical split view"
}
}
private var leftPaneLabel: String {
switch direction {
case .horizontal:
return "Left pane"
case .vertical:
return "Top pane"
}
}
private var rightPaneLabel: String {
switch direction {
case .horizontal:
return "Right pane"
case .vertical:
return "Bottom pane"
}
}
} }
enum SplitViewDirection: Codable { enum SplitViewDirection: Codable {

View File

@ -0,0 +1,62 @@
import SwiftUI
struct TerminalSplitTreeView: View {
let tree: SplitTree<Ghostty.SurfaceView>
let onResize: (SplitTree<Ghostty.SurfaceView>.Node, Double) -> Void
var body: some View {
if let node = tree.zoomed ?? tree.root {
TerminalSplitSubtreeView(
node: node,
isRoot: node == tree.root,
onResize: onResize)
// This is necessary because we can't rely on SwiftUI's implicit
// structural identity to detect changes to this view. Due to
// the tree structure of splits it could result in bad beaviors.
// See: https://github.com/ghostty-org/ghostty/issues/7546
.id(node.structuralIdentity)
}
}
}
struct TerminalSplitSubtreeView: View {
@EnvironmentObject var ghostty: Ghostty.App
let node: SplitTree<Ghostty.SurfaceView>.Node
var isRoot: Bool = false
let onResize: (SplitTree<Ghostty.SurfaceView>.Node, Double) -> Void
var body: some View {
switch (node) {
case .leaf(let leafView):
Ghostty.InspectableSurface(
surfaceView: leafView,
isSplit: !isRoot)
.accessibilityElement(children: .contain)
.accessibilityLabel("Terminal pane")
case .split(let split):
let splitViewDirection: SplitViewDirection = switch (split.direction) {
case .horizontal: .horizontal
case .vertical: .vertical
}
SplitView(
splitViewDirection,
.init(get: {
CGFloat(split.ratio)
}, set: {
onResize(node, $0)
}),
dividerColor: ghostty.config.splitDividerColor,
resizeIncrements: .init(width: 1, height: 1),
left: {
TerminalSplitSubtreeView(node: split.left, onResize: onResize)
},
right: {
TerminalSplitSubtreeView(node: split.right, onResize: onResize)
}
)
}
}
}

View File

@ -1,5 +1,6 @@
import Cocoa import Cocoa
import SwiftUI import SwiftUI
import Combine
import GhosttyKit import GhosttyKit
/// A base class for windows that can contain Ghostty windows. This base class implements /// A base class for windows that can contain Ghostty windows. This base class implements
@ -40,11 +41,14 @@ class BaseTerminalController: NSWindowController,
didSet { syncFocusToSurfaceTree() } didSet { syncFocusToSurfaceTree() }
} }
/// The surface tree for this window. /// The tree of splits within this terminal window.
@Published var surfaceTree: Ghostty.SplitNode? = nil { @Published var surfaceTree: SplitTree<Ghostty.SurfaceView> = .init() {
didSet { surfaceTreeDidChange(from: oldValue, to: surfaceTree) } didSet { surfaceTreeDidChange(from: oldValue, to: surfaceTree) }
} }
/// This can be set to show/hide the command palette.
@Published var commandPaletteIsShowing: Bool = false
/// Whether the terminal surface should focus when the mouse is over it. /// Whether the terminal surface should focus when the mouse is over it.
var focusFollowsMouse: Bool { var focusFollowsMouse: Bool {
self.derivedConfig.focusFollowsMouse self.derivedConfig.focusFollowsMouse
@ -68,6 +72,30 @@ class BaseTerminalController: NSWindowController,
/// The configuration derived from the Ghostty config so we don't need to rely on references. /// The configuration derived from the Ghostty config so we don't need to rely on references.
private var derivedConfig: DerivedConfig private var derivedConfig: DerivedConfig
/// The cancellables related to our focused surface.
private var focusedSurfaceCancellables: Set<AnyCancellable> = []
/// The time that undo/redo operations that contain running ptys are valid for.
var undoExpiration: Duration {
ghostty.config.undoTimeout
}
/// The undo manager for this controller is the undo manager of the window,
/// which we set via the delegate method.
override var undoManager: ExpiringUndoManager? {
// This should be set via the delegate method windowWillReturnUndoManager
if let result = window?.undoManager as? ExpiringUndoManager {
return result
}
// If the window one isn't set, we fallback to our global one.
if let appDelegate = NSApplication.shared.delegate as? AppDelegate {
return appDelegate.undoManager
}
return nil
}
struct SavedFrame { struct SavedFrame {
let window: NSRect let window: NSRect
let screen: NSRect let screen: NSRect
@ -79,7 +107,7 @@ class BaseTerminalController: NSWindowController,
init(_ ghostty: Ghostty.App, init(_ ghostty: Ghostty.App,
baseConfig base: Ghostty.SurfaceConfiguration? = nil, baseConfig base: Ghostty.SurfaceConfiguration? = nil,
surfaceTree tree: Ghostty.SplitNode? = nil surfaceTree tree: SplitTree<Ghostty.SurfaceView>? = nil
) { ) {
self.ghostty = ghostty self.ghostty = ghostty
self.derivedConfig = DerivedConfig(ghostty.config) self.derivedConfig = DerivedConfig(ghostty.config)
@ -88,7 +116,7 @@ class BaseTerminalController: NSWindowController,
// Initialize our initial surface. // Initialize our initial surface.
guard let ghostty_app = ghostty.app else { preconditionFailure("app must be loaded") } guard let ghostty_app = ghostty.app else { preconditionFailure("app must be loaded") }
self.surfaceTree = tree ?? .leaf(.init(ghostty_app, baseConfig: base)) self.surfaceTree = tree ?? .init(view: Ghostty.SurfaceView(ghostty_app, baseConfig: base))
// Setup our notifications for behaviors // Setup our notifications for behaviors
let center = NotificationCenter.default let center = NotificationCenter.default
@ -107,6 +135,48 @@ class BaseTerminalController: NSWindowController,
selector: #selector(ghosttyConfigDidChangeBase(_:)), selector: #selector(ghosttyConfigDidChangeBase(_:)),
name: .ghosttyConfigDidChange, name: .ghosttyConfigDidChange,
object: nil) object: nil)
center.addObserver(
self,
selector: #selector(ghosttyCommandPaletteDidToggle(_:)),
name: .ghosttyCommandPaletteDidToggle,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyMaximizeDidToggle(_:)),
name: .ghosttyMaximizeDidToggle,
object: nil)
// Splits
center.addObserver(
self,
selector: #selector(ghosttyDidCloseSurface(_:)),
name: Ghostty.Notification.ghosttyCloseSurface,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyDidNewSplit(_:)),
name: Ghostty.Notification.ghosttyNewSplit,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyDidEqualizeSplits(_:)),
name: Ghostty.Notification.didEqualizeSplits,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyDidFocusSplit(_:)),
name: Ghostty.Notification.ghosttyFocusSplit,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyDidToggleSplitZoom(_:)),
name: Ghostty.Notification.didToggleSplitZoom,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyDidResizeSplit(_:)),
name: Ghostty.Notification.didResizeSplit,
object: nil)
// Listen for local events that we need to know of outside of // Listen for local events that we need to know of outside of
// single surface handlers. // single surface handlers.
@ -117,20 +187,58 @@ class BaseTerminalController: NSWindowController,
deinit { deinit {
NotificationCenter.default.removeObserver(self) NotificationCenter.default.removeObserver(self)
undoManager?.removeAllActions(withTarget: self)
if let eventMonitor { if let eventMonitor {
NSEvent.removeMonitor(eventMonitor) NSEvent.removeMonitor(eventMonitor)
} }
} }
// MARK: Methods
/// Create a new split.
@discardableResult
func newSplit(
at oldView: Ghostty.SurfaceView,
direction: SplitTree<Ghostty.SurfaceView>.NewDirection,
baseConfig config: Ghostty.SurfaceConfiguration? = nil
) -> Ghostty.SurfaceView? {
// We can only create new splits for surfaces in our tree.
guard surfaceTree.root?.node(view: oldView) != nil else { return nil }
// Create a new surface view
guard let ghostty_app = ghostty.app else { return nil }
let newView = Ghostty.SurfaceView(ghostty_app, baseConfig: config)
// Do the split
let newTree: SplitTree<Ghostty.SurfaceView>
do {
newTree = try surfaceTree.insert(
view: newView,
at: oldView,
direction: direction)
} catch {
// If splitting fails for any reason (it should not), then we just log
// and return. The new view we created will be deinitialized and its
// no big deal.
Ghostty.logger.warning("failed to insert split: \(error)")
return nil
}
replaceSurfaceTree(
newTree,
moveFocusTo: newView,
moveFocusFrom: oldView,
undoAction: "New Split")
return newView
}
/// Called when the surfaceTree variable changed. /// Called when the surfaceTree variable changed.
/// ///
/// Subclasses should call super first. /// Subclasses should call super first.
func surfaceTreeDidChange(from: Ghostty.SplitNode?, to: Ghostty.SplitNode?) { func surfaceTreeDidChange(from: SplitTree<Ghostty.SurfaceView>, to: SplitTree<Ghostty.SurfaceView>) {
// If our surface tree becomes nil then ensure all surfaces // If our surface tree becomes empty then we have no focused surface.
// in the old tree have closed. if (to.isEmpty) {
if (to == nil) {
from?.close()
focusedSurface = nil focusedSurface = nil
} }
} }
@ -138,15 +246,14 @@ class BaseTerminalController: NSWindowController,
/// Update all surfaces with the focus state. This ensures that libghostty has an accurate view about /// Update all surfaces with the focus state. This ensures that libghostty has an accurate view about
/// what surface is focused. This must be called whenever a surface OR window changes focus. /// what surface is focused. This must be called whenever a surface OR window changes focus.
func syncFocusToSurfaceTree() { func syncFocusToSurfaceTree() {
guard let tree = self.surfaceTree else { return } for surfaceView in surfaceTree {
for leaf in tree {
// Our focus state requires that this window is key and our currently // Our focus state requires that this window is key and our currently
// focused surface is the surface in this leaf. // focused surface is the surface in this view.
let focused: Bool = (window?.isKeyWindow ?? false) && let focused: Bool = (window?.isKeyWindow ?? false) &&
!commandPaletteIsShowing &&
focusedSurface != nil && focusedSurface != nil &&
leaf.surface == focusedSurface! surfaceView == focusedSurface!
leaf.surface.focusDidChange(focused) surfaceView.focusDidChange(focused)
} }
} }
@ -159,6 +266,164 @@ class BaseTerminalController: NSWindowController,
savedFrame = .init(window: window.frame, screen: screen.visibleFrame) savedFrame = .init(window: window.frame, screen: screen.visibleFrame)
} }
func confirmClose(
messageText: String,
informativeText: String,
completion: @escaping () -> Void
) {
// If we already have an alert, we need to wait for that one.
guard alert == nil else { return }
// If there is no window to attach the modal then we assume success
// since we'll never be able to show the modal.
guard let window else {
completion()
return
}
// If we need confirmation by any, show one confirmation for all windows
// in the tab group.
let alert = NSAlert()
alert.messageText = messageText
alert.informativeText = informativeText
alert.addButton(withTitle: "Close")
alert.addButton(withTitle: "Cancel")
alert.alertStyle = .warning
alert.beginSheetModal(for: window) { response in
self.alert = nil
if response == .alertFirstButtonReturn {
completion()
}
}
// Store our alert so we only ever show one.
self.alert = alert
}
/// Close a surface from a view.
func closeSurface(
_ view: Ghostty.SurfaceView,
withConfirmation: Bool = true
) {
guard let node = surfaceTree.root?.node(view: view) else { return }
closeSurface(node, withConfirmation: withConfirmation)
}
/// Close a surface node (which may contain splits), requesting confirmation if necessary.
///
/// This will also insert the proper undo stack information in.
func closeSurface(
_ node: SplitTree<Ghostty.SurfaceView>.Node,
withConfirmation: Bool = true
) {
// This node must be part of our tree
guard surfaceTree.contains(node) else { return }
// If the child process is not alive, then we exit immediately
guard withConfirmation else {
removeSurfaceNode(node)
return
}
// Confirm close. We use an NSAlert instead of a SwiftUI confirmationDialog
// due to SwiftUI bugs (see Ghostty #560). To repeat from #560, the bug is that
// confirmationDialog allows the user to Cmd-W close the alert, but when doing
// so SwiftUI does not update any of the bindings to note that window is no longer
// being shown, and provides no callback to detect this.
confirmClose(
messageText: "Close Terminal?",
informativeText: "The terminal still has a running process. If you close the terminal the process will be killed."
) { [weak self] in
if let self {
self.removeSurfaceNode(node)
}
}
}
// MARK: Split Tree Management
/// Find the next surface to focus when a node is being closed.
/// Goes to previous split unless we're the leftmost leaf, then goes to next.
private func findNextFocusTargetAfterClosing(node: SplitTree<Ghostty.SurfaceView>.Node) -> Ghostty.SurfaceView? {
guard let root = surfaceTree.root else { return nil }
// If we're the leftmost, then we move to the next surface after closing.
// Otherwise, we move to the previous.
if root.leftmostLeaf() == node.leftmostLeaf() {
return surfaceTree.focusTarget(for: .next, from: node)
} else {
return surfaceTree.focusTarget(for: .previous, from: node)
}
}
/// Remove a node from the surface tree and move focus appropriately.
///
/// This also updates the undo manager to support restoring this node.
///
/// This does no confirmation and assumes confirmation is already done.
private func removeSurfaceNode(_ node: SplitTree<Ghostty.SurfaceView>.Node) {
// Move focus if the closed surface was focused and we have a next target
let nextFocus: Ghostty.SurfaceView? = if node.contains(
where: { $0 == focusedSurface }
) {
findNextFocusTargetAfterClosing(node: node)
} else {
nil
}
replaceSurfaceTree(
surfaceTree.remove(node),
moveFocusTo: nextFocus,
moveFocusFrom: focusedSurface,
undoAction: "Close Terminal"
)
}
private func replaceSurfaceTree(
_ newTree: SplitTree<Ghostty.SurfaceView>,
moveFocusTo newView: Ghostty.SurfaceView? = nil,
moveFocusFrom oldView: Ghostty.SurfaceView? = nil,
undoAction: String? = nil
) {
// Setup our new split tree
let oldTree = surfaceTree
surfaceTree = newTree
if let newView {
DispatchQueue.main.async {
Ghostty.moveFocus(to: newView, from: oldView)
}
}
// Setup our undo
if let undoManager {
if let undoAction {
undoManager.setActionName(undoAction)
}
undoManager.registerUndo(
withTarget: self,
expiresAfter: undoExpiration
) { target in
target.surfaceTree = oldTree
if let oldView {
DispatchQueue.main.async {
Ghostty.moveFocus(to: oldView, from: target.focusedSurface)
}
}
undoManager.registerUndo(
withTarget: target,
expiresAfter: target.undoExpiration
) { target in
target.replaceSurfaceTree(
newTree,
moveFocusTo: newView,
moveFocusFrom: target.focusedSurface,
undoAction: undoAction)
}
}
}
}
// MARK: Notifications // MARK: Notifications
@objc private func didChangeScreenParametersNotification(_ notification: Notification) { @objc private func didChangeScreenParametersNotification(_ notification: Notification) {
@ -219,6 +484,160 @@ class BaseTerminalController: NSWindowController,
self.derivedConfig = DerivedConfig(config) self.derivedConfig = DerivedConfig(config)
} }
@objc private func ghosttyCommandPaletteDidToggle(_ notification: Notification) {
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
guard surfaceTree.contains(surfaceView) else { return }
toggleCommandPalette(nil)
}
@objc private func ghosttyMaximizeDidToggle(_ notification: Notification) {
guard let window else { return }
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
guard surfaceTree.contains(surfaceView) else { return }
window.zoom(nil)
}
@objc private func ghosttyDidCloseSurface(_ notification: Notification) {
guard let target = notification.object as? Ghostty.SurfaceView else { return }
guard let node = surfaceTree.root?.node(view: target) else { return }
closeSurface(
node,
withConfirmation: (notification.userInfo?["process_alive"] as? Bool) ?? false)
}
@objc private func ghosttyDidNewSplit(_ notification: Notification) {
// The target must be within our tree
guard let oldView = notification.object as? Ghostty.SurfaceView else { return }
guard surfaceTree.root?.node(view: oldView) != nil else { return }
// Notification must contain our base config
let configAny = notification.userInfo?[Ghostty.Notification.NewSurfaceConfigKey]
let config = configAny as? Ghostty.SurfaceConfiguration
// Determine our desired direction
guard let directionAny = notification.userInfo?["direction"] else { return }
guard let direction = directionAny as? ghostty_action_split_direction_e else { return }
let splitDirection: SplitTree<Ghostty.SurfaceView>.NewDirection
switch (direction) {
case GHOSTTY_SPLIT_DIRECTION_RIGHT: splitDirection = .right
case GHOSTTY_SPLIT_DIRECTION_LEFT: splitDirection = .left
case GHOSTTY_SPLIT_DIRECTION_DOWN: splitDirection = .down
case GHOSTTY_SPLIT_DIRECTION_UP: splitDirection = .up
default: return
}
newSplit(at: oldView, direction: splitDirection, baseConfig: config)
}
@objc private func ghosttyDidEqualizeSplits(_ notification: Notification) {
guard let target = notification.object as? Ghostty.SurfaceView else { return }
// Check if target surface is in current controller's tree
guard surfaceTree.contains(target) else { return }
// Equalize the splits
surfaceTree = surfaceTree.equalize()
}
@objc private func ghosttyDidFocusSplit(_ notification: Notification) {
// The target must be within our tree
guard let target = notification.object as? Ghostty.SurfaceView else { return }
guard surfaceTree.root?.node(view: target) != nil else { return }
// Get the direction from the notification
guard let directionAny = notification.userInfo?[Ghostty.Notification.SplitDirectionKey] else { return }
guard let direction = directionAny as? Ghostty.SplitFocusDirection else { return }
// Convert Ghostty.SplitFocusDirection to our SplitTree.FocusDirection
let focusDirection: SplitTree<Ghostty.SurfaceView>.FocusDirection
switch direction {
case .previous: focusDirection = .previous
case .next: focusDirection = .next
case .up: focusDirection = .spatial(.up)
case .down: focusDirection = .spatial(.down)
case .left: focusDirection = .spatial(.left)
case .right: focusDirection = .spatial(.right)
}
// Find the node for the target surface
guard let targetNode = surfaceTree.root?.node(view: target) else { return }
// Find the next surface to focus
guard let nextSurface = surfaceTree.focusTarget(for: focusDirection, from: targetNode) else {
return
}
// Remove the zoomed state for this surface tree.
if surfaceTree.zoomed != nil {
surfaceTree = .init(root: surfaceTree.root, zoomed: nil)
}
// Move focus to the next surface
DispatchQueue.main.async {
Ghostty.moveFocus(to: nextSurface, from: target)
}
}
@objc private func ghosttyDidToggleSplitZoom(_ notification: Notification) {
// The target must be within our tree
guard let target = notification.object as? Ghostty.SurfaceView else { return }
guard let targetNode = surfaceTree.root?.node(view: target) else { return }
// Toggle the zoomed state
if surfaceTree.zoomed == targetNode {
// Already zoomed, unzoom it
surfaceTree = SplitTree(root: surfaceTree.root, zoomed: nil)
} else {
// We require that the split tree have splits
guard surfaceTree.isSplit else { return }
// Not zoomed or different node zoomed, zoom this node
surfaceTree = SplitTree(root: surfaceTree.root, zoomed: targetNode)
}
// Move focus to our window. Importantly this ensures that if we click the
// reset zoom button in a tab bar of an unfocused tab that we become focused.
window?.makeKeyAndOrderFront(nil)
// Ensure focus stays on the target surface. We lose focus when we do
// this so we need to grab it again.
DispatchQueue.main.async {
Ghostty.moveFocus(to: target)
}
}
@objc private func ghosttyDidResizeSplit(_ notification: Notification) {
// The target must be within our tree
guard let target = notification.object as? Ghostty.SurfaceView else { return }
guard let targetNode = surfaceTree.root?.node(view: target) else { return }
// Extract direction and amount from notification
guard let directionAny = notification.userInfo?[Ghostty.Notification.ResizeSplitDirectionKey] else { return }
guard let direction = directionAny as? Ghostty.SplitResizeDirection else { return }
guard let amountAny = notification.userInfo?[Ghostty.Notification.ResizeSplitAmountKey] else { return }
guard let amount = amountAny as? UInt16 else { return }
// Convert Ghostty.SplitResizeDirection to SplitTree.Spatial.Direction
let spatialDirection: SplitTree<Ghostty.SurfaceView>.Spatial.Direction
switch direction {
case .up: spatialDirection = .up
case .down: spatialDirection = .down
case .left: spatialDirection = .left
case .right: spatialDirection = .right
}
// Use viewBounds for the spatial calculation bounds
let bounds = CGRect(origin: .zero, size: surfaceTree.viewBounds())
// Perform the resize using the new SplitTree resize method
do {
surfaceTree = try surfaceTree.resize(node: targetNode, by: amount, in: spatialDirection, with: bounds)
} catch {
Ghostty.logger.warning("failed to resize split: \(error)")
}
}
// MARK: Local Events // MARK: Local Events
private func localEventHandler(_ event: NSEvent) -> NSEvent? { private func localEventHandler(_ event: NSEvent) -> NSEvent? {
@ -232,20 +651,17 @@ class BaseTerminalController: NSWindowController,
} }
private func localEventFlagsChanged(_ event: NSEvent) -> NSEvent? { private func localEventFlagsChanged(_ event: NSEvent) -> NSEvent? {
// Go through all our surfaces and notify it that the flags changed. var surfaces: [Ghostty.SurfaceView] = surfaceTree.map { $0 }
if let surfaceTree {
var surfaces: [Ghostty.SurfaceView] = surfaceTree.map { $0.surface }
// If we're the main window receiving key input, then we want to avoid // If we're the main window receiving key input, then we want to avoid
// calling this on our focused surface because that'll trigger a double // calling this on our focused surface because that'll trigger a double
// flagsChanged call. // flagsChanged call.
if NSApp.mainWindow == window { if NSApp.mainWindow == window {
surfaces = surfaces.filter { $0 != focusedSurface } surfaces = surfaces.filter { $0 != focusedSurface }
} }
for surface in surfaces { for surface in surfaces {
surface.flagsChanged(with: event) surface.flagsChanged(with: event)
}
} }
return event return event
@ -253,13 +669,27 @@ class BaseTerminalController: NSWindowController,
// MARK: TerminalViewDelegate // MARK: TerminalViewDelegate
// Note: this is different from surfaceDidTreeChange(from:,to:) because this is called
// when the currently set value changed in place and the from:to: variant is called
// when the variable was set.
func surfaceTreeDidChange() {}
func focusedSurfaceDidChange(to: Ghostty.SurfaceView?) { func focusedSurfaceDidChange(to: Ghostty.SurfaceView?) {
let lastFocusedSurface = focusedSurface
focusedSurface = to focusedSurface = to
// Important to cancel any prior subscriptions
focusedSurfaceCancellables = []
// Setup our title listener. If we have a focused surface we always use that.
// Otherwise, we try to use our last focused surface. In either case, we only
// want to care if the surface is in the tree so we don't listen to titles of
// closed surfaces.
if let titleSurface = focusedSurface ?? lastFocusedSurface,
surfaceTree.contains(titleSurface) {
// If we have a surface, we want to listen for title changes.
titleSurface.$title
.sink { [weak self] in self?.titleDidChange(to: $0) }
.store(in: &focusedSurfaceCancellables)
} else {
// There is no surface to listen to titles for.
titleDidChange(to: "👻")
}
} }
func titleDidChange(to: String) { func titleDidChange(to: String) {
@ -286,7 +716,24 @@ class BaseTerminalController: NSWindowController,
self.window?.contentResizeIncrements = to self.window?.contentResizeIncrements = to
} }
func zoomStateDidChange(to: Bool) {} func splitDidResize(node: SplitTree<Ghostty.SurfaceView>.Node, to newRatio: Double) {
let resizedNode = node.resize(to: newRatio)
do {
surfaceTree = try surfaceTree.replace(node: node, with: resizedNode)
} catch {
Ghostty.logger.warning("failed to replace node during split resize: \(error)")
return
}
}
func performAction(_ action: String, on surfaceView: Ghostty.SurfaceView) {
guard let surface = surfaceView.surface else { return }
let len = action.utf8CString.count
if (len == 0) { return }
_ = action.withCString { cString in
ghostty_surface_binding_action(surface, cString, UInt(len - 1))
}
}
// MARK: Fullscreen // MARK: Fullscreen
@ -337,13 +784,7 @@ class BaseTerminalController: NSWindowController,
} }
} }
func fullscreenDidChange() { func fullscreenDidChange() {}
// For some reason focus can get lost when we change fullscreen. Regardless of
// mode above we just move it back.
if let focusedSurface {
Ghostty.moveFocus(to: focusedSurface)
}
}
// MARK: Clipboard Confirmation // MARK: Clipboard Confirmation
@ -411,8 +852,21 @@ class BaseTerminalController: NSWindowController,
// MARK: NSWindowController // MARK: NSWindowController
override func windowDidLoad() { override func windowDidLoad() {
super.windowDidLoad()
// Setup our undo manager.
// Everything beyond here is setting up the window
guard let window else { return } guard let window else { return }
// If there is a hardcoded title in the configuration, we set that
// immediately. Future `set_title` apprt actions will override this
// if necessary but this ensures our window loads with the proper
// title immediately rather than on another event loop tick (see #5934)
if let title = derivedConfig.title {
window.title = title
}
// We always initialize our fullscreen style to native if we can because // We always initialize our fullscreen style to native if we can because
// initialization sets up some state (i.e. observers). If its set already // initialization sets up some state (i.e. observers). If its set already
// somehow we don't do this. // somehow we don't do this.
@ -432,35 +886,21 @@ class BaseTerminalController: NSWindowController,
guard let window = self.window else { return true } guard let window = self.window else { return true }
// If we have no surfaces, close. // If we have no surfaces, close.
guard let node = self.surfaceTree else { return true } if surfaceTree.isEmpty { return true }
// If we already have an alert, continue with it // If we already have an alert, continue with it
guard alert == nil else { return false } guard alert == nil else { return false }
// If our surfaces don't require confirmation, close. // If our surfaces don't require confirmation, close.
if (!node.needsConfirmQuit()) { return true } if !surfaceTree.contains(where: { $0.needsConfirmQuit }) { return true }
// We require confirmation, so show an alert as long as we aren't already. // We require confirmation, so show an alert as long as we aren't already.
let alert = NSAlert() confirmClose(
alert.messageText = "Close Terminal?" messageText: "Close Terminal?",
alert.informativeText = "The terminal still has a running process. If you close the " + informativeText: "The terminal still has a running process. If you close the terminal the process will be killed."
"terminal the process will be killed." ) {
alert.addButton(withTitle: "Close the Terminal") window.close()
alert.addButton(withTitle: "Cancel") }
alert.alertStyle = .warning
alert.beginSheetModal(for: window, completionHandler: { response in
self.alert = nil
switch (response) {
case .alertFirstButtonReturn:
alert.window.orderOut(nil)
window.close()
default:
break
}
})
self.alert = alert
return false return false
} }
@ -472,6 +912,9 @@ class BaseTerminalController: NSWindowController,
// the view and the window so we had to nil this out to break it but I think this // the view and the window so we had to nil this out to break it but I think this
// may now be resolved. We should verify that no memory leaks and we can remove this. // may now be resolved. We should verify that no memory leaks and we can remove this.
window.contentView = nil window.contentView = nil
// Make sure we clean up all our undos
window.undoManager?.removeAllActions(withTarget: self)
} }
func windowDidBecomeKey(_ notification: Notification) { func windowDidBecomeKey(_ notification: Notification) {
@ -487,10 +930,9 @@ class BaseTerminalController: NSWindowController,
} }
func windowDidChangeOcclusionState(_ notification: Notification) { func windowDidChangeOcclusionState(_ notification: Notification) {
guard let surfaceTree = self.surfaceTree else { return }
let visible = self.window?.occlusionState.contains(.visible) ?? false let visible = self.window?.occlusionState.contains(.visible) ?? false
for leaf in surfaceTree { for view in surfaceTree {
if let surface = leaf.surface.surface { if let surface = view.surface {
ghostty_surface_set_occlusion(surface, visible) ghostty_surface_set_occlusion(surface, visible)
} }
} }
@ -504,6 +946,11 @@ class BaseTerminalController: NSWindowController,
windowFrameDidChange() windowFrameDidChange()
} }
func windowWillReturnUndoManager(_ window: NSWindow) -> UndoManager? {
guard let appDelegate = NSApplication.shared.delegate as? AppDelegate else { return nil }
return appDelegate.undoManager
}
// MARK: First Responder // MARK: First Responder
@IBAction func close(_ sender: Any) { @IBAction func close(_ sender: Any) {
@ -521,11 +968,21 @@ class BaseTerminalController: NSWindowController,
ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_RIGHT) ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_RIGHT)
} }
@IBAction func splitLeft(_ sender: Any) {
guard let surface = focusedSurface?.surface else { return }
ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_LEFT)
}
@IBAction func splitDown(_ sender: Any) { @IBAction func splitDown(_ sender: Any) {
guard let surface = focusedSurface?.surface else { return } guard let surface = focusedSurface?.surface else { return }
ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_DOWN) ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_DOWN)
} }
@IBAction func splitUp(_ sender: Any) {
guard let surface = focusedSurface?.surface else { return }
ghostty.split(surface: surface, direction: GHOSTTY_SPLIT_DIRECTION_UP)
}
@IBAction func splitZoom(_ sender: Any) { @IBAction func splitZoom(_ sender: Any) {
guard let surface = focusedSurface?.surface else { return } guard let surface = focusedSurface?.surface else { return }
ghostty.splitToggleZoom(surface: surface) ghostty.splitToggleZoom(surface: surface)
@ -601,23 +1058,30 @@ class BaseTerminalController: NSWindowController,
ghostty.changeFontSize(surface: surface, .reset) ghostty.changeFontSize(surface: surface, .reset)
} }
@IBAction func toggleCommandPalette(_ sender: Any?) {
commandPaletteIsShowing.toggle()
}
@objc func resetTerminal(_ sender: Any) { @objc func resetTerminal(_ sender: Any) {
guard let surface = focusedSurface?.surface else { return } guard let surface = focusedSurface?.surface else { return }
ghostty.resetTerminal(surface: surface) ghostty.resetTerminal(surface: surface)
} }
private struct DerivedConfig { private struct DerivedConfig {
let title: String?
let macosTitlebarProxyIcon: Ghostty.MacOSTitlebarProxyIcon let macosTitlebarProxyIcon: Ghostty.MacOSTitlebarProxyIcon
let windowStepResize: Bool let windowStepResize: Bool
let focusFollowsMouse: Bool let focusFollowsMouse: Bool
init() { init() {
self.title = nil
self.macosTitlebarProxyIcon = .visible self.macosTitlebarProxyIcon = .visible
self.windowStepResize = false self.windowStepResize = false
self.focusFollowsMouse = false self.focusFollowsMouse = false
} }
init(_ config: Ghostty.Config) { init(_ config: Ghostty.Config) {
self.title = config.title
self.macosTitlebarProxyIcon = config.macosTitlebarProxyIcon self.macosTitlebarProxyIcon = config.macosTitlebarProxyIcon
self.windowStepResize = config.windowStepResize self.windowStepResize = config.windowStepResize
self.focusFollowsMouse = config.focusFollowsMouse self.focusFollowsMouse = config.focusFollowsMouse

File diff suppressed because it is too large Load Diff

View File

@ -1,372 +0,0 @@
import Cocoa
import SwiftUI
import GhosttyKit
import Combine
/// Manages a set of terminal windows. This is effectively an array of TerminalControllers.
/// This abstraction helps manage tabs and multi-window scenarios.
class TerminalManager {
struct Window {
let controller: TerminalController
let closePublisher: AnyCancellable
}
let ghostty: Ghostty.App
/// The currently focused surface of the main window.
var focusedSurface: Ghostty.SurfaceView? { mainWindow?.controller.focusedSurface }
/// The set of windows we currently have.
var windows: [Window] = []
// Keep track of the last point that our window was launched at so that new
// windows "cascade" over each other and don't just launch directly on top
// of each other.
private static var lastCascadePoint = NSPoint(x: 0, y: 0)
/// Returns the main window of the managed window stack. If there is no window
/// then an arbitrary window will be chosen.
private var mainWindow: Window? {
for window in windows {
if (window.controller.window?.isMainWindow ?? false) {
return window
}
}
// If we have no main window, just use the last window.
return windows.last
}
/// The configuration derived from the Ghostty config so we don't need to rely on references.
private var derivedConfig: DerivedConfig
init(_ ghostty: Ghostty.App) {
self.ghostty = ghostty
self.derivedConfig = DerivedConfig(ghostty.config)
let center = NotificationCenter.default
center.addObserver(
self,
selector: #selector(onNewTab),
name: Ghostty.Notification.ghosttyNewTab,
object: nil)
center.addObserver(
self,
selector: #selector(onNewWindow),
name: Ghostty.Notification.ghosttyNewWindow,
object: nil)
center.addObserver(
self,
selector: #selector(ghosttyConfigDidChange(_:)),
name: .ghosttyConfigDidChange,
object: nil)
}
deinit {
let center = NotificationCenter.default
center.removeObserver(self)
}
// MARK: - Window Management
/// Create a new terminal window.
func newWindow(withBaseConfig base: Ghostty.SurfaceConfiguration? = nil) {
let c = createWindow(withBaseConfig: base)
let window = c.window!
// If the previous focused window was native fullscreen, the new window also
// becomes native fullscreen.
if let parent = focusedSurface?.window,
parent.styleMask.contains(.fullScreen) {
window.toggleFullScreen(nil)
} else if derivedConfig.windowFullscreen {
switch (derivedConfig.windowFullscreenMode) {
case .native:
// Native has to be done immediately so that our stylemask contains
// fullscreen for the logic later in this method.
c.toggleFullscreen(mode: .native)
case .nonNative, .nonNativeVisibleMenu:
// If we're non-native then we have to do it on a later loop
// so that the content view is setup.
DispatchQueue.main.async {
c.toggleFullscreen(mode: self.derivedConfig.windowFullscreenMode)
}
}
}
// If our app isn't active, we make it active. All new_window actions
// force our app to be active.
if !NSApp.isActive {
NSApp.activate(ignoringOtherApps: true)
}
// We're dispatching this async because otherwise the lastCascadePoint doesn't
// take effect. Our best theory is there is some next-event-loop-tick logic
// that Cocoa is doing that we need to be after.
DispatchQueue.main.async {
// Only cascade if we aren't fullscreen.
if (!window.styleMask.contains(.fullScreen)) {
Self.lastCascadePoint = window.cascadeTopLeft(from: Self.lastCascadePoint)
}
c.showWindow(self)
}
}
/// Creates a new tab in the current main window. If there are no windows, a window
/// is created.
func newTab(withBaseConfig base: Ghostty.SurfaceConfiguration? = nil) {
// If there is no main window, just create a new window
guard let parent = mainWindow?.controller.window else {
newWindow(withBaseConfig: base)
return
}
// Create a new window and add it to the parent
newTab(to: parent, withBaseConfig: base)
}
private func newTab(to parent: NSWindow, withBaseConfig base: Ghostty.SurfaceConfiguration?) {
// If our parent is in non-native fullscreen, then new tabs do not work.
// See: https://github.com/mitchellh/ghostty/issues/392
if let controller = parent.windowController as? TerminalController,
let fullscreenStyle = controller.fullscreenStyle,
fullscreenStyle.isFullscreen && !fullscreenStyle.supportsTabs {
let alert = NSAlert()
alert.messageText = "Cannot Create New Tab"
alert.informativeText = "New tabs are unsupported while in non-native fullscreen. Exit fullscreen and try again."
alert.addButton(withTitle: "OK")
alert.alertStyle = .warning
alert.beginSheetModal(for: parent)
return
}
// Create a new window and add it to the parent
let controller = createWindow(withBaseConfig: base)
let window = controller.window!
// If the parent is miniaturized, then macOS exhibits really strange behaviors
// so we have to bring it back out.
if (parent.isMiniaturized) { parent.deminiaturize(self) }
// If our parent tab group already has this window, macOS added it and
// we need to remove it so we can set the correct order in the next line.
// If we don't do this, macOS gets really confused and the tabbedWindows
// state becomes incorrect.
//
// At the time of writing this code, the only known case this happens
// is when the "+" button is clicked in the tab bar.
if let tg = parent.tabGroup, tg.windows.firstIndex(of: window) != nil {
tg.removeWindow(window)
}
// Our windows start out invisible. We need to make it visible. If we
// don't do this then various features such as window blur won't work because
// the macOS APIs only work on a visible window.
controller.showWindow(self)
// If we have the "hidden" titlebar style we want to create new
// tabs as windows instead, so just skip adding it to the parent.
if (derivedConfig.macosTitlebarStyle != "hidden") {
// Add the window to the tab group and show it.
switch derivedConfig.windowNewTabPosition {
case "end":
// If we already have a tab group and we want the new tab to open at the end,
// then we use the last window in the tab group as the parent.
if let last = parent.tabGroup?.windows.last {
last.addTabbedWindow(window, ordered: .above)
} else {
fallthrough
}
case "current": fallthrough
default:
parent.addTabbedWindow(window, ordered: .above)
}
}
window.makeKeyAndOrderFront(self)
// It takes an event loop cycle until the macOS tabGroup state becomes
// consistent which causes our tab labeling to be off when the "+" button
// is used in the tab bar. This fixes that. If we can find a more robust
// solution we should do that.
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { controller.relabelTabs() }
}
/// Creates a window controller, adds it to our managed list, and returns it.
func createWindow(withBaseConfig base: Ghostty.SurfaceConfiguration? = nil,
withSurfaceTree tree: Ghostty.SplitNode? = nil) -> TerminalController {
// Initialize our controller to load the window
let c = TerminalController(ghostty, withBaseConfig: base, withSurfaceTree: tree)
// Create a listener for when the window is closed so we can remove it.
let pubClose = NotificationCenter.default.publisher(
for: NSWindow.willCloseNotification,
object: c.window!
).sink { notification in
guard let window = notification.object as? NSWindow else { return }
guard let c = window.windowController as? TerminalController else { return }
self.removeWindow(c)
}
// Keep track of every window we manage
windows.append(Window(
controller: c,
closePublisher: pubClose
))
return c
}
func removeWindow(_ controller: TerminalController) {
// Remove it from our managed set
guard let idx = self.windows.firstIndex(where: { $0.controller == controller }) else { return }
let w = self.windows[idx]
self.windows.remove(at: idx)
// Ensure any publishers we have are cancelled
w.closePublisher.cancel()
// If we remove a window, we reset the cascade point to the key window so that
// the next window cascade's from that one.
if let focusedWindow = NSApplication.shared.keyWindow {
// If we are NOT the focused window, then we are a tabbed window. If we
// are closing a tabbed window, we want to set the cascade point to be
// the next cascade point from this window.
if focusedWindow != controller.window {
// The cascadeTopLeft call below should NOT move the window. Starting with
// macOS 15, we found that specifically when used with the new window snapping
// features of macOS 15, this WOULD move the frame. So we keep track of the
// old frame and restore it if necessary. Issue:
// https://github.com/ghostty-org/ghostty/issues/2565
let oldFrame = focusedWindow.frame
Self.lastCascadePoint = focusedWindow.cascadeTopLeft(from: NSZeroPoint)
if focusedWindow.frame != oldFrame {
focusedWindow.setFrame(oldFrame, display: true)
}
return
}
// If we are the focused window, then we set the last cascade point to
// our own frame so that it shows up in the same spot.
let frame = focusedWindow.frame
Self.lastCascadePoint = NSPoint(x: frame.minX, y: frame.maxY)
}
// I don't think we strictly have to do this but if a window is
// closed I want to make sure that the app state is invalided so
// we don't reopen closed windows.
NSApplication.shared.invalidateRestorableState()
}
/// Close all windows, asking for confirmation if necessary.
func closeAllWindows() {
var needsConfirm: Bool = false
for w in self.windows {
if (w.controller.surfaceTree?.needsConfirmQuit() ?? false) {
needsConfirm = true
break
}
}
if (!needsConfirm) {
for w in self.windows {
w.controller.close()
}
return
}
// If we don't have a main window, we just close all windows because
// we have no window to show the modal on top of. I'm sure there's a way
// to do an app-level alert but I don't know how and this case should never
// really happen.
guard let alertWindow = mainWindow?.controller.window else {
for w in self.windows {
w.controller.close()
}
return
}
// If we need confirmation by any, show one confirmation for all windows
let alert = NSAlert()
alert.messageText = "Close All Windows?"
alert.informativeText = "All terminal sessions will be terminated."
alert.addButton(withTitle: "Close All Windows")
alert.addButton(withTitle: "Cancel")
alert.alertStyle = .warning
alert.beginSheetModal(for: alertWindow, completionHandler: { response in
if (response == .alertFirstButtonReturn) {
for w in self.windows {
w.controller.close()
}
}
})
}
/// Relabels all the tabs with the proper keyboard shortcut.
func relabelAllTabs() {
for w in windows {
w.controller.relabelTabs()
}
}
// MARK: - Notifications
@objc private func onNewWindow(notification: SwiftUI.Notification) {
let configAny = notification.userInfo?[Ghostty.Notification.NewSurfaceConfigKey]
let config = configAny as? Ghostty.SurfaceConfiguration
self.newWindow(withBaseConfig: config)
}
@objc private func onNewTab(notification: SwiftUI.Notification) {
guard let surfaceView = notification.object as? Ghostty.SurfaceView else { return }
guard let window = surfaceView.window else { return }
let configAny = notification.userInfo?[Ghostty.Notification.NewSurfaceConfigKey]
let config = configAny as? Ghostty.SurfaceConfiguration
self.newTab(to: window, withBaseConfig: config)
}
@objc private func ghosttyConfigDidChange(_ notification: Notification) {
// We only care if the configuration is a global configuration, not a
// surface-specific one.
guard notification.object == nil else { return }
// Get our managed configuration object out
guard let config = notification.userInfo?[
Notification.Name.GhosttyConfigChangeKey
] as? Ghostty.Config else { return }
// Update our derived config
self.derivedConfig = DerivedConfig(config)
}
private struct DerivedConfig {
let windowFullscreen: Bool
let windowFullscreenMode: FullscreenMode
let macosTitlebarStyle: String
let windowNewTabPosition: String
init() {
self.windowFullscreen = false
self.windowFullscreenMode = .native
self.macosTitlebarStyle = "transparent"
self.windowNewTabPosition = ""
}
init(_ config: Ghostty.Config) {
self.windowFullscreen = config.windowFullscreen
self.windowFullscreenMode = config.windowFullscreenMode
self.macosTitlebarStyle = config.macosTitlebarStyle
self.windowNewTabPosition = config.windowNewTabPosition
}
}
}

View File

@ -4,10 +4,10 @@ import Cocoa
class TerminalRestorableState: Codable { class TerminalRestorableState: Codable {
static let selfKey = "state" static let selfKey = "state"
static let versionKey = "version" static let versionKey = "version"
static let version: Int = 2 static let version: Int = 3
let focusedSurface: String? let focusedSurface: String?
let surfaceTree: Ghostty.SplitNode? let surfaceTree: SplitTree<Ghostty.SurfaceView>
init(from controller: TerminalController) { init(from controller: TerminalController) {
self.focusedSurface = controller.focusedSurface?.uuid.uuidString self.focusedSurface = controller.focusedSurface?.uuid.uuidString
@ -83,18 +83,29 @@ class TerminalWindowRestoration: NSObject, NSWindowRestoration {
// can be found for events from libghostty. This uses the low-level // can be found for events from libghostty. This uses the low-level
// createWindow so that AppKit can place the window wherever it should // createWindow so that AppKit can place the window wherever it should
// be. // be.
let c = appDelegate.terminalManager.createWindow(withSurfaceTree: state.surfaceTree) let c = TerminalController.init(
appDelegate.ghostty,
withSurfaceTree: state.surfaceTree)
guard let window = c.window else { guard let window = c.window else {
completionHandler(nil, TerminalRestoreError.windowDidNotLoad) completionHandler(nil, TerminalRestoreError.windowDidNotLoad)
return return
} }
// Setup our restored state on the controller // Setup our restored state on the controller
if let focusedStr = state.focusedSurface, // Find the focused surface in surfaceTree
let focusedUUID = UUID(uuidString: focusedStr), if let focusedStr = state.focusedSurface {
let view = c.surfaceTree?.findUUID(uuid: focusedUUID) { var foundView: Ghostty.SurfaceView?
c.focusedSurface = view for view in c.surfaceTree {
restoreFocus(to: view, inWindow: window) if view.uuid.uuidString == focusedStr {
foundView = view
break
}
}
if let view = foundView {
c.focusedSurface = view
restoreFocus(to: view, inWindow: window)
}
} }
completionHandler(window, nil) completionHandler(window, nil)

View File

@ -1,103 +0,0 @@
import Cocoa
// Custom NSToolbar subclass that displays a centered window title,
// in order to accommodate the titlebar tabs feature.
class TerminalToolbar: NSToolbar, NSToolbarDelegate {
private let titleTextField = CenteredDynamicLabel(labelWithString: "👻 Ghostty")
var titleText: String {
get {
titleTextField.stringValue
}
set {
titleTextField.stringValue = newValue
}
}
var titleFont: NSFont? {
get {
titleTextField.font
}
set {
titleTextField.font = newValue
}
}
override init(identifier: NSToolbar.Identifier) {
super.init(identifier: identifier)
delegate = self
centeredItemIdentifiers.insert(.titleText)
}
func toolbar(_ toolbar: NSToolbar,
itemForItemIdentifier itemIdentifier: NSToolbarItem.Identifier,
willBeInsertedIntoToolbar flag: Bool) -> NSToolbarItem? {
var item: NSToolbarItem
switch itemIdentifier {
case .titleText:
item = NSToolbarItem(itemIdentifier: .titleText)
item.view = self.titleTextField
item.visibilityPriority = .user
// This ensures the title text field doesn't disappear when shrinking the view
self.titleTextField.translatesAutoresizingMaskIntoConstraints = false
self.titleTextField.setContentHuggingPriority(.defaultLow, for: .horizontal)
self.titleTextField.setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
// Add constraints to the toolbar item's view
NSLayoutConstraint.activate([
// Set the height constraint to match the toolbar's height
self.titleTextField.heightAnchor.constraint(equalToConstant: 22), // Adjust as needed
])
item.isEnabled = true
case .resetZoom:
item = NSToolbarItem(itemIdentifier: .resetZoom)
default:
item = NSToolbarItem(itemIdentifier: itemIdentifier)
}
return item
}
func toolbarAllowedItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
return [.titleText, .flexibleSpace, .space, .resetZoom]
}
func toolbarDefaultItemIdentifiers(_ toolbar: NSToolbar) -> [NSToolbarItem.Identifier] {
// These space items are here to ensure that the title remains centered when it starts
// getting smaller than the max size so starts clipping. Lucky for us, two of the
// built-in spacers plus the un-zoom button item seems to exactly match the space
// on the left that's reserved for the window buttons.
return [.flexibleSpace, .titleText, .flexibleSpace]
}
}
/// A label that expands to fit whatever text you put in it and horizontally centers itself in the current window.
fileprivate class CenteredDynamicLabel: NSTextField {
override func viewDidMoveToSuperview() {
// Configure the text field
isEditable = false
isBordered = false
drawsBackground = false
alignment = .center
lineBreakMode = .byTruncatingTail
cell?.truncatesLastVisibleLine = true
// Use Auto Layout
translatesAutoresizingMaskIntoConstraints = false
// Set content hugging and compression resistance priorities
setContentHuggingPriority(.defaultLow, for: .horizontal)
setContentCompressionResistancePriority(.defaultHigh, for: .horizontal)
}
}
extension NSToolbarItem.Identifier {
static let resetZoom = NSToolbarItem.Identifier("ResetZoom")
static let titleText = NSToolbarItem.Identifier("TitleText")
}

View File

@ -8,21 +8,17 @@ protocol TerminalViewDelegate: AnyObject {
/// Called when the currently focused surface changed. This can be nil. /// Called when the currently focused surface changed. This can be nil.
func focusedSurfaceDidChange(to: Ghostty.SurfaceView?) func focusedSurfaceDidChange(to: Ghostty.SurfaceView?)
/// The title of the terminal should change.
func titleDidChange(to: String)
/// The URL of the pwd should change. /// The URL of the pwd should change.
func pwdDidChange(to: URL?) func pwdDidChange(to: URL?)
/// The cell size changed. /// The cell size changed.
func cellSizeDidChange(to: NSSize) func cellSizeDidChange(to: NSSize)
/// The surface tree did change in some way, i.e. a split was added, removed, etc. This is /// Perform an action. At the time of writing this is only triggered by the command palette.
/// not called initially. func performAction(_ action: String, on: Ghostty.SurfaceView)
func surfaceTreeDidChange()
/// This is called when a split is zoomed. /// A split is resizing to a given value.
func zoomStateDidChange(to: Bool) func splitDidResize(node: SplitTree<Ghostty.SurfaceView>.Node, to newRatio: Double)
} }
/// The view model is a required implementation for TerminalView callers. This contains /// The view model is a required implementation for TerminalView callers. This contains
@ -31,7 +27,10 @@ protocol TerminalViewDelegate: AnyObject {
protocol TerminalViewModel: ObservableObject { protocol TerminalViewModel: ObservableObject {
/// The tree of terminal surfaces (splits) within the view. This is mutated by TerminalView /// The tree of terminal surfaces (splits) within the view. This is mutated by TerminalView
/// and children. This should be @Published. /// and children. This should be @Published.
var surfaceTree: Ghostty.SplitNode? { get set } var surfaceTree: SplitTree<Ghostty.SurfaceView> { get set }
/// The command palette state.
var commandPaletteIsShowing: Bool { get set }
} }
/// The main terminal view. This terminal view supports splits. /// The main terminal view. This terminal view supports splits.
@ -44,24 +43,18 @@ struct TerminalView<ViewModel: TerminalViewModel>: View {
// An optional delegate to receive information about terminal changes. // An optional delegate to receive information about terminal changes.
weak var delegate: (any TerminalViewDelegate)? = nil weak var delegate: (any TerminalViewDelegate)? = nil
// The most recently focused surface, equal to focusedSurface when
// it is non-nil.
@State private var lastFocusedSurface: Weak<Ghostty.SurfaceView> = .init()
// This seems like a crutch after switching from SwiftUI to AppKit lifecycle. // This seems like a crutch after switching from SwiftUI to AppKit lifecycle.
@FocusState private var focused: Bool @FocusState private var focused: Bool
// Various state values sent back up from the currently focused terminals. // Various state values sent back up from the currently focused terminals.
@FocusedValue(\.ghosttySurfaceView) private var focusedSurface @FocusedValue(\.ghosttySurfaceView) private var focusedSurface
@FocusedValue(\.ghosttySurfaceTitle) private var surfaceTitle
@FocusedValue(\.ghosttySurfacePwd) private var surfacePwd @FocusedValue(\.ghosttySurfacePwd) private var surfacePwd
@FocusedValue(\.ghosttySurfaceZoomed) private var zoomedSplit
@FocusedValue(\.ghosttySurfaceCellSize) private var cellSize @FocusedValue(\.ghosttySurfaceCellSize) private var cellSize
// The title for our window
private var title: String {
if let surfaceTitle, !surfaceTitle.isEmpty {
return surfaceTitle
}
return "👻"
}
// The pwd of the focused surface as a URL // The pwd of the focused surface as a URL
private var pwdURL: URL? { private var pwdURL: URL? {
guard let surfacePwd, surfacePwd != "" else { return nil } guard let surfacePwd, surfacePwd != "" else { return nil }
@ -75,42 +68,48 @@ struct TerminalView<ViewModel: TerminalViewModel>: View {
case .error: case .error:
ErrorView() ErrorView()
case .ready: case .ready:
VStack(spacing: 0) { ZStack {
// If we're running in debug mode we show a warning so that users VStack(spacing: 0) {
// know that performance will be degraded. // If we're running in debug mode we show a warning so that users
if (Ghostty.info.mode == GHOSTTY_BUILD_MODE_DEBUG || Ghostty.info.mode == GHOSTTY_BUILD_MODE_RELEASE_SAFE) { // know that performance will be degraded.
DebugBuildWarningView() if (Ghostty.info.mode == GHOSTTY_BUILD_MODE_DEBUG || Ghostty.info.mode == GHOSTTY_BUILD_MODE_RELEASE_SAFE) {
} DebugBuildWarningView()
}
Ghostty.TerminalSplit(node: $viewModel.surfaceTree) TerminalSplitTreeView(
.environmentObject(ghostty) tree: viewModel.surfaceTree,
.focused($focused) onResize: { delegate?.splitDidResize(node: $0, to: $1) })
.onAppear { self.focused = true } .environmentObject(ghostty)
.onChange(of: focusedSurface) { newValue in .focused($focused)
self.delegate?.focusedSurfaceDidChange(to: newValue) .onAppear { self.focused = true }
} .onChange(of: focusedSurface) { newValue in
.onChange(of: title) { newValue in // We want to keep track of our last focused surface so even if
self.delegate?.titleDidChange(to: newValue) // we lose focus we keep this set to the last non-nil value.
} if newValue != nil {
.onChange(of: pwdURL) { newValue in lastFocusedSurface = .init(newValue)
self.delegate?.pwdDidChange(to: newValue) self.delegate?.focusedSurfaceDidChange(to: newValue)
} }
.onChange(of: cellSize) { newValue in }
guard let size = newValue else { return } .onChange(of: pwdURL) { newValue in
self.delegate?.cellSizeDidChange(to: size) self.delegate?.pwdDidChange(to: newValue)
} }
.onChange(of: viewModel.surfaceTree?.hashValue) { _ in .onChange(of: cellSize) { newValue in
// This is funky, but its the best way I could think of to detect guard let size = newValue else { return }
// ANY CHANGE within the deeply nested surface tree -- detecting a change self.delegate?.cellSizeDidChange(to: size)
// in the hash value. }
self.delegate?.surfaceTreeDidChange() }
} // Ignore safe area to extend up in to the titlebar region if we have the "hidden" titlebar style
.onChange(of: zoomedSplit) { newValue in .ignoresSafeArea(.container, edges: ghostty.config.macosTitlebarStyle == "hidden" ? .top : [])
self.delegate?.zoomStateDidChange(to: newValue ?? false)
if let surfaceView = lastFocusedSurface.value {
TerminalCommandPaletteView(
surfaceView: surfaceView,
isPresented: $viewModel.commandPaletteIsShowing,
ghosttyConfig: ghostty.config) { action in
self.delegate?.performAction(action, on: surfaceView)
} }
}
} }
// Ignore safe area to extend up in to the titlebar region if we have the "hidden" titlebar style
.ignoresSafeArea(.container, edges: ghostty.config.macosTitlebarStyle == "hidden" ? .top : [])
} }
} }
} }
@ -140,6 +139,10 @@ struct DebugBuildWarningView: View {
} }
.background(Color(.windowBackgroundColor)) .background(Color(.windowBackgroundColor))
.frame(maxWidth: .infinity) .frame(maxWidth: .infinity)
.accessibilityElement(children: .combine)
.accessibilityLabel("Debug build warning")
.accessibilityValue("Debug builds of Ghostty are very slow and you may experience performance problems. Debug builds are only recommended during development.")
.accessibilityAddTraits(.isStaticText)
.onTapGesture { .onTapGesture {
isPopover = true isPopover = true
} }

View File

@ -0,0 +1,96 @@
import AppKit
class HiddenTitlebarTerminalWindow: TerminalWindow {
override func awakeFromNib() {
super.awakeFromNib()
// Setup our initial style
reapplyHiddenStyle()
// Notifications
NotificationCenter.default.addObserver(
self,
selector: #selector(fullscreenDidExit(_:)),
name: .fullscreenDidExit,
object: nil)
}
deinit {
NotificationCenter.default.removeObserver(self)
}
private static let hiddenStyleMask: NSWindow.StyleMask = [
// We need `titled` in the mask to get the normal window frame
.titled,
// Full size content view so we can extend
// content in to the hidden titlebar's area
.fullSizeContentView,
.resizable,
.closable,
.miniaturizable,
]
/// Apply the hidden titlebar style.
private func reapplyHiddenStyle() {
// Apply our style mask while preserving the .fullScreen option
if styleMask.contains(.fullScreen) {
styleMask = Self.hiddenStyleMask.union([.fullScreen])
} else {
styleMask = Self.hiddenStyleMask
}
// Hide the title
titleVisibility = .hidden
titlebarAppearsTransparent = true
// Hide the traffic lights (window control buttons)
standardWindowButton(.closeButton)?.isHidden = true
standardWindowButton(.miniaturizeButton)?.isHidden = true
standardWindowButton(.zoomButton)?.isHidden = true
// Disallow tabbing if the titlebar is hidden, since that will (should) also hide the tab bar.
tabbingMode = .disallowed
// Nuke it from orbit -- hide the titlebar container entirely, just in case. There are
// some operations that appear to bring back the titlebar visibility so this ensures
// it is gone forever.
if let themeFrame = contentView?.superview,
let titleBarContainer = themeFrame.firstDescendant(withClassName: "NSTitlebarContainerView") {
titleBarContainer.isHidden = true
}
}
// MARK: NSWindow
override var title: String {
didSet {
// Updating the title text as above automatically reveals the
// native title view in macOS 15.0 and above. Since we're using
// a custom view instead, we need to re-hide it.
reapplyHiddenStyle()
}
}
// We override this so that with the hidden titlebar style the titlebar
// area is not draggable.
override var contentLayoutRect: CGRect {
var rect = super.contentLayoutRect
rect.origin.y = 0
rect.size.height = self.frame.height
return rect
}
// MARK: Notifications
@objc private func fullscreenDidExit(_ notification: Notification) {
// Make sure they're talking about our window
guard let fullscreen = notification.object as? FullscreenBase else { return }
guard fullscreen.window == self else { return }
// On exit we need to reapply the style because macOS breaks it usually.
// This is safe to call repeatedly so if its not broken its still safe.
reapplyHiddenStyle()
}
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23094" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct"> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies> <dependencies>
<deployment identifier="macosx"/> <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23094"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.7"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
@ -17,10 +17,10 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/> <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/> <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="800" height="600"/> <rect key="contentRect" x="0.0" y="0.0" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="3008" height="1667"/> <rect key="screenRect" x="0.0" y="0.0" width="3008" height="1661"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ"> <view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/> <rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view> </view>
<connections> <connections>
<outlet property="delegate" destination="-2" id="tG2-b7-nb8"/> <outlet property="delegate" destination="-2" id="tG2-b7-nb8"/>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.7"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="TerminalController" customModule="Ghostty" customModuleProvider="target">
<connections>
<outlet property="window" destination="QvC-M9-y7g" id="cg9-Ep-qHg"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="👻 Ghostty" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="HiddenTitlebarTerminalWindow" customModule="Ghostty" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="3008" height="1661"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
<connections>
<outlet property="delegate" destination="-2" id="tG2-b7-nb8"/>
</connections>
<point key="canvasLocation" x="132" y="-82"/>
</window>
</objects>
</document>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.7"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="TerminalController" customModule="Ghostty" customModuleProvider="target">
<connections>
<outlet property="window" destination="QvC-M9-y7g" id="cg9-Ep-qHg"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="👻 Ghostty" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="TitlebarTabsTahoeTerminalWindow" customModule="Ghostty" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="3008" height="1661"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
<connections>
<outlet property="delegate" destination="-2" id="tG2-b7-nb8"/>
</connections>
<point key="canvasLocation" x="132" y="-82"/>
</window>
</objects>
</document>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="24093.7" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="24093.7"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="TerminalController" customModule="Ghostty" customModuleProvider="target">
<connections>
<outlet property="window" destination="QvC-M9-y7g" id="cg9-Ep-qHg"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="👻 Ghostty" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="TitlebarTabsVenturaTerminalWindow" customModule="Ghostty" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="0.0" y="0.0" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="3008" height="1661"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
</view>
<connections>
<outlet property="delegate" destination="-2" id="tG2-b7-nb8"/>
</connections>
<point key="canvasLocation" x="132" y="-82"/>
</window>
</objects>
</document>

Some files were not shown because too many files have changed in this diff Show More