Commit Graph

12855 Commits (7f0468f910fba3e73303bccf1e3d92a36ece3acd)

Author SHA1 Message Date
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
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
Mitchell Hashimoto 765ee68429
apprt/gtk: set multiple content types for clipboard ops (#9431)
This supports the new `setClipboard` parameter that may provide data in
multiple formats, allowing us to copy rich text to/from the clipboard as
well as other types in the future.

This all fixes a memory leak on all clipboard ops that snuck through.
2025-10-31 10:58:12 -07:00
Mitchell Hashimoto 46db1cfd8f
apprt/gtk: set multiple content types for clipboard ops
This supports the new `setClipboard` parameter that may provide data in
multiple formats, allowing us to copy rich text to/from the clipboard as
well as other types in the future.
2025-10-31 10:53:10 -07:00
Mitchell Hashimoto 15bfdcb41e
input: write_*_file actions take an optional format (#9428)
Fixes #9398

This is fully backwards compatible. Example:
`write_screen_file:open,html`
2025-10-31 09:52:13 -07:00
Mitchell Hashimoto 901708e8da
input: write_*_file actions take an optional format
Fixes #9398
2025-10-31 09:49:59 -07:00
Mitchell Hashimoto 24b9778432
input: add more copy formatted options to the command palette 2025-10-31 08:21:16 -07:00
Mitchell Hashimoto 7d6cd12fb3
terminal: emit non-ASCII characters as Unicode codepoints for HTML (#9427)
Fixes #9426

Since we can't set the meta charset tag since we emit partial HTML, we
use codepoint entities like `&#123;` for non-ASCII characters to ensure
proper rendering.
2025-10-31 08:19:41 -07:00
Mitchell Hashimoto 05d2f881b6
terminal: emit non-ASCII characters as Unicode codepoints for HTML
Fixes #9426

Since we can't set the meta charset tag since we emit partial HTML, we
use codepoint entities like `&#123;` for non-ASCII characters to
ensure proper rendering.
2025-10-31 08:15:25 -07:00
Lukas b043623bb2
macos: Fix documentView padding calculations (#9423)
Fixes #9420 

The problem was ultimately that the padding calculations assumed that
the total vertical padding is always less than one cell height (just
doing `fmod(contentHeight, cellHeight)` instead of the more careful
`contentHeight - scrollbar.len * cellHeight`). This is not at all true,
and as a result, the calculated document height was often a cell height
short of what it should be.

For similar reasons, we shouldn't rely on `fmod`-based padding update
calculations during relayouting. This PR takes the proper approach of
saving and reusing the current scrollbar state to calculate the correct
document height on every layout. As a bonus, this removes the flickering
scrollbar during resize that I complained about in #9296.
2025-10-31 11:32:37 +01:00
Daniel Wennberg 951374cd1c Fix documentView padding calculations 2025-10-31 00:39:03 -07:00
Mitchell Hashimoto bc0f5e4d57
Copy formatted text to clipboard with plain, make it configurable (#9418)
Fixes #9397 

This makes `copy_to_clipboard` take an optional parameter with the
format to copy. **The default has changed to `mixed`,** which will set
multiple content types on the clipboard allowing the OS or target
application to choose what they prefer. In this case, we set both
`text/plain` and `text/html`.

This only includes the macOS implementation. The GTK side still needs to
be done, but is likely trivial to do.


https://github.com/user-attachments/assets/b1b2f5cd-d59a-496e-bb77-86a60571ed7f
2025-10-30 15:17:16 -07:00
Mitchell Hashimoto 5c1f036613
macos: assert only one text-plain gets written to clipboard 2025-10-30 15:16:15 -07:00
Mitchell Hashimoto 54fe54fe37
apprt/gtk: fix build errors 2025-10-30 14:43:31 -07:00
Mitchell Hashimoto f3352dd90b
core: copy the proper format to the clipboard as configured 2025-10-30 14:36:32 -07:00
Mitchell Hashimoto 9a198b47a0
apprt/gtk: support new set clipboard API 2025-10-30 14:11:00 -07:00
Mitchell Hashimoto 26bdb12f64
core: update Surface to use setClipboard 2025-10-30 14:08:29 -07:00
Mitchell Hashimoto 0f1c46e4a4
macos: support setting multiple clipboard content types 2025-10-30 14:01:58 -07:00
Mitchell Hashimoto df037d75a6
copy_to_clipboard format types 2025-10-30 13:40:32 -07:00
Mitchell Hashimoto 77b038dcb6
update README 2025-10-30 13:14:23 -07:00
Mitchell Hashimoto 038cdde334
terminal: formatters now emit background/foreground information (#9414)
This allows the full terminal style to be copied, except for the cursor:

<img width="1136" height="660" alt="image"
src="https://github.com/user-attachments/assets/448d7125-d4fd-477b-9a9b-96176d7fae56"
/>
2025-10-30 10:44:08 -07:00
Mitchell Hashimoto 83a4f32a14
terminal: formatter improvements for color handling 2025-10-30 10:39:46 -07:00
Mitchell Hashimoto 4c504560d4
terminal: move bg, fg, cursor color state into Terminal (#9412)
This moves the bg, fg, cursor color state into the `Terminal` struct,
including all default and override handling. I've rewritten our color
palette handling so that overrides, defaults, resets, etc are all
handled by the terminal package. I've added much more unit test
coverage.

This has various benefits:

* libghostty now handles OSC and Kitty color operations
* formatters can be aware of all of these colors (not implemented in
this PR)
* renderer has way less inter-thread messages
* renderer uses less memory 
* termio stream handler uses less memory and becomes simpler
* override logic, changing defaults can all be unit tested
* we have unit tests for kitty color operations end-to-end now (cc
@jcollie heyo!)

There's a ton of risk on this PR too. There's a lot of really tiny
conditionals EVERYWHERE and I'm sure I got at least one wrong. We'll let
this bake in tip to find those, I'm sure they're minor and will show up
as just the wrong color somewhere.

**AI disclosure:** Amp wrote many of the tests. I did all the
implementation.
2025-10-30 10:15:33 -07:00
Mitchell Hashimoto 799e4bca50
example/zig-formatter: fix build for new palette API 2025-10-30 10:07:44 -07:00