Commit Graph

12877 Commits

Author SHA1 Message Date
Daniel Wennberg
e3ff49e653 macOS: Update core surface size when config changes 2025-11-08 23:34:56 -08:00
Lukas
2592b96f6d macOS: Update core surface size when scroller style changes (#9523)
Listen to changes to the OS preferred scroller style and use it to
trigger updates the core surface size such that the scrollbar margin
kept in sync. Otherwise, the margin update would be deferred until the
next window or surface resize/split event.

In the video I'm turning my external bluetooth mouse off and on again,
triggering these updates.


https://github.com/user-attachments/assets/15c0ee40-2c1a-419a-8b07-8270e9f7a12f
2025-11-09 08:11:02 +01:00
Daniel Wennberg
5845a7bd29 macOS: Update core surface size when scroller style changes 2025-11-08 22:41:59 -08:00
Lukas
0d5ecc7713 macOS: Don't clip surfaceView to contentView, fix transparent scrollbar background (#9517)
Here's a much simpler approach to fixing #9248 that doesn't involve
changes to the core or libghostty (the apprt one) at all. No safe area
API needed. All that's needed is for the content view to not clip its
subviews, such that the surface view can draw behind the scrollbar even
though it's a subview of the content view.

I haven't looked at the details on the renderer side, but since this
works it must be that it always renders background all the way to the
edges of the framebuffer, regardless of what the terminal screen size
(including window padding) happens to be. (This was already evident in
that we were able to avoid a transparent slot when the scrollbar was
hidden.) So I guess we kind of already have a safe area API through this
ability to set a screen size that's different from the framebuffer size?
_EDIT:_ I guess what's missing is the ability to shift the origin of the
screen within the framebuffer.

Fixes #9248, supersedes #9291.
2025-11-08 19:29:28 +01:00
Daniel Wennberg
3142c5aa60 macOS: Don't clip surfaceView to contentView
Fixes #9248
2025-11-08 09:34:02 -08:00
Leah Amelia Chen
9894722051 core: check that file reader has capacity before priming (#9515) 2025-11-08 06:25:48 +01:00
Daniel Wennberg
cf126baeb5 Check that file reader has capacity before priming 2025-11-07 20:29:16 -08:00
Mitchell Hashimoto
12c8b6c1aa macOS: Refactor scrollview to preserve state across split tree changes (#9446)
Fixes #9444
2025-11-07 15:10:45 -08:00
Mitchell Hashimoto
eb29274f6a Feat/clipboard codepoint map (#9499)
Closes #8383
2025-11-07 15:01:41 -08:00
Mitchell Hashimoto
43d81600de terminal: add codepoint mapping to the formatter itself 2025-11-07 14:58:23 -08:00
benodiwal
422fa8d304 refactor: remove unused hash methods from ClipboardCodepointMap 2025-11-07 14:30:22 -08:00
benodiwal
11274cd9e5 feat: integrate clipboard-codepoint-map with clipboard pipeline 2025-11-07 14:30:22 -08:00
benodiwal
a162fa8f55 feat: add clipboard-codepoint-map configuration parsing 2025-11-07 14:30:22 -08:00
Mitchell Hashimoto
0d26bace25 macOS: attach close confirmation alert to the first window that actually needs it (#9509)
Currently, close confirmation is always attached to the first tab in the
window group.

**This pr will attach the alert to the window that actually needs that
confirmation, so upon close, the window with the running process will be
focused.**


https://github.com/user-attachments/assets/8fddd4ce-a3f9-4e18-a645-80c85b5ba995
2025-11-07 14:26:00 -08:00
Mitchell Hashimoto
04563a16b6 macos: simplify the code to a more understandable style 2025-11-07 14:24:56 -08:00
Lars
1eecd448e9 remove needsConfirm 2025-11-07 14:16:10 -08:00
Lars
f94cb01ec8 macOS: attach close confirmation alert to the first window that actually needs it 2025-11-07 14:16:10 -08:00
Mitchell Hashimoto
fbabafe8e3 macOS: fix undo new tab will cause a crash (#9512)
### Reproduce Steps on Tip (1.2.3 seems fine)

1. Open a new window.
2. Open a new tab.
3. **Wait for 2-3 seconds.**
4. Undo.
5. 💥

**RC is unclear for me, but dispatching it seems to fix it.**
2025-11-07 14:15:19 -08:00
Lars
3f20f153c5 macOS: fix undo new tab will cause a crash 2025-11-07 14:14:44 -08:00
Mitchell Hashimoto
7f0468f910 fix ucs-detect script 2025-11-06 12:56:43 -08:00
Mitchell Hashimoto
14bae9ed0a nix: add ucs-detect (#9506)
This makes `ucs-detect` available in our Nix environment so that we can
run tests on our Unicode support. In the future, I'd like to modify our
CI to run this too.

This also adds a `./test/ucs-detect.sh` script that runs `ucs-detect`
with consistent options that match the upstream test styles.

Fwiw, I did try to write a simple libghostty-based Zig binary to run
this automatically for us in CI but while libghostty-vt is very good, we
don't yet have the proper APIs setup for actually setting up a Pty and
sub processing commands and hooking them up to a VT stream. So, I punt
that to the future.
2025-11-06 10:22:34 -07:00
Mitchell Hashimoto
a315f8f32e nix: add ucs-detect
This makes `ucs-detect` available in our Nix environment so that we can
run tests on our Unicode support. In the future, I'd like to modify our
CI to run this too.

This also adds a `./test/ucs-detect.sh` script that runs `ucs-detect`
with consistent options that match the upstream test styles.
2025-11-06 09:22:18 -08:00
Mitchell Hashimoto
5ca3b766be core: handle utf-8 bom in config files (#9497)
If a UTF-8 byte order mark starts a config file, it should be ignored.
This also refactors config file loading a bit to reduce redundant code
and to make it possible to test loading config from a file.

Fixes #9490
2025-11-06 10:01:56 -07:00
Jeffrey C. Ollie
df86e30877 drop utf-8 bom log message to info 2025-11-06 11:00:38 -06:00
Jeffrey C. Ollie
c8e317b60f core: handle utf-8 bom in config files
If a UTF-8 byte order mark starts a config file, it should be ignored.
This also refactors config file loading a bit to reduce redundant code
and to make it possible to test loading config from a file.

Fixes #9490
2025-11-06 10:59:26 -06:00
Mitchell Hashimoto
f54c3d9209 macOS: set the macos-icon from a separate thread (#9485)
Closes #8793
2025-11-06 09:55:57 -07:00
Mitchell Hashimoto
ec2ef5cf21 macOS: fix Dictation icon starting above the text, not below (#9488)
Partially fixes #8493.

After dictating some texts, the icon still appears above, but it will
return to its right position after resizing or `\n` (saying newline, not
hitting enter).

This behaviour is better than before, where the icon always appeared
above.

> Quicklook doesn't seem to call this on Tahoe, but it still works well
anyway.

### Reference:


9e905357bb/src/nsterm.m (L7426)



https://github.com/user-attachments/assets/6bf818c3-a0bb-412f-ae06-673f67cdeae4
2025-11-06 09:55:36 -07:00
Mitchell Hashimoto
4df50da207 macOS: fix funky resolution in quick terminal (#9504)
Same as #9503 but based on main
2025-11-06 09:52:11 -07:00
Mitchell Hashimoto
9786d0ea73 terminal: keypad variation sequences should respect VS16 (#9502)
This fixes the VS16 issues found in this test:
https://ucs-detect.readthedocs.io/sw_results/ghostty.html#ghostty This
is also a more robust way to handle VS15/16 in general.

This commit also changes our propeties to be a packed struct which
reduces its size from 4 bytes to 1 and likewise drops our unicode table
size 4x. This isn't as big as it seems, since this only affects stage3
of our LUT which goes from 108 bytes to 27 bytes.

## Before

<img width="1996" height="1740" alt="CleanShot 2025-11-06 at 07 08
20@2x"
src="https://github.com/user-attachments/assets/79850071-a2d5-4d6d-a76b-7ebf355b4480"
/>

## After

<img width="1996" height="1740" alt="CleanShot 2025-11-06 at 07 08
02@2x"
src="https://github.com/user-attachments/assets/44f809f2-93cd-4c97-8f42-46cd8f72ec8b"
/>
2025-11-06 08:20:28 -07:00
Lars
c8c36a6035 macOS: fix funky resolution in quick terminal 2025-11-06 16:13:05 +01:00
Mitchell Hashimoto
3d58dc51c9 terminal: keypad variation sequences should respect VS16
This fixes the VS16 issues found in this test:
https://ucs-detect.readthedocs.io/sw_results/ghostty.html#ghostty
This is also a more robust way to handle VS15/16 in general. 

This commit also changes our propeties to be a packed struct which
reduces its size from 4 bytes to 1 and likewise drops our unicode table
size 4x.
2025-11-06 07:05:57 -08:00
Mitchell Hashimoto
923bde72d8 unicode: update uucode, force emoji modifiers width 2 as standalone (#9493)
This updates uucode. As part of this, the wcwidth implementation was
updated (in uucode) to make emoji modifiers width ZERO. But if they're
standalone, we want them as width 2.

So this also contains a change to force them as width 2 for our width
calculation. This only matters for standalone emoji modifiers, because
when they form a valid grapheme we don't use this width calculation.
2025-11-05 16:43:03 -07:00
Mitchell Hashimoto
631c58a302 unicode: update uucode, force emoji modifiers width 2 as standalone
This updates uucode. As part of this, the wcwidth implementation was
updated (in uucode) to make emoji modifiers width ZERO. But if they're
standalone, we want them as width 2.

So this also contains a change to force them as width 2 for our width
calculation. This only matters for standalone emoji modifiers, because
when they form a valid grapheme we don't use this width calculation.
2025-11-05 14:57:48 -08:00
Lars
98ae1dbd10 macOS: fix Dictation icon starting above the text, not below
Partially fixes #8493.

After dictating some texts, the icon still appears above, but it will return to its right position after resizing or `\n` (saying newline, not hitting enter).

This behaviour is better than before, where the icon always appeared above.

### Reference:

9e905357bb/src/nsterm.m (L7426)
2025-11-05 18:22:08 +01:00
Mitchell Hashimoto
d43be63851 Add an example for palette configuration (#9473)
I found this syntax a bit confusing when I first read it, so I thought
it would be helpful for the next person to add a short example.
2025-11-05 06:34:34 -08:00
Lars
7472fb7732 macOS: set the macos-icon from a separate thread 2025-11-05 12:27:35 +01:00
Avery Mcnab
13d5f0c503 Add an example for palette configuration
I found this syntax a bit confusing when I first read it, so I thought it would be helpful for the next person to add a short example.
2025-11-04 15:02:03 +00:00
Daniel Wennberg
afc64f6285 Refactor scrollview to preserve state across split tree changes 2025-11-04 00:02:21 -08:00
Daniel Wennberg
9002c5dbd2 Preserve surface content size across backing updates 2025-11-04 00:02:21 -08:00
Daniel Wennberg
d678e2e305 Use notifications to deal with NSScrollPocket 2025-11-04 00:02:21 -08:00
Mitchell Hashimoto
bbaee5e0a0 build(deps): bump namespacelabs/nscloud-cache-action from 1.2.20 to 1.2.21 (#9460)
Bumps
[namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action)
from 1.2.20 to 1.2.21.
<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.21</h2>
<h2>What's Changed</h2>
<ul>
<li>feat: <code>bun</code> &amp; <code>deno</code> cache mode by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/45">namespacelabs/nscloud-cache-action#45</a></li>
<li>Support <code>golangci-lint</code> caching by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/46">namespacelabs/nscloud-cache-action#46</a></li>
<li>Add Mise cache mode by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/47">namespacelabs/nscloud-cache-action#47</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1...v1.2.21">https://github.com/namespacelabs/nscloud-cache-action/compare/v1...v1.2.21</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="446d8f3905"><code>446d8f3</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/47">#47</a>
from rcrowe/mise-support</li>
<li><a
href="613cebb068"><code>613cebb</code></a>
Add Mise cache mode</li>
<li><a
href="7dddb61a4c"><code>7dddb61</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/46">#46</a>
from rcrowe/cache-mode-golangci-lint</li>
<li><a
href="2de3d9c86f"><code>2de3d9c</code></a>
Search for directory output</li>
<li><a
href="76fbc4cf47"><code>76fbc4c</code></a>
Build dist</li>
<li><a
href="74129e9b23"><code>74129e9</code></a>
Actions job</li>
<li><a
href="99c7dbff89"><code>99c7dbf</code></a>
Support golangci-lint caching</li>
<li><a
href="9ad1d3f484"><code>9ad1d3f</code></a>
Merge pull request <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/45">#45</a>
from rcrowe/cache-mode-deno</li>
<li><a
href="a1d88d2acc"><code>a1d88d2</code></a>
Support bun cache mode</li>
<li><a
href="93e08c88b5"><code>93e08c8</code></a>
Support deno cache mode</li>
<li>Additional commits viewable in <a
href="d93899d984...446d8f3905">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.20&new-version=1.2.21)](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-11-03 11:10:29 -08:00
dependabot[bot]
551c1e68e0 build(deps): bump namespacelabs/nscloud-cache-action
Bumps [namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action) from 1.2.20 to 1.2.21.
- [Release notes](https://github.com/namespacelabs/nscloud-cache-action/releases)
- [Commits](d93899d984...446d8f3905)

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

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-03 00:07:29 +00:00
Mitchell Hashimoto
329aa7d334 nix: don't use deprecated pkgs.system (#9458)
'system' has been renamed to/replaced by 'stdenv.hostPlatform.system'

https://github.com/NixOS/nixpkgs/pull/456527
2025-11-02 14:29:37 -08:00
Mitchell Hashimoto
0eeae265aa apprt/gtk: (clipboard) add X11 atoms and extra MIME types for text content (#9456)
This adds the `UTF8_STRING` atom and explicit UTF-8 character set MIME
type (`text/plain;charset=utf-8`) to text content when being sent to the
clipboard under the new multipart support.

This fixes clipboard support under X11 particularly, which generally
looks for the `UTF8_STRING` atom when looking for text content. This can
be verified with `xclip -out -verbose`, or trying to do things like
paste in Firefox.

I've noted that there's a number of other older atoms that exist, but
I've refrained from adding them for now. Kitty only seems to set
`UTF8_STRING` and I've had a hard time finding consensus on what exactly
is the correct set otherwise.
2025-11-02 13:51:10 -08:00
Caleb Norton
d4f474bb35 nix: don't use deprecated pkgs.system
'system' has been renamed to/replaced by 'stdenv.hostPlatform.system'
https://github.com/NixOS/nixpkgs/pull/456527
2025-11-02 13:21:12 -06:00
Chris Marchesi
e7c68142e3 apprt/gtk: (clipboard) add X11 atoms, extra MIME types for text content
This adds the UTF8_STRING atom and explicit UTF-8 character set MIME
type (text/plain;charset=utf-8) to text content when being sent to the
clipboard under the new multipart support.

This fixes clipboard support under X11 particularly, which generally
looks for the UTF8_STRING atom when looking for text content. This can be
verified with xclip -out -verbose, or trying to do things like paste in
Firefox.

I've noted that there's a number of other older atoms that exist, but
I've refrained from adding them for now. Kitty only seems to set
UTF8_STRING and I've had a hard time finding consensus on what exactly
is the correct set otherwise.
2025-11-02 11:19:10 -08:00
Mitchell Hashimoto
955087f5f2 i18n: prefer using ellipsis over three dots (#9455)
After skimming through the norwegian bokmål translation
(https://github.com/ghostty-org/ghostty/blob/main/po/nb_NO.UTF-8.po) I
noticed a inconsistent use of three dots/ellipses. On [line
93](https://github.com/ghostty-org/ghostty/blob/main/po/nb_NO.UTF-8.po#L93),
three dots (`...`) are present where the actual ellipsis sign (`…`)
should be used instead. As mentioned in [this discord
comment](https://discord.com/channels/1005603569187160125/1349894806180204625/1434515563496996988).

This is not a big "problem" by itself, but looking at the english
translation and the rest of norwegian ones, you'll see that they all use
the ellipsis sign. (e.g. `Execute a command…`, `Endre tittel…`)

This is just a simple one-liner replacing the three periods with an
ellipsis sign.

cc @uzaaft
2025-11-02 07:14:38 -08:00
Mitchell Hashimoto
aa5ae095b0 Update iTerm2 colorschemes (#9450)
Upstream release:
https://github.com/mbadolato/iTerm2-Color-Schemes/releases/tag/release-20251027-150540-8f50c1d
2025-11-02 07:09:48 -08:00
realguse
f6faf2a515 chore(i18n): prefer using ellipsis over three dots 2025-11-02 14:52:54 +01:00
mitchellh
9e2caedb7d deps: Update iTerm2 color schemes 2025-11-02 00:15:16 +00:00