Commit Graph

15133 Commits

Author SHA1 Message Date
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
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
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
Mitchell Hashimoto
233fb12081 macos: add AppleScript front window and focused terminal properties
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.
2026-03-08 20:00:21 -07:00
ghostty-vouch[bot]
ec1ca4c0c9 Update VOUCHED list (#11247)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11246#discussioncomment-16045992)
from @jcollie.

Vouch: @jmcgover

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-09 00:14:58 +00:00
Mitchell Hashimoto
2d347cad33 GTK: Don't apply unfocused options when searching (#11224)
If you have multiple splits and start searching naturally the focus
transfers over to the search widget which would apply the unfocused
options. This could make it difficult to view your matches from
searching without re-focusing the surface.

This was discovered when I tested
https://github.com/ghostty-org/ghostty/discussions/11218 (which is a
different issue)
2026-03-08 14:03:23 -07:00
rhodes-b
1d59f5dbcd pass search active state through blueprint 2026-03-08 15:57:28 -05:00
Mitchell Hashimoto
43f3d2ca92 vt: align SGR C enum tags with parser output (#11239)
Remove the stale GHOSTTY_SGR_ATTR_RESET_UNDERLINE entry from the C
header and renumber subsequent GhosttySgrAttributeTag values to match
src/terminal/sgr.zig Attribute.Tag ordering.

This fixes misclassified attributes from ghostty_sgr_next for C
consumers that switch on the enum tags from include/ghostty/vt/sgr.h.
2026-03-08 13:01:44 -07:00
ghostty-vouch[bot]
a2ea5b5d79 Update VOUCHED list (#11240)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11207#discussioncomment-16043795)
from @mitchellh.

Vouch: @MOlechowski

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-08 19:58:06 +00:00
Mitchell Hashimoto
a384af5e25 vt: align SGR C enum tags with parser output
Remove the stale GHOSTTY_SGR_ATTR_RESET_UNDERLINE entry from the C header
and renumber subsequent GhosttySgrAttributeTag values to match
src/terminal/sgr.zig Attribute.Tag ordering.

This fixes misclassified attributes from ghostty_sgr_next for C consumers
that switch on the enum tags from include/ghostty/vt/sgr.h.
2026-03-08 12:54:46 -07:00
Dario Griffo
4969b0c56e Update es_AR.po 2026-03-08 16:19:48 +00:00
Mitchell Hashimoto
2d9dc5cfd1 fix: list-actions outputs without --docs (#11231)
Explicitly flush the buffer once the generation is complete.

Resolves #11221
2026-03-08 07:59:55 -07:00
ghostty-vouch[bot]
686fd34e96 Update VOUCHED list (#11232)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11231#issuecomment-4019204219)
from @mitchellh.

Vouch: @dmehala

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-08 14:59:30 +00:00
Damien Mehala
235dde6844 fix: list-actions outputs without --docs
Explicitly flush the buffer once the generation is complete.

Resolves #11221
2026-03-08 15:51:09 +01:00
ghostty-vouch[bot]
360c369d23 Update VOUCHED list (#11230)
Triggered by [discussion
comment](https://github.com/ghostty-org/ghostty/discussions/11125#discussioncomment-16041168)
from @mitchellh.

Vouch: @pauley-unsaturated

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-08 14:43:13 +00:00
Mitchell Hashimoto
602db55a28 macos: fix quick terminal glassy background (#11229)
Fixes a regression from
[#9032096](https://github.com/ghostty-org/ghostty/commit/9032096) 🥲 and
clean some dead code

On first launch of the quick terminal window, the container style is not
properly updated; you'll have to reload the config to show the
background.

<img width="571" height="312" alt="IMG_4783"
src="https://github.com/user-attachments/assets/c5d920ea-9ad8-494d-98c0-c560e36c4a31"
/>
2026-03-08 07:40:25 -07:00
Mitchell Hashimoto
1d76820937 elvish: improve OSC 133 semantic prompt support (#11222)
Add `aid=$pid` to 133;A and 133;D for nested shell tracking, and fix the
state comparison which was incorrectly using `constantly` (comparing a
string to a function, which always evaluated to true).

OSC 133;B (input start) and 133;P;k=r (right prompt) cannot be reliably
implemented at the script level because Elvish escapes control
characters in prompt function output, and writing directly to /dev/tty
has timing issues because Elvish renders its prompts on a background
thread. Full semantic prompt support requires a native implementation:
https://github.com/elves/elvish/pull/1917

See: #10523
2026-03-08 07:38:51 -07:00
Lukas
df4d9bc0d0 macos: fix quick terminal glassy background 2026-03-08 15:22:37 +01:00