Commit Graph

15459 Commits

Author SHA1 Message Date
Jeffrey C. Ollie
818e170ec0 GTK does support scrollbars (#11345)
Native GTK scrollbars are supported in 1.3.0:
https://ghostty.org/docs/install/release-notes/1-3-0#scrollbars
2026-03-10 18:46:20 -05:00
ghostty-vouch[bot]
615af975f3 Update VOUCHED list (#11344)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11343#discussioncomment-16075282)
from @jcollie.

Vouch: @hulet

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 23:26:26 +00:00
Steve Hulet
f9862cd4e2 GTK does support scrollbars 2026-03-10 16:14:18 -07:00
Mitchell Hashimoto
0cb189bfbb config: working-directory expands ~/ prefix (#11337)
Fixes #11336

Introduce a proper WorkingDirectory tagged union type with home,
inherit, and path variants. The field is now an optional
(?WorkingDirectory) where null represents "use platform default" which
is resolved during Config.finalize to .inherit (CLI) or .home (desktop
launcher).
2026-03-10 14:40:43 -07:00
Mitchell Hashimoto
04d5efc8eb config: working-directory expands ~/ prefix
Fixes #11336

Introduce a proper WorkingDirectory tagged union type with home, inherit,
and path variants. The field is now an optional (?WorkingDirectory) where
null represents "use platform default" which is resolved during Config.finalize
to .inherit (CLI) or .home (desktop launcher).
2026-03-10 14:33:40 -07:00
Lukas
90dc4315e2 macos: add test cases for Ghostty.Config properties
Test boolean, string, enum, and numeric config properties using
TemporaryConfig to verify defaults and parsed values.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-10 20:03:17 +01:00
Mitchell Hashimoto
a4cc37db72 tests: disable tests that fail if you have locally installed fonts (#11285)
If you have "Noto Sans Tai Tham" and/or "Noto Sans Javanese" installed
locally on Linux, three tests fail. This PR disables those tests until a
more permanent solution can be found.
2026-03-10 11:53:23 -07:00
Lukas
32934445cf macos: add TemporaryConfig for AI to write test cases 2026-03-10 19:45:52 +01:00
Jeffrey C. Ollie
c1313294cd add comments about why tests are disabled 2026-03-10 13:29:50 -05:00
Mitchell Hashimoto
8784636547 macos: remove IntrinsicSizeTimingTests temporarily (#11332)
These were too flaky.

cc @bo2themax
2026-03-10 11:23:16 -07:00
Mitchell Hashimoto
71f81527ad macos: remove IntrinsicSizeTimingTests temporarily
These were too flaky.
2026-03-10 11:08:47 -07:00
Mitchell Hashimoto
f88b42ad39 macos: add enum type for macos-titlebar-style (#11262) 2026-03-10 10:58:47 -07:00
Mitchell Hashimoto
7fb8e0ac90 fix jump_to_prompt forward behavior for multiline prompts (#11331)
Fixes #11330.

When jumping forward from prompt content, skip prompt continuation rows
so a multiline prompt is treated as a single prompt block.
2026-03-10 10:51:17 -07:00
Mitchell Hashimoto
53637ec7b2 fix jump_to_prompt forward behavior for multiline prompts
Fixes #11330.

When jumping forward from prompt content, skip prompt continuation rows so a 
multiline prompt is treated as a single prompt block.
2026-03-10 10:47:18 -07:00
ghostty-vouch[bot]
f8d7876203 Update VOUCHED list (#11329)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11313#issuecomment-4033213188)
from @mitchellh.

Vouch: @VaughanAndrews

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 17:31:32 +00:00
Mitchell Hashimoto
c06ede5849 macos: make paste_from_clipboard performable on macos (#11328)
Fixes #10751
2026-03-10 10:31:22 -07:00
Mitchell Hashimoto
aaad43c235 macos: make paste_from_clipboard performable on macos
Fixes #10751
2026-03-10 10:25:14 -07:00
Mitchell Hashimoto
119ce0bc1d macos: reset mouse state on focus loss to prevent phantom drag (#11276)
Fixes https://github.com/ghostty-org/ghostty/discussions/11203

The `suppressNextLeftMouseUp` flag from #11167 wasn't being reset on
focus loss, causing stale state that led to phantom drags/selections and
scrolls if you're lucky enough.

I've followed the #11167 's path and made it reset on focus loss.

As I stated in the [vouch
request](https://github.com/ghostty-org/ghostty/discussions/11274); I'm
not experienced in Swift, just following the prior PR's steps to reset
the state. I've been using this patch for couple days and the change
looks trivial to me tho not 100% sure if I'm missing anything.

> [!NOTE]
> Used Claude Code -Opus 4.6- for navigating the codebase and reviewing
the change.
2026-03-10 09:56:39 -07:00
Selman Kayrancioglu
6092c299d5 macos: reset mouse state on focus loss to prevent phantom drag
Fixes phantom mouse drag/selection when switching splits or apps.
The suppressNextLeftMouseUp flag and core mouse click_state were not
being reset on focus transitions, causing stale state that led to
unexpected drag behavior.

- Reset suppressNextLeftMouseUp in focusDidChange when losing focus
- Defensively reset the flag when processing normal clicks
- Reset core mouse.click_state and left_click_count on focus loss
2026-03-10 09:54:08 -07:00
Mitchell Hashimoto
4e24adf717 ci: skip xcode tests for freetype build 2026-03-10 09:40:28 -07:00
Mitchell Hashimoto
9759787847 config: don't double load app support path on macOS (#11326)
Fixes #11323
2026-03-10 09:28:59 -07:00
Mitchell Hashimoto
d9039eb85a config: don't double load app support path on macOS
Fixes #11323
2026-03-10 09:23:51 -07:00
Lukas
de0f2ab22d macos: add enum type for macos-titlebar-style 2026-03-10 17:15:14 +01:00
Mitchell Hashimoto
3782d118e1 macOS: restore keyboard focus after inline tab title edit (#11320)
## Summary

- After finishing an inline tab title edit (via keybind or
double-click), all keyboard input is lost because
`TabTitleEditor.finishEditing()` sets `makeFirstResponder(nil)`, leaving
the window itself as first responder with no path back to the terminal
surface.
- Adds a `tabTitleEditorDidFinishEditing` delegate callback to
`TabTitleEditorDelegate` that fires after every edit (commit or cancel).
- `TerminalWindow` implements it by calling
`makeFirstResponder(focusedSurface)` to restore keyboard focus to the
terminal.

Fixes https://github.com/ghostty-org/ghostty/discussions/11315

## Testing

- [x] Bind `prompt_tab_title` to a keybind (e.g. `keybind =
cmd+shift+i=prompt_tab_title`)
- [x] Trigger inline tab title edit via keybind, press Enter — verify
keyboard input works immediately
- [x] Trigger inline tab title edit via keybind, press Escape — verify
keyboard input works immediately
- [x] Double-click a tab title, press Enter — verify keyboard input
works immediately
- [x] Double-click a tab title, press Escape — verify keyboard input
works immediately
- [x] Verify Cmd+number tab switching works after all of the above
- [x] Verify split pane focus is correct after editing tab title with
splits open

AI disclosure: Codebase exploration and review via [Claude
Code](https://claude.com/claude-code)
2026-03-10 08:59:51 -07:00
Mitchell Hashimoto
85f0972b39 macOS: fix intrinsicContentSize race in windowDidLoad (#11322)
This should fix #11256 and #11271. 

Tested manually with various combination of `window-width/height` and
`macos-titlebar-style`.


https://github.com/user-attachments/assets/90c12728-b195-47bf-abfd-8a4034b1e7a2


### AI Disclosure

All the commits are generated by Claude, but orchestrated and manually
tested by myself.
2026-03-10 08:59:40 -07:00
chronologos
7629130fb4 macOS: restore keyboard focus after inline tab title edit
After finishing an inline tab title edit (via keybind or double-click),
`TabTitleEditor.finishEditing()` calls `makeFirstResponder(nil)` to
clear focus from the text field, leaving the window itself as first
responder. No code path restores focus to the terminal surface, so all
keyboard input is lost until the user clicks into a pane.

Add a `tabTitleEditorDidFinishEditing` delegate callback that fires
after every edit (commit or cancel). TerminalWindow implements it by
calling `makeFirstResponder(focusedSurface)` to hand focus back to the
terminal.

Fixes https://github.com/ghostty-org/ghostty/discussions/11315

Co-Authored-By: Claude <noreply@anthropic.com>
2026-03-10 08:52:00 -07:00
Mitchell Hashimoto
1592cafa32 Update AGENTS.md 2026-03-10 08:48:24 -07:00
Lukas
a6cd1b08af macOS: fix intrinsicContentSize race in windowDidLoad (#11256)
Add initialContentSize fallback on TerminalViewContainer so
intrinsicContentSize returns the correct value immediately,
without waiting for @FocusedValue to propagate. This removes
the need for the DispatchQueue.main.asyncAfter 40ms delay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:35:49 +01:00
Lukas
cfedda1a0e macOS: add regression tests for intrinsicContentSize race (#11256)
Tests that validate intrinsicContentSize returns a correct value when
TerminalController.windowDidLoad() reads it. Currently fail, proving
the race condition where @FocusedValue hasn't propagated
lastFocusedSurface before the 40ms timer fires.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 15:27:38 +01:00
ghostty-vouch[bot]
6c7309196f Update VOUCHED list (#11321)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11320#issuecomment-4031703556)
from @mitchellh.

Vouch: @chronologos

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 14:15:21 +00:00
Mitchell Hashimoto
e11f350e8e docs: update bell-features docs for macOS (#11279)
PR #11154 didn't fully update the docs regarding `bell-features=audio`
on macOS.
2026-03-10 07:12:02 -07:00
ghostty-vouch[bot]
c83dea49fd Update VOUCHED list (#11318)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11309#discussioncomment-16069391)
from @mitchellh.

Vouch: @dzhlobo

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 14:09:14 +00:00
ghostty-vouch[bot]
327783ff6c Update VOUCHED list (#11314)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11287#discussioncomment-16069141)
from @mitchellh.

Vouch: @ocean6954

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-10 13:58:50 +00:00
Jeffrey C. Ollie
96f9772cd8 tests: disable tests that fail if you have locally installed fonts
If you have "Noto Sans Tai Tham" and/or "Noto Sans Javanese" installed
locally on Linux, three tests fail. This PR disables those tests until a
more permanent solution can be found.
2026-03-09 19:59:21 -05:00
Jeffrey C. Ollie
f8f431ba67 docs: update bell-features docs for macOS
PR #11154 didn't fully update the docs regarding `bell-features=audio`
on macOS.
2026-03-09 16:47:07 -05:00
ghostty-vouch[bot]
f8a0a45963 Update VOUCHED list (#11275)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11274#discussioncomment-16057271)
from @jcollie.

Vouch: @seruman

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-09 19:20:32 +00:00
Mitchell Hashimoto
703d11c642 Bump version to 1.3.0 v1.3.0 2026-03-09 08:48:36 -07:00
Mitchell Hashimoto
8dde2693bc macos: increase window-width/height apply delay from 10ms to 40ms (#11265)
Band-aid for #10304

We don't have a robust fix yet but this should help mitigate more
scenarios.
2026-03-09 08:43:59 -07:00
Mitchell Hashimoto
a6ee1fb292 macos: increase window-width/height apply delay from 10ms to 40ms
Band-aid for #10304

We don't have a robust fix yet but this should help mitigate more
scenarios.
2026-03-09 08:42:07 -07:00
Mitchell Hashimoto
dd3d72c3de Revert "macOS: filter proper intrinsicContentSize when opening new window (#11257)"
This reverts commit 3445c9afda, reversing
changes made to 1e981f858a.
2026-03-09 08:33:24 -07:00
Mitchell Hashimoto
3445c9afda macOS: filter proper intrinsicContentSize when opening new window (#11257)
Fixes #11256, which is rather hard to reproduce on macOS 26, but after
adding breaking points on size update, we can see that it happens when
the `intrinsicContentSize` is not properly updated.

<img width="998" height="556" alt="Xnip2026-03-09_11-38-40"
src="https://github.com/user-attachments/assets/8ac1de91-5895-45fc-a443-002eb016a1ce"
/>
2026-03-09 08:21:40 -07:00
Lukas
3c93c35869 macOS: filter proper intrinsicContentSize when opening new window
Fixes #11256
2026-03-09 08:21:29 -07:00
Mitchell Hashimoto
1e981f858a terminal: fix grapheme edge-wrap hyperlink integrity panic (#11264)
When a grapheme expands to width 2 at the screen edge, this path can
write spacer_head before printWrap() sets row.wrap. With an active
hyperlink, printCell triggers hyperlink bookkeeping and page integrity
checks in that intermediate state, causing UnwrappedSpacerHead.

Mark row.wrap before writing spacer_head in this grapheme-wrap path to
keep the intermediate state valid.
2026-03-09 07:57:42 -07:00
Mitchell Hashimoto
3ba49a784f terminal: fix grapheme edge-wrap hyperlink integrity panic
When a grapheme expands to width 2 at the screen edge, this path can write
spacer_head before printWrap() sets row.wrap. With an active hyperlink,
printCell triggers hyperlink bookkeeping and page integrity checks in that
intermediate state, causing UnwrappedSpacerHead.

Mark row.wrap before writing spacer_head in this grapheme-wrap path to keep
the intermediate state valid.
2026-03-09 07:53:08 -07:00
Mitchell Hashimoto
f4c40c7d53 bash: only define $__ghostty_ps0 when unset (#11258)
This fixes an error if the script was sourced a second time:

    bash: __ghostty_ps0: readonly variable

Because this is a non-exported variable, this would only happen if the
script was sourced multiple times in the same bash session.
2026-03-09 06:40:57 -07:00
Mitchell Hashimoto
308b713e58 bash: handle existing ; in PROMPT_COMMAND (#11260)
If an existing PROMPT_COMMAND was a string ending in ; (and maybe some
spaces), we'd add a redundant ;, resulting in a syntax error. Now we
strip any trailing `;[[:space:]]*` characters from the original string
before add ours.

Fixes #11259
2026-03-09 06:40:36 -07:00
Jon Parise
0a659af55f bash: handle existing ; in PROMPT_COMMAND
If an existing PROMPT_COMMAND was a string ending in ; (and maybe some
spaces), we'd add a redundant ;, resulting in a syntax error. Now we
strip any trailing `;[[:space:]]*` characters from the original string
before add ours.
2026-03-09 09:16:29 -04:00
Jon Parise
fd557e8347 bash: only define $__ghostty_ps0 when unset
This fixes an error if the script was sourced a second time:

    bash: __ghostty_ps0: readonly variable

Because this is a non-exported variable, this would only happen if the
script was sourced multiple times in the same bash session.
2026-03-09 08:52:52 -04:00
Kat
9dc6f6763f Update es_AR.po translation for "Unable to acquire an OpenGL context for rendering." (#11227)
- "Unable to acquire an OpenGL context for rendering."
This could be translated to "No se puede" or "No se pudo", depends on
the context of the message.
If the message is showing a current intent the translation should be "No
se puede", if the message is communicating that Ghostty failed to
acquire the OpenGL then the translation should be "No se pudo", here I
need more context.
Either case the wording "No se puedo" is incorrect.
2026-03-09 04:44:45 +00:00
Mitchell Hashimoto
b82d452f48 macos: add AppleScript front window and focused terminal properties (#11251)
This adds two new propeties to make it easy to get the frontmost (main)
window and the focused terminal within a tab. We already had a property
to get the selected tab of a tab group.

## Examples

### Send Input to Focused Terminal

```AppleScript
tell application "Ghostty"
  set term to focused terminal of selected tab of front window
  input text "pwd\n" to term
end tell
```

### Split the Focused Terminal

```applescript
tell application "Ghostty"
  set currentTerm to focused terminal of selected tab of front window
  set newTerm to split currentTerm direction right
  input text "echo split-ready\n" to newTerm
end tell
```
2026-03-08 20:11:00 -07:00