Mitchell Hashimoto
6b2097e872
core: hold lock during keyCallback when mouseRefreshLinks is called
...
From #9812
I'm not sure if this is the root cause of the crash in #9812 but the
LLM-discovered issue that we are not holding a lock here appears to be a
real issue. I manually traced the code paths and thought about this and
looked where we call `mouseRefreshLinks` in other places and this
appears to be a real bug.
2025-12-04 19:45:03 -08:00
Mitchell Hashimoto
3f241502c2
terminal/tmux: a lot more control mode parsing, functionality ( #9803 )
...
Continuing just build foundation for #1935 . There are no user-facing
changes here.
- This adds more command parsing for control mode output. I _believe_ we
now parse enough to at least render everything initially for most tmux
sessions. At least, from the VT parsing side (we haven't done any GUI
work whatsoever to react to this).
- This also adds a new layout string parser, e.g.
`159x48,0,0{79x48,0,0,79x48,80,0}` into a useful struct. We'll need this
to convert our visible layouts into actual GUI components, eventually.
- This adds a new output format parser for commands such as
`list-windows`. Control mode sends output framed in `%begin/%end`
blocks, but the output is in an arbitrary format depending on the input
command and unrelated to control mode itself. The output format parser
will let us parse this output.
I think this is a good place to stop and PR. I think next up I might try
hooking up a state machine to `src/termio/stream_handler.zig` to start
actually working with this. Before that, it may behoove me to change
`stream_readonly` to support non-readonly operations via callback so I
can do DCS and maybe unit test this whole thing too.... we'll see where
the wind blows.
**AI disclosure:** AI wrote many tests and did a lot of implementation
here. I reviewed everything manually though and understand it all
completely.
2025-12-04 15:30:13 -08:00
Mitchell Hashimoto
cf23d1c39d
core: rate limit BEL character processing ( #9810 )
...
If the BEL character is received too frequently, the GUI thread can be
starved and Ghostty will lock up and eventually crash. This PR limits
BEL handling to 1 per 100ms.
Fixes #9800 .
2025-12-04 15:29:58 -08:00
Jeffrey C. Ollie
68426dc21a
core: rate limit BEL character processing
...
If the BEL character is received too frequently, the GUI thread can be
starved and Ghostty will lock up and eventually crash. This PR limits
BEL handling to 1 per 100ms.
Fixes #9800 .
2025-12-04 12:32:58 -06:00
Cédric Bulteel
0a03434656
gtk: fix xkb mapping not working on linux
...
Signed-off-by: Cedric BULTEEL <cedric@oceanspy.com >
2025-12-04 19:19:13 +01:00
David Matos
d69e16c168
Use external cmd
...
Remove redundant `into record`
2025-12-04 13:08:04 +01:00
Mitchell Hashimoto
6b21b9147c
terminal/tmux: add output format parsing (minimal)
2025-12-03 20:23:28 -08:00
David
c0ce4ef44f
Retain original fmt
2025-12-03 22:31:25 +01:00
Mitchell Hashimoto
b95965cb5a
terminal/tmux: add layout-change to control mode parsing
2025-12-03 13:27:37 -08:00
Mitchell Hashimoto
92ea8d0eb5
terminal/tmux: layout checksums
2025-12-03 13:27:37 -08:00
Mitchell Hashimoto
dfa22379b2
terminal/tmux: layout string parser
2025-12-03 13:27:37 -08:00
Mitchell Hashimoto
7a9dc77a94
terminal/tmux: clean up error handling, explicit error sets
2025-12-03 13:27:36 -08:00
Mitchell Hashimoto
6e016ea81e
terminal: move tmux into folder
2025-12-03 13:27:36 -08:00
Mitchell Hashimoto
5bc78d59fb
terminal/tmux: add more control mode parsing keys
2025-12-03 13:27:36 -08:00
David
fdf0f5278c
Merge and fix conflict on README
2025-12-03 22:26:07 +01:00
Mitchell Hashimoto
6502922bb6
build(deps): bump actions/checkout from 6.0.0 to 6.0.1 ( #9791 )
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 6.0.0
to 6.0.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/actions/checkout/releases ">actions/checkout's
releases</a>.</em></p>
<blockquote>
<h2>v6.0.1</h2>
<h2>What's Changed</h2>
<ul>
<li>Update all references from v5 and v4 to v6 by <a
href="https://github.com/ericsciple "><code>@ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2314 ">actions/checkout#2314</a></li>
<li>Add worktree support for persist-credentials includeIf by <a
href="https://github.com/ericsciple "><code>@ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2327 ">actions/checkout#2327</a></li>
<li>Clarify v6 README by <a
href="https://github.com/ericsciple "><code>@ericsciple</code></a> in <a
href="https://redirect.github.com/actions/checkout/pull/2328 ">actions/checkout#2328</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/actions/checkout/compare/v6...v6.0.1 ">https://github.com/actions/checkout/compare/v6...v6.0.1 </a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="8e8c483db8 "><code>8e8c483</code></a>
Clarify v6 README (<a
href="https://redirect.github.com/actions/checkout/issues/2328 ">#2328</a>)</li>
<li><a
href="033fa0dc0b "><code>033fa0d</code></a>
Add worktree support for persist-credentials includeIf (<a
href="https://redirect.github.com/actions/checkout/issues/2327 ">#2327</a>)</li>
<li><a
href="c2d88d3ecc "><code>c2d88d3</code></a>
Update all references from v5 and v4 to v6 (<a
href="https://redirect.github.com/actions/checkout/issues/2314 ">#2314</a>)</li>
<li>See full diff in <a
href="1af3b93b68...8e8c483db8 ">compare
view</a></li>
</ul>
</details>
<br />
[](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-12-03 13:18:57 -08:00
David
a521819882
Address changes
...
fixes logic bug when adding cache
2025-12-03 22:04:52 +01:00
dependabot[bot]
d926bd5376
build(deps): bump actions/checkout from 6.0.0 to 6.0.1
...
Bumps [actions/checkout](https://github.com/actions/checkout ) from 6.0.0 to 6.0.1.
- [Release notes](https://github.com/actions/checkout/releases )
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md )
- [Commits](1af3b93b68...8e8c483db8 )
---
updated-dependencies:
- dependency-name: actions/checkout
dependency-version: 6.0.1
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-12-03 00:07:23 +00:00
Mitchell Hashimoto
b4a48303ed
build: fix path access to work with relative build roots ( #9780 )
...
## Problem
When ghostty is used as a dependency (e.g., in another Zig project), the
build can panic on Linux with:
\`\`\`
GhosttyDist.zig:173:34: 0x1768046 in exists (build.zig)
if (std.fs.accessAbsolute(b.pathFromRoot(self.dist), .{})) {
\`\`\`
This happens because \`b.pathFromRoot()\` can return a relative path
(e.g., when the build root is \`.\`), but \`std.fs.accessAbsolute()\`
asserts the path must be absolute.
## Solution
Replace \`std.fs.accessAbsolute(b.pathFromRoot(...))\` with
\`b.build_root.handle.access(...)\`, which uses the build root's
directory handle directly and works correctly with relative paths.
Context:
https://ampcode.com/threads/T-7511e7e4-4b4a-4f11-9c3c-817aaa519b84
2025-12-02 11:13:52 -08:00
Mitchell Hashimoto
8d25ab0ae3
zsh: improve ZDOTDIR documentation ( #9779 )
...
The main thing to emphasize is that end users should never source
.zshenv directly; it's only meant to be used as part of our shell
injection environment.
At the moment, there's no way to guard against accidentally use, but we
can consider making e.g. GHOSTTY_SHELL_FEATURES always defined in this
environment to that it can be used to differentiate the cases.
In practice, it's unlikely that people actually source this .zshenv
script directly, so hopefully this additional documentation clarifies
things well enough.
2025-12-02 11:13:10 -08:00
Mitchell Hashimoto
edfae7e41e
zsh: move version check to ghostty-integration ( #9781 )
...
The ghostty-integration script can be manually sourced, and it uses the
Zsh 5.1+ features, so that's a better place to guard against older Zsh
versions.
This also keeps the .zshenv script focused on just bootstrapping our
automatic shell integration.
I also changed the version check to a slightly more idiomatic pattern.
2025-12-02 11:12:49 -08:00
Mitchell Hashimoto
ac5f8c3a1e
build(deps): bump softprops/action-gh-release from 2.4.2 to 2.5.0 ( #9782 )
...
Bumps
[softprops/action-gh-release](https://github.com/softprops/action-gh-release )
from 2.4.2 to 2.5.0.
<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.5.0</h2>
<!-- raw HTML omitted -->
<h2>What's Changed</h2>
<h3>Exciting New Features 🎉 </h3>
<ul>
<li>feat: mark release as draft until all artifacts are uploaded by <a
href="https://github.com/dumbmoron "><code>@dumbmoron</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/692 ">softprops/action-gh-release#692</a></li>
</ul>
<h3>Other Changes 🔄 </h3>
<ul>
<li>chore(deps): bump the npm group across 1 directory with 5 updates by
<a
href="https://github.com/dependabot "><code>@dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/697 ">softprops/action-gh-release#697</a></li>
<li>chore(deps): bump actions/checkout from 5.0.0 to 5.0.1 in the
github-actions group by <a
href="https://github.com/dependabot "><code>@dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/689 ">softprops/action-gh-release#689</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a href="https://github.com/dumbmoron "><code>@dumbmoron</code></a>
made their first contribution in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/692 ">softprops/action-gh-release#692</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/softprops/action-gh-release/compare/v2.4.2...v2.5.0 ">https://github.com/softprops/action-gh-release/compare/v2.4.2...v2.5.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.5.0</h2>
<h2>What's Changed</h2>
<h3>Exciting New Features 🎉 </h3>
<ul>
<li>feat: mark release as draft until all artifacts are uploaded by <a
href="https://github.com/dumbmoron "><code>@dumbmoron</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/692 ">softprops/action-gh-release#692</a></li>
</ul>
<h3>Other Changes 🔄 </h3>
<ul>
<li>dependency updates</li>
</ul>
<h2>2.4.2</h2>
<h2>What's Changed</h2>
<h3>Exciting New Features 🎉 </h3>
<ul>
<li>feat: Ensure generated release notes cannot be over 125000
characters by <a
href="https://github.com/BeryJu "><code>@BeryJu</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/684 ">softprops/action-gh-release#684</a></li>
</ul>
<h3>Other Changes 🔄 </h3>
<ul>
<li>dependency updates</li>
</ul>
<h2>2.4.1</h2>
<h2>What's Changed</h2>
<h3>Other Changes 🔄 </h3>
<ul>
<li>fix(util): support brace expansion globs containing commas in
parseInputFiles by <a
href="https://github.com/Copilot "><code>@Copilot</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/672 ">softprops/action-gh-release#672</a></li>
<li>fix: gracefully fallback to body when body_path cannot be read by <a
href="https://github.com/Copilot "><code>@Copilot</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/671 ">softprops/action-gh-release#671</a></li>
</ul>
<h2>2.4.0</h2>
<h2>What's Changed</h2>
<h3>Exciting New Features 🎉 </h3>
<ul>
<li>feat(action): respect working_directory for files globs by <a
href="https://github.com/stephenway "><code>@stephenway</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/667 ">softprops/action-gh-release#667</a></li>
</ul>
<h2>2.3.4</h2>
<h2>What's Changed</h2>
<h3>Bug fixes 🐛 </h3>
<ul>
<li>fix(action): handle 422 already_exists race condition by <a
href="https://github.com/stephenway "><code>@stephenway</code></a> in <a
href="https://redirect.github.com/softprops/action-gh-release/pull/665 ">softprops/action-gh-release#665</a></li>
</ul>
<h3>Other Changes 🔄 </h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a06a81a03e "><code>a06a81a</code></a>
release 2.5.0</li>
<li><a
href="7da8983734 "><code>7da8983</code></a>
feat: mark release as draft until all artifacts are uploaded (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/692 ">#692</a>)</li>
<li><a
href="87973286a4 "><code>8797328</code></a>
chore(deps): bump actions/checkout in the github-actions group (<a
href="https://redirect.github.com/softprops/action-gh-release/issues/689 ">#689</a>)</li>
<li><a
href="1bfc62a71b "><code>1bfc62a</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/697 ">#697</a>)</li>
<li>See full diff in <a
href="5be0e66d93...a06a81a03e ">compare
view</a></li>
</ul>
</details>
<br />
[](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-12-02 11:12:21 -08:00
dependabot[bot]
56d4e6d955
build(deps): bump softprops/action-gh-release from 2.4.2 to 2.5.0
...
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release ) from 2.4.2 to 2.5.0.
- [Release notes](https://github.com/softprops/action-gh-release/releases )
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md )
- [Commits](5be0e66d93...a06a81a03e )
---
updated-dependencies:
- dependency-name: softprops/action-gh-release
dependency-version: 2.5.0
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com >
2025-12-02 03:08:36 +00:00
Jon Parise
6babcc97f5
zsh: move version check to ghostty-integration
...
The ghostty-integration script can be manually sourced, and it uses the
Zsh 5.1+ features, so that's a better place to guard against older Zsh
versions.
This also keeps the .zshenv script focused on just bootstrapping our
automatic shell integration.
I also changed the version check to a slightly more idiomatic pattern.
2025-12-01 20:34:55 -05:00
Tim Culverhouse
7fe3f5cd3f
build: fix path access to work with relative build roots
...
Replace std.fs.accessAbsolute(b.pathFromRoot(...)) with
b.build_root.handle.access(...) since pathFromRoot can return
relative paths, but accessAbsolute asserts the path is absolute.
2025-12-01 18:29:54 -06:00
Jon Parise
da014d98cd
zsh: improve ZDOTDIR documentation
...
The main thing to emphasize is that end users should never source
.zshenv directly; it's only meant to be used as part of our shell
injection environment.
At the moment, there's no way to guard against accidentally use, but we
can consider making e.g. GHOSTTY_SHELL_FEATURES always defined in this
environment to that it can be used to differentiate the cases.
In practice, it's unlikely that people actually source this .zshenv
script directly, so hopefully this additional documentation clarifies
things well enough.
2025-12-01 19:07:50 -05:00
Jon Parise
5714ed07a1
zsh: improve minimum version check ( #9772 )
...
- Handle autoload failures
- Prefer ">&2" to "/dev/stderr" for portability
- Quote commands for consistency and to avoid alias conflicts
2025-12-01 11:15:02 -05:00
Mitchell Hashimoto
09f7e38b45
GTK: followup update search state on activation ( #9766 )
...
followup from comment in this PR
https://github.com/ghostty-org/ghostty/pull/9765
2025-12-01 07:25:45 -08:00
Jon Parise
b776b3df61
zsh: improve minimum version check
...
- Handle autoload failures
- Prefer ">&2" to "/dev/stderr" for portability
- Quote commands for consistency and to avoid alias conflicts
2025-12-01 10:19:00 -05:00
rhodes-b
27c82f739e
only update search when going from inactive to active
2025-11-30 21:22:07 -06:00
rhodes-b
3ab49fdb5f
only notify search change when widget was inactive
2025-11-30 21:06:25 -06:00
Mitchell Hashimoto
2a9a57daff
GTK: update search state from previous search on activation ( #9765 )
...
I think it makes sense that if there was already text from the previous
search that it should match based on that, this doesnt remove that it
highlights everything so you can press backspace to delete and start
from a empty search
2025-11-30 12:38:34 -08:00
Mitchell Hashimoto
750bb1fe33
core: encode mouse buttons 8 & 9 (back/forward) ( #9761 )
...
For some reason button 8 & 9 support is missing.
2025-11-30 12:37:33 -08:00
rhodes-b
7820608b04
if search has text already update the search state with matches
2025-11-30 14:32:13 -06:00
CJ van den Berg
7be28e7215
core: encode mouse buttons 8 & 9 (back/forward)
2025-11-30 17:53:21 +01:00
Mitchell Hashimoto
34fd1dd0f6
GTK: Search UI ( #9756 )
...
Fixes #189
This adds the UI for search to GTK. There is still polish to be done in
follow-ups but this makes search work well with GTK to start!
**AI disclosure:** Believe it or not, almost this entire PR was
AI-written. Amp did an excellent job looking at our existing codebase,
comparing it to the macOS codebase, writing blueprint files, etc. I
reviewed everything written, modified some basics, and verified it
manually and under Valgrind.
## Demo
<img width="1654" height="1234" alt="CleanShot 2025-11-29 at 20 52
11@2x"
src="https://github.com/user-attachments/assets/0eb38367-398f-4165-9838-7a35465857bc "
/>
## Future Improvements
- When dragging the overlay, we should change the cursor and show drop
targets
- There's probably some small stylistic tweaks we can make to this
- I'm not sure the CSS is right for both light and dark modes so we may
need to tweak that
2025-11-30 07:24:36 -08:00
Mitchell Hashimoto
c67bcf969c
apprt/gtk: switch to has-x and optional internals for search counts
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
b8393fd4aa
apprt/gtk: comments
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
e18a7d9501
apprt/gtk: drag
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
f7a6822e30
apprt/gtk: enter/shift+enter for traversing search results
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
72b3c14833
clean up some stuff
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
56a76cc174
apprt/gtk: fix selected search label off by one
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
eebce6a78c
apprt/gtk: hook up close search button
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
76496d40fd
apprt/gtk: hook up next/prev match
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
0ea85fc483
apprt/gtk: hook up search_total/search_selected apprt actions
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
fc9b578ef4
apprt/gtk: hook up search-changed to start a search
2025-11-30 07:23:10 -08:00
Mitchell Hashimoto
0d32e7d814
apprt/gtk: escape to stop search and hide overlay
2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
778b49c9a1
apprt/gtk: hook up start_search/end_search to set active state
2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
027e5d631a
config: default search keybindings for Linux
2025-11-30 07:23:09 -08:00
Mitchell Hashimoto
548d1f0300
apprt/gtk: search overlay UI
2025-11-30 07:23:09 -08:00