Commit Graph

15112 Commits (v1.3.0)

Author SHA1 Message Date
Mitchell Hashimoto 703d11c642
Bump version to 1.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
Kat 97c479a347
i18n: update Indonesian translation (id_ID) (#11226)
Updated translation for Indonesian (id_ID). This is a duplicate of PR
#10794, as the original PR has not been updated since last week. I think
it would be better to merge this updated translation before the 1.3
release.
2026-03-08 14:20:36 +00:00
ghostty-vouch[bot] eaef1094d9
Update VOUCHED list (#11228)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11227#issuecomment-4019112158)
from @00-kat.

Vouch: @dariogriffo

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-08 14:07:03 +00:00
Dario Griffo c570d53d45
Update es_AR.po 2026-03-08 14:05:39 +00:00
Dario Griffo 2cb8f61bcf
Update es_AR.po 2026-03-08 14:03:10 +00:00
Dario Griffo aee9361fa3
Update es_AR.po
Minor updates
2026-03-08 13:57:56 +00:00
halosatrio 1a15fc0adb i18n: update Indonesian translation (id_ID) 2026-03-08 20:35:19 +07:00
Kat 42d36359db
i18n: update Hungarian translations (#11039)
New string translated with this!

Part of: #10632
2026-03-08 10:28:19 +00:00
Kat 4d89f1bcae
Add es_ES.UTF-8 translation (#10722) 2026-03-08 07:16:14 +00:00
rhodes-b 8635fef7a5 if search is active dont apply unfocused options 2026-03-08 00:24:46 -06:00
Jon Parise 059bd54a5d elvish: improve OSC 133 semantic prompt support
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-07 20:34:20 -05:00
Ken VanDine 472b926a4d
Fix snap EGL vendor dirs to include host NVIDIA ICD paths (#11209)
Fixes #10760. The snap launcher script was overriding the default system
EGL vendor directories, preventing NVIDIA's proprietary EGL driver from
being discovered. This caused crashes for users with NVIDIA GPUs on snap
systems.

The fix adds the standard host system paths (/etc/glvnd/egl_vendor.d and
/usr/share/glvnd/egl_vendor.d) to __EGL_VENDOR_LIBRARY_DIRS before the
snap-internal path. This is safe for classic confinement snaps since the
host filesystem is fully accessible.
2026-03-07 08:41:50 -08:00
Mitchell Hashimoto fd3a62b9c1
AppleScript (#11208)
This adds AppleScript support to the macOS app.

AppleScript is still one of the best ways to script macOS apps. It is
more CLI friendly and share-able than Apple Shortcuts and can be used by
other CLI programs like editors (Neovim plugins), launchers
(Raycast/Alfred), etc. It has been heavily requested to introduce more
scriptability into Ghostty and this is a really good, powerful option on
macOS.

> [!NOTE]
>
> I definitely still want to do something cross-platform and more
official as a plugin/scripting API for Ghostty. But native integrations
like this are a goal of Ghostty as well and this implementation is just
some thin logic over already existing internals to expose it.

I plan on merging this ahead of 1.3. Normally I wouldn't ship a feature
so late in the game but this is fairly hermetic (doesn't impact other
systems) and I plan on documenting it as a "preview" feature since the
API and stability are in question.

## Security

Apple secures AppleScript via TCC by asking for permission when a script
is run whether an app is allowed to be controlled. Because this is
always asked, we do default AppleScript to being enabled. This is
typical of macOS native applications already.

AppleScript can be wholesale disabled via `macos-applescript = false`.

## Future

There is a big question of what else to expose to this to make it
useful. I'm going to make a call to action for the 1.3 cycle to gather
feedback on this, since we can expose mostly anything!

## Capabilities

### Objects

| Object | Key Properties | Key Elements |
| --- | --- | --- |
| `application` | `name`, `frontmost`, `version` | `windows`,
`terminals` |
| `window` | `id`, `name`, `selected tab` | `tabs`, `terminals` |
| `tab` | `id`, `name`, `index`, `selected` | `terminals` |
| `terminal` | `id`, `name`, `working directory` | None |

### Commands

| Category | Command | Purpose |
| --- | --- | --- |
| Application | `perform action` | Execute a Ghostty action string on a
terminal. |
| Configuration | `new surface configuration` | Create/copy a reusable
surface configuration record. |
| Creation | `new window` | Open a new Ghostty window (optional
configuration). |
| Creation | `new tab` | Open a new tab (optional target
window/configuration). |
| Layout | `split` | Split a terminal and return the new terminal. |
| Focus/Selection | `focus` | Focus a terminal. |
| Focus/Selection | `activate window` | Bring a window to front and
activate app. |
| Focus/Selection | `select tab` | Select and foreground a tab. |
| Lifecycle | `close` | Close a terminal. |
| Lifecycle | `close tab` | Close a tab. |
| Lifecycle | `close window` | Close a window. |
| Input | `input text` | Paste-style text input into terminal. |
| Input | `send key` | Send key press/release with optional modifiers. |
| Input | `send mouse button` | Send mouse button press/release. |
| Input | `send mouse position` | Send mouse position update. |
| Input | `send mouse scroll` | Send scroll event with
precision/momentum options. |
| Standard Suite | `count`, `exists`, `quit` | Standard Cocoa scripting
functionality. |

## Examples

### Layout

```AppleScript
-- Tmux-like layout: 4 panes in one tab (2x2), each with a job.
set projectDir to POSIX path of (path to home folder) & "src/ghostty"

tell application "Ghostty"
    activate

    -- Reusable config for all panes.
    set cfg to new surface configuration
    set initial working directory of cfg to projectDir

    -- Create the first window/tab + split into 4 panes.
    set win to new window with configuration cfg
    set paneEditor to terminal 1 of selected tab of win
    set paneBuild to split paneEditor direction right with configuration cfg
    set paneGit to split paneEditor direction down with configuration cfg
    set paneLogs to split paneBuild direction down with configuration cfg

    -- Seed each pane with a command.
    input text "nvim ." to paneEditor
    send key "enter" to paneEditor

    input text "zig build -Demit-macos-app=false" to paneBuild

    input text "git status -sb" to paneGit

    input text "tail -f /tmp/dev.log" to paneLogs
    send key "enter" to paneLogs

    -- Put focus back where you want to type.
    focus paneEditor
end tell
```

### Broadcast Commands

```AppleScript
-- Run one command across every open terminal surface.
set cmd to "echo sync && date"

tell application "Ghostty"
    set allTerms to terminals

    repeat with t in allTerms
        input text cmd to t
        send key "enter" to t
    end repeat

    display dialog ("Broadcasted to " & (count of allTerms) & " terminal(s).")
end tell
```

### Jump by Working Directory

```applescript
-- Find the first terminal whose cwd contains this text.
set needle to "ghostty"

tell application "Ghostty"
    set matches to every terminal whose working directory contains needle

    -- Fallback: try title if cwd had no match.
    if (count of matches) = 0 then
        set matches to every terminal whose name contains needle
    end if

    if (count of matches) = 0 then
        display dialog ("No terminal matched: " & needle)
    else
        set t to item 1 of matches
        focus terminal t
        input text "echo '[focused by AppleScript]'" to t
        send key "enter" to t
    end if
end tell
```
2026-03-07 07:52:56 -08:00
Mitchell Hashimoto ed9a6cb648
macos: implement the quit command 2026-03-07 07:29:40 -08:00
Mitchell Hashimoto 210b01ad60
macos: use direct parameters for object-targeting commands
Change split, focus, close, activate window, select tab, close tab, and
close window commands to accept their target object as a direct parameter
instead of a named parameter. This produces natural AppleScript syntax:

  activate window (window 1)
  close tab (tab 1 of window 1)
  split (terminal 1) direction right

instead of the awkward redundant form:

  activate window window (window 1)
  close tab tab (tab 1 of window 1)
  split terminal (terminal 1) direction right

The implementation moves command logic from NSScriptCommand subclasses
into responds-to handler methods on ScriptTerminal, ScriptWindow, and
ScriptTab, which is the standard Cocoa Scripting pattern for commands
whose direct parameter is an application class.
2026-03-07 07:23:59 -08:00
Mitchell Hashimoto 038ebef16c
address some PR feedback 2026-03-07 07:07:10 -08:00
ghostty-vouch[bot] af43af13c3
Update VOUCHED list (#11211)
Triggered by
[comment](https://github.com/ghostty-org/ghostty/issues/11209#issuecomment-4016613771)
from @mitchellh.

Vouch: @04cb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-07 14:29:14 +00:00
04cb 4bb602b0e1 Fix snap EGL vendor dirs to include host NVIDIA ICD paths 2026-03-07 18:02:59 +08:00
José Miguel Sarasola adc6794f3b
Add es_ES.UTF-8 translation 2026-03-07 08:41:40 +01:00
Mitchell Hashimoto 259a41d503
macos: rename surface config working directory to not be ambiguous 2026-03-06 15:16:03 -08:00
Mitchell Hashimoto 221a1639af
swiftlint 2026-03-06 15:07:04 -08:00
Mitchell Hashimoto 25fa58143e
macos: add macos-applescript config 2026-03-06 15:04:20 -08:00