Commit Graph

14732 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d186613ca4 terminal: change cell width when wider grapheme detected (#10465)
This PR updates the logic in Terminal `print` to include more cases of
changing a cell to be wide due to a grapheme cluster that needs to be
wide but starts off narrow. The existing case of this is a
text-presentation code point followed by VS16 to make it emoji
presentation. This PR handles more cases that are found in scripts such
as Devanagari where the correct grapheme width calculation sums up
multiple code points of non-zero widths. An example, as seen from
[uucode's issue #1](https://github.com/jacobsandlund/uucode/issues/1) is
`क्‍ष`, which now with https://github.com/ghostty-org/ghostty/pull/9680
merged is one grapheme cluster instead of two, but the U+0915 (first
code point) is width one and U+0937 (final code point) is also width
one, and the whole cluster should be width 1 + 1 = 2. This is important
to address with the grapheme break change otherwise these scripts would
show with narrow cells, incorrectly.

Before:

<img width="680" height="124" alt="CleanShot 2026-01-27 at 10 31 24@2x"
src="https://github.com/user-attachments/assets/4ff5959d-9c14-4062-8280-83004af38495"
/>

After:

<img width="646" height="118" alt="CleanShot 2026-01-27 at 10 29 10@2x"
src="https://github.com/user-attachments/assets/3ad11afd-2141-46fb-b22b-9fa7b2546366"
/>

---

Note that the logic here just takes `width_zero_in_grapheme` and if it's
not zero width, makes the cell wide. This is actually wrong for
graphemes with `prepend` (usually/always? zero width) followed by a
character that should be narrow width, but that's affecting a much
smaller number of graphemes. To address that, we would need to run the
full `wcwidth` from `uucode` on the grapheme, and compare the width
output with the current cell's `Wide`. I figured it'd be better to
incrementally just handle the bulk of the cases with the
`width_zero_in_grapheme` check.

This also adds tests to make sure moving the cell is handled correctly,
which was not the case for the existing VS16 logic.

There's a lot of code here to handle transferring the graphemes when the
narrow cell should wrap to the next line to become wide. I'd like
feedback on the approach here before attempting to clean anything up, if
desired (pull it out into a separate method?).

AI was used in some of the uucode changes in
https://github.com/ghostty-org/ghostty/pull/9678 (Amp--primarily for
tests), but everything was carefully vetted and much of it done by hand.
This PR was made without AI.
2026-02-23 08:12:52 -08:00
Jeffrey C. Ollie
35a5ea0e83 build(deps): bump namespacelabs/nscloud-cache-action from 1.4.1 to 1.4.2 (#10960)
Bumps
[namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action)
from 1.4.1 to 1.4.2.
<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.4.2</h2>
<h2>What's Changed</h2>
<ul>
<li>Append error cause to failure message by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/104">namespacelabs/nscloud-cache-action#104</a></li>
<li>Update <code>@​namespacelabs/actions-toolkit</code> to 0.2.6 by <a
href="https://github.com/rcrowe"><code>@​rcrowe</code></a> in <a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/pull/107">namespacelabs/nscloud-cache-action#107</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1.4.1...v1.4.2">https://github.com/namespacelabs/nscloud-cache-action/compare/v1.4.1...v1.4.2</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a90bb5d4b2"><code>a90bb5d</code></a>
Update <code>@​namespacelabs/actions-toolkit</code> to 0.2.6</li>
<li><a
href="60628686a0"><code>6062868</code></a>
Append error cause to failure message (<a
href="https://redirect.github.com/namespacelabs/nscloud-cache-action/issues/104">#104</a>)</li>
<li>See full diff in <a
href="https://github.com/namespacelabs/nscloud-cache-action/compare/v1.4.1...a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9">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.4.1&new-version=1.4.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 show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>
2026-02-23 10:00:40 -06:00
Jacob Sandlund
327cdbefad Merge remote-tracking branch 'upstream/main' into grapheme-width-changes 2026-02-23 10:57:49 -05:00
Jeffrey C. Ollie
05b4db574b nix: update ucs-detect to latest master (#10965)
This updates [ucs-detect](https://github.com/jquast/ucs-detect) to the
latest `master` version from 2/7/2026.

AI disclaimer: this was done almost entirely with the help of AI, with
this thread here:
https://ampcode.com/threads/T-019c8ac5-e8ab-738d-93a6-06ec5b20f5e2
2026-02-23 08:39:07 -06:00
Jacob Sandlund
79f0bfe374 nix: update ucs-detect to latest master 2026-02-23 09:23:42 -05:00
Jacob Sandlund
f53e4b43c4 Merge remote-tracking branch 'upstream/main' into grapheme-width-changes 2026-02-23 08:39:10 -05:00
dependabot[bot]
4f6fc324f1 build(deps): bump namespacelabs/nscloud-cache-action from 1.4.1 to 1.4.2
Bumps [namespacelabs/nscloud-cache-action](https://github.com/namespacelabs/nscloud-cache-action) from 1.4.1 to 1.4.2.
- [Release notes](https://github.com/namespacelabs/nscloud-cache-action/releases)
- [Commits](https://github.com/namespacelabs/nscloud-cache-action/compare/v1.4.1...a90bb5d4b27522ce881c6e98eebd7d7e6d1653f9)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-23 00:22:04 +00:00
ghostty-vouch[bot]
c61f184069 Sync CODEOWNERS vouch list (#10959)
Sync CODEOWNERS owners with vouch list.

## Added Users

- @Atomk

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-23 00:02:44 +00:00
Mitchell Hashimoto
20fe661c06 android: build improvements (#10956)
* Use a GitHub action to download the Android NDK
* Use helper functions available on `std.Build` to simplify the build
script.
* Use various Zig-isms to simplify the code.

FYI, using Nix to seems to be a non-starter as getting any Android
development kits from nixpkgs requires accepting the Android license
agreement and allowing many packages to use unfree licenses. And since
the packages are unfree they are not cached by NixOS so the build
triggers massive memory-hungry builds.
2026-02-22 15:00:08 -08:00
Jeffrey C. Ollie
2a02b8f0ef android: build improvements
* Use a GitHub action to download the Android NDK
* Use helper functions available on `std.Build` to simplify
  the build script.
* Use various Zig-isms to simplify the code.

FYI, using Nix to seems to be a non-starter as getting any Android
development kits from nixpkgs requires accepting the Android license
agreement and allowing many packages to use unfree licenses. And since
the packages are unfree they are not cached by NixOS so the build
triggers massive memory-hungry builds.
2026-02-22 16:26:22 -06:00
Mitchell Hashimoto
f0f80d4902 input: Disallow table/chain= and make chain apply to the most recent table (#10954)
Fixes #10039

(Context is all there)
2026-02-22 14:06:38 -08:00
Mitchell Hashimoto
c6e7a7b85a input: Disallow table/chain= and make chain apply to the most recent table
Fixes #10039

(Context is all there)
2026-02-22 13:59:27 -08:00
ghostty-vouch[bot]
504a3611f6 Update VOUCHED list (#10947)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10946) from
@00-kat.

Vouch: @Laxystem

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-22 14:04:37 +00:00
Mitchell Hashimoto
861a9cf537 ci: Add lib-vt Android support (#10925)
The PR introduces `lib-vt` Android support as discussed in #10902. 

A few more notes:

- Introduces new CI for Android builds as a change requires NDK to be
configured.
- To build locally, it is required to have the NDK installed in the
system and either have the path exported via `ANDROID_NDK_HOME` pointing
to the exact NDK path or `ANDROID_HOME` or `ANDROID_SDK_ROOT` pointing
at the Android SDK path from which the build system will infer the NDK
path and version.
- 16kb page size alignment is configured for Android 15+. Builds are
backward compatible with 4kb page size devices.
2026-02-21 21:13:23 -08:00
Mitchell Hashimoto
79e530a0f3 ci: fix CI for NDK 2026-02-22 12:57:57 +08:00
Mitchell Hashimoto
3fca5bd18b update deps to mirror (#10939) 2026-02-21 20:50:20 -08:00
Mitchell Hashimoto
c4c58a9f58 update deps to mirror 2026-02-21 20:38:49 -08:00
Mitchell Hashimoto
84b7d14aa0 Update iTerm2 colorschemes (#10938)
Upstream release:
https://github.com/mbadolato/iTerm2-Color-Schemes/releases/tag/release-20260216-151611-fc73ce3
2026-02-21 20:31:49 -08:00
mitchellh
fad5599c32 deps: Update iTerm2 color schemes 2026-02-22 00:18:10 +00:00
Kat
1e380e8bf1 i18n: add 1.3 it_IT translations (#10708)
Added the new Italian translations for 1.3.0. Any feedback is
appreciated, as always!
2026-02-21 23:35:54 +00:00
Kat
266e910cd1 translation update for lt_LT - filled in missing strings (#10886)
added translations for:
- Open in Ghostty (Nautilus)
- Change Tab Title menu/dialog

all 74 messages done now
2026-02-21 23:32:39 +00:00
ghostty-vouch[bot]
3de6922295 Update VOUCHED list (#10936)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10824) from
@mitchellh.

Vouch: @rgehan

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-21 23:07:39 +00:00
Mitchell Hashimoto
4f3e8971a0 config: selection-word-chars parses escape sequences (#10933)
Fixes #10548

Escaped characters in selection-word-chars are now correctly parsed,
allowing for characters like `\t` to be included in the set of word
characters.
2026-02-21 14:58:52 -08:00
Mitchell Hashimoto
cdfa73b403 config: selection-word-chars parses escape sequences
Fixes #10548

Escaped characters in selection-word-chars are now correctly parsed,
allowing for characters like `\t` to be included in the set of word
characters.
2026-02-21 14:52:28 -08:00
Mitchell Hashimoto
548930a742 renderer: kitty image update requires draw_mutex (#10932)
Fixes #10680

The image state is used for drawing, so when we update it, we need to
acquire the draw mutex. All our other state updates already acquire the
draw mutex but Kitty images are odd in that they happen in the critical
area (due to their size).
2026-02-21 14:34:23 -08:00
Mitchell Hashimoto
caec9e04d2 renderer: kitty image update requires draw_mutex
Fixes #10680

The image state is used for drawing, so when we update it, we need to
acquire the draw mutex. All our other state updates already acquire the
draw mutex but Kitty images are odd in that they happen in the critical
area (due to their size).
2026-02-21 14:28:39 -08:00
Mitchell Hashimoto
12c2f5c359 prettier 2026-02-21 13:56:55 -08:00
ghostty-vouch[bot]
2e102b015f Update VOUCHED list (#10931)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/10840#issuecomment-3939561550)
from @trag1c.

Vouch: @JosephMart

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-21 21:49:53 +00:00
Mitchell Hashimoto
255b0c9964 macos: swiftlint 'multiple_closures_with_trailing_closure' rule (#10929)
Also, re-enable the 'force_cast' rule, which was addressed earlier.
2026-02-21 13:43:20 -08:00
Jon Parise
dd29617cd3 macos: swiftlint 'multiple_closures_with_trailing_closure' rule
Also, re-enable the 'force_cast' rule, which was addressed earlier.
2026-02-21 10:17:15 -08:00
ghostty-vouch[bot]
2e172eeb60 Update VOUCHED list (#10927)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10920) from
@mitchellh.

Vouch: @sunshine-syz

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-21 17:18:28 +00:00
Elias Andualem
88a6e8ae4b build: add Android build target for libghostty-vt 2026-02-22 00:01:03 +08:00
Elias Andualem
b728e41d77 build: clarify ANDROID_NDK_HOME variable description 2026-02-21 23:44:43 +08:00
Mitchell Hashimoto
4581392625 macos: fix new tab crash (#10924)
It was introduced in 2a81d8cd2910b12fe007f0bc5fb5d6be57f0f0fe[0]. We
lost the subview. prefix of from the contains() call.


Fixes: https://github.com/ghostty-org/ghostty/issues/10923
Link:
2a81d8cd29
[0]
2026-02-21 07:25:24 -08:00
Tristan Partin
407b3c082f macos: fix new tab crash
It was introduced in 2a81d8cd2910b12fe007f0bc5fb5d6be57f0f0fe[0]. We
lost the subview. prefix of from the contains() call.

Co-authored-by: Brent Schroeter <github@brentsch.com>
Fixes: https://github.com/ghostty-org/ghostty/issues/10923
Link: 2a81d8cd29 [0]
2026-02-21 09:08:04 -06:00
Elias Andualem
e7cfb17d5a build: support 16kb page sizes for Android 15+ 2026-02-21 22:48:36 +08:00
Elias Andualem
bd9611650f build: add support for Android NDK path configuration 2026-02-21 21:17:09 +08:00
Kat
02ca33d119 i18n/zh: update strings (#10844)
See #10632
2026-02-21 08:02:15 +00:00
Mitchell Hashimoto
2a81d8cd29 macos: swiftlint 'for_where' rule (#10909) 2026-02-20 21:06:47 -08:00
Mitchell Hashimoto
c17844c2db ci: use explicit PAT with path-filter for higher rate limits (#10915) 2026-02-20 21:06:39 -08:00
Mitchell Hashimoto
7c504649fd ci: use explicit PAT with path-filter for higher rate limits 2026-02-20 21:05:54 -08:00
Mitchell Hashimoto
ce46caeacb macos: swiftlint 'switch_case_alignment' rule (#10908) 2026-02-20 21:02:46 -08:00
Mitchell Hashimoto
6ec8744b16 macOS: expand tilde in file paths before opening (#10863)
## Summary

Cmd-clicking a file path containing `~` (e.g. `~/Documents/file.txt`)
fails to open the file on macOS because `URL(filePath:)` treats `~` as a
literal directory name rather than the user's home directory.

This uses `NSString.expandingTildeInPath` to resolve `~` before
constructing the file URL.

## Root Cause

In `openURL()`, when the URL string has no scheme it falls through to:

```swift
url = URL(filePath: action.url)
```

Swift's `URL(filePath:)` does not perform tilde expansion. A path like
`~/Documents/file.txt` produces a URL pointing to a non-existent file,
and `NSWorkspace.open` silently fails.

## Fix

```swift
let expandedPath = NSString(string: action.url).expandingTildeInPath
url = URL(filePath: expandedPath)
```

## Reproduction

1. Have a terminal application (e.g. Claude Code) that outputs file
paths with `~` prefixes
2. Cmd-click the path in Ghostty on macOS
3. The file does not open (fails silently)

With this fix, the path resolves correctly and opens in the default
editor.
2026-02-20 20:56:27 -08:00
Alex Feijoo
b65261eb66 macOS: expand tilde in file paths before opening
`URL(filePath:)` treats `~` as a literal directory name, so
cmd-clicking a path like `~/Documents/file.txt` would fail to
open because the resulting file URL doesn't point to a real file.

Use `NSString.expandingTildeInPath` to resolve `~` to the user's
home directory before constructing the file URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:37:54 -08:00
ghostty-vouch[bot]
e7b8e731eb Update VOUCHED list (#10914)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10581) from
@mitchellh.

Vouch: @neo773

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-21 04:31:43 +00:00
Mitchell Hashimoto
1e7f470eb8 ci: use every to filter vouch paths (#10913)
The prior filter wasn't working because the default quantifier is `any`.
2026-02-20 20:30:23 -08:00
Mitchell Hashimoto
07a68b3e65 ci: use every to filter vouch paths
The prior filter wasn't working because the default quantifier is
`any`.
2026-02-20 20:28:15 -08:00
ghostty-vouch[bot]
3404595c72 Update VOUCHED list (#10912)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/10906) from
@mitchellh.

Vouch: @NateSmyth

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-21 04:15:38 +00:00
Jon Parise
2d6fa92d78 macos: swiftlint 'for_where' rule 2026-02-20 19:42:48 -05:00
Jon Parise
f7e6639c43 macos: swiftlint 'switch_case_alignment' rule 2026-02-20 19:18:40 -05:00