This PR also updates old translations to keep better consistency.
AI Disclaimer: I translated manually all strings and then used an agent
to review consistency and legibility and applied many suggestions.
Minor things as I was just auditing the state of our headers:
* Make sure all subheaders like `point.h` can be included standalone
* Support Clang/GCC extensions for typed enums if we can detect it
* Add missing structs to the `ghostty_type_json` function
* Fix `GHOSTTY_INIT_SIZED` for C++ mode
Use an immediately invoked lambda for GHOSTTY_INIT_SIZED in C++ so the
macro value-initializes every field before setting the ABI size. The
previous C compound literal and designated initializer required compiler
extensions in C++17 and C++20.
Keep the existing standard compound literal for C callers.
Use fixed int enum types for C++11, C23, Clang's fixed-enum extension,
and GCC 13 or newer. Previously only finalized C23 mode selected an explicit
underlying type, leaving C++ and common older C modes with
implementation-defined enum types.
Dynamic tabstop storage treated the number of columns above the inline
capacity as a byte count even though each byte stores eight stops. This
was wasteful, although in practice this is in the order of just bytes.
Round the extra column count up to whole storage units and grow the
existing slice with realloc, preserve existing stops.
Fixes#13774
Simple one-line fix: added the missing flush to the function.
- `zig build` passed
- `zig build test` passed
- Confirmed template appears after fix in `~/Library/Application
Support/com.mitchellh.ghostty/config.ghostty`
---
**AI Disclosure**
As mentioned before - I used OpenAI Codex (Sol 5.6 high):
a) to see if the template still exists & a function exists that tries to
use the template
b) find the moment in history this behavior changed.
Additionally:
c) reviewing my work and draft a commit message matching your preferred
style
I implemented the change, ran the build/test, manually verified the
behavior, and understand the fix.
## Summary
Fix `+new-window -e <command>` inheriting forced shell integration from
the running GTK application.
Arguments after `-e` are now marked as an explicit command that requires
shell detection. That marker is propagated with the existing command
override to the new surface for both the current `+new-window` and
`+new-tab` GTK paths. When the override is applied, forced shell
integration becomes `detect`; an explicit `none` remains disabled.
This is scoped to the GTK `-e` path. It does not change the generic
forced shell-integration behavior, so configured integration continues
to support shell executables with non-standard names.
Fixes#12378.
## Root cause
The GTK IPC path replaced `config.command` for the new surface but
retained the running application's `shell-integration` value. `termio`
therefore treated an arbitrary explicit command such as Vim as the
forced shell and appended shell-specific arguments.
## AI usage
I used Hermes Agent (with ChatGPT 5.6) to help inspect the codebase,
trace the GTK command path, and draft parts of the implementation and
test. I manually reviewed and edited the changes, validated the behavior
and test results, and understand the affected code paths.
Arguments after -e are now marked as an explicit command that requires shell detection. That marker is propagated with the existing command override to the new surface for both the current +new-window and +new-tab GTK paths. When the override is applied, forced shell integration becomes detect; an explicit none remains disabled.
This is scoped to the GTK -e path. It does not change the generic forced shell-integration behavior, so configured integration continues to support shell executables with non-standard names.
Fixes#12378.
## Summary
- Add `GHOSTTY_TERMINAL_DATA_CURSOR_AT_PROMPT` to expose semantic prompt
state through `libghostty-vt`.
- Reuse `Terminal.cursorIsAtPrompt()` rather than introducing separate
prompt tracking.
## Motivation
Ghostty already tracks whether the cursor is at a semantic prompt
through `Terminal.cursorIsAtPrompt()`. Exposing this query through
`libghostty-vt` lets downstream terminal consumers use Ghostty's
existing semantic prompt state without introducing separate tracking.
The query returns false when semantic prompt information is unavailable
or the alternate screen is active.
Discussed in https://github.com/ghostty-org/ghostty/discussions/13755.
## Testing
- `zig build test-lib-vt`
- `zig build test-lib-vt -Dtest-filter="get cursor_at_prompt"`
- `zig build -Demit-lib-vt`
## AI disclosure
Codex assisted with adding the `libghostty-vt` query and test,
addressing review feedback, running validation, and drafting this
description. I reviewed and edited the final code and description,
reviewed the validation results, and understand how the change interacts
with Ghostty's semantic prompt state.
This adds new functions to both C and Zig to write VT data until the VT
parser reaches a "ground" state. The ground state is when the
parser/stream is stateless: between all partial UTF-8, OSC, CSI, etc.
This lets embedders safely interleave custom VT sequences from multiple
sources. A practical example is a standard terminal reading from a pty
that is then doing custom APC or something mid-stream for their emulator
client.
The new function is anywhere from 1% to 5% slower than normal VT write,
but that should be acceptable due to its special case. Normal VT writes
are unchanged.
Swift explicitly [marked UnsafeMutablePointer as non sendable](0568dbf903). Moving from `@unchecked @retroactive` to `nonisolated(unsafe)` is safe for us as per the previous comments
This adds new functions to both C and Zig to write VT data until the
VT parser reaches a "ground" state. The ground state is when the
parser/stream is stateless: between all partial UTF-8, OSC, CSI, etc.
This lets embedders safely interleave custom VT sequences from multiple
sources. A practical example is a standard terminal reading from a pty
that is then doing custom APC or something mid-stream for their emulator
client.
As discussed in Discord: Ghostty internal support for iOS is not
important and we verify iOS compatibility for `libghostty-vt` through
compilation.
Diff is **BIG**, but it contains mostly cleanup and didn't touch macOS's
implementation (except for some renaming).
### AI Disclosure
Claude did batch removal for me, I manually reviewed them and ran
locally for macOS.