814 Commits

Author SHA1 Message Date
Mitchell Hashimoto
20bb71c627 libghostty: export benchmark CLI API 2025-07-09 15:06:24 -07:00
Mitchell Hashimoto
e68c1d2cad config: add available since for SSH shell integration 2025-07-09 09:30:22 -07:00
Mitchell Hashimoto
5a5c9e4387 Add SSH Integration Configuration Option (#7608)
Addresses #4156 and #5892, specifically by implementing @mitchellh's
[request](https://github.com/ghostty-org/ghostty/discussions/5892#discussioncomment-12283628)
for "opt-in shell integration".

## Problem

Ghostty's custom `xterm-ghostty` TERM value breaks terminal
functionality when SSHing to remote systems that lack the corresponding
terminfo entry. This affects enterprise environments, legacy servers,
and ephemeral instances.

## Solution

Adds two independent SSH integration flags within the existing
`shell-integration-features` configuration:

```
shell-integration-features = ssh-env,ssh-terminfo
```

- **`ssh-env`**: TERM compatibility fix (xterm-ghostty → xterm-256color)
+ environment variable propagation (COLORTERM, TERM_PROGRAM,
TERM_PROGRAM_VERSION)
- **`ssh-terminfo`**: Automatic terminfo installation on remote hosts
with caching and utility commands

Flags work independently and harmoniously when combined, allowing users
granular control over SSH integration behavior.

## Implementation

Adds SSH wrapper functions across bash, zsh, fish, and elvish that
handle TERM compatibility, environment propagation, and terminfo
installation. Follows the same pattern as existing shell integration
features - client-side only with graceful fallback behavior.

The flag-based approach allows users to choose exactly the features they
need:
- Environment compatibility only: `ssh-env`
- Terminfo installation only: `ssh-terminfo` 
- Optimal experience: `ssh-env,ssh-terminfo`
- No SSH integration: omit both flags

## Evolution Note

Based on maintainer feedback, this evolved from a progressive
enhancement approach (`ssh-integration = basic | full`) to independent
flags within `shell-integration-features`. See discussion below for the
complete architectural evolution and rationale.
2025-07-09 09:28:40 -07:00
Mitchell Hashimoto
2f4af5eb87 Changed behaviour of bold-color (#7871)
Continuation of discussion in
https://github.com/ghostty-org/ghostty/discussions/3134

This changes the behaviour of the new bold-color option to only affect
the default foreground text when set to a static colour. By using a
static colour, the remaining colours are rendered as bright.
2025-07-09 06:37:21 -07:00
Robert Ian Hawdon
94cca0cc17 Updated comment 2025-07-09 11:35:44 +01:00
Jeffrey C. Ollie
527dcea266 core: avalability of config entry since 1.0.0 can be assumed 2025-07-08 22:06:27 -05:00
Jeffrey C. Ollie
1a3a03577b core: document which release added config entries
For each config entry, add a comment specifying in which release it was
first added. In some cases I note when certain aspects of each config
entry were modified.
2025-07-08 22:06:27 -05:00
Jason Rayne
22edfd2c5d Merge branch 'main' into ssh-integration 2025-07-07 10:01:22 -07:00
Jason Rayne
e0035e153d Merge branch 'main' into ssh-integration 2025-07-07 09:07:14 -07:00
Qwerasd
bcb6ee6db6 config: add adjust-icon-height option
Metric modifier for the `icon_height` metric.
2025-07-07 10:04:11 -06:00
Mitchell Hashimoto
b7ffbf933f macos: open URLs with NSWorkspace APIs instead of open
Fixes #5256

This updates the macOS apprt to implement the `OPEN_URL` apprt action to
use the NSWorkspace APIs instead of the `open` command line utility.

As part of this, we removed the `ghostty_config_open` libghostty API and
instead introduced a new `ghostty_config_open_path` API that returns the
path to open, and then we use the `NSWorkspace` APIs to open it (same
function as the `OPEN_URL` action).
2025-07-06 21:01:01 -07:00
Robert Ian Hawdon
52790fb92c Added bold-color option 2025-07-06 12:56:43 -07:00
Mitchell Hashimoto
04c5bb2984 Add link-previews option (#7831)
Implement the `link-previews` option from
https://github.com/ghostty-org/ghostty/discussions/7727.

The feature request isn't accepted yet, but I had a bit of free time to
write this up and it was pretty quick, so I figure there's no harm in
proposing an implementation.

Demo of `link-previews = osc8`:



https://github.com/user-attachments/assets/17a72ab2-c727-4a85-9edd-9b6e7da05d98
2025-07-06 12:09:39 -07:00
Jeffrey C. Ollie
eb5694794c keybind: add set_font_size
Fixes #7795

This allows the font size to be set to an absolute value.
2025-07-06 06:42:14 -07:00
Gregory Anders
9f3f9205d8 Add link-previews option 2025-07-06 08:33:11 -05:00
Qwerasd
02d82720d2 font/freetype: fix negated force-autohint flag
The behavior of this flag was the opposite of its description in the
docs- luckily, at the same time, the default (true) was the opposite
from what the default actually is in freetype, so users who haven't
explicitly set this flag won't see a behavior difference from this.
2025-07-05 20:40:12 -06:00
Jason Rayne
f242c6b5c4 Merge branch 'main' into ssh-integration 2025-07-05 14:54:31 -07:00
Mitchell Hashimoto
b799462745 Better Glyph Constraint Logic (#7809)
This is a big'un.

- **Glyph constraint logic is now done fully on the CPU** at the
rasterization stage, so it only needs to be done once per glyph instead
of every frame. This also lets us eliminate padding between glyphs on
the atlas because we're doing nearest-neighbor sampling instead of
interpolating-- which ever so slightly increases our packing efficiency.
- **Special constraints for nerd font glyphs** are applied based roughly
on the constraints they use in their patcher. It's a simplification of
what they do, the largest difference being that they scale groups of
glyphs based on a shared bounding box so that they maintain relative
size to one another, but that would require loading all glyphs on the
group and I'd want to do that on font load TBH and at that point I'd
basically be re-implementing the nerd fonts patcher in Zig to patch
fonts at load time which is way beyond the scope I want to have. (Fixes
#7069)
- These constraints allow for **perfectly sized and centered emojis**,
this is very nice.
- **Changed the default embedded fonts** from 4 copies (regular, italic,
bold, bold italic) of a patched (and outdated) JetBrains Mono to a
single JetBrains Mono variable font and a single Nerd Fonts Symbols Only
font. This cuts the weight of those down from 9MB to 3MB!
- **FreeType's `renderGlyph` is significantly reworked**, and the new
code is, IMO, much cleaner- although there are probably some edge case
behavior differences I've introduced.

> [!NOTE]
> One breaking change I definitely introduced is changing the
`monochrome` freetype load flag config from its previous completely
backwards meaning to instead the correct one (I also changed the
default, so this won't affect any user who hasn't touched it, but users
who set the `monochrome` flag will find their fonts quite crispy after
this change because they will have no anti-aliasing anymore)

### Future work

Following this change I want to get to work on automatic font size
matching (a la CSS
[`font-size-adjust`](https://developer.mozilla.org/en-US/docs/Web/CSS/font-size-adjust)).
I set the stage for that quite some time ago so it shouldn't be too much
work and it will be a big benefit for users who regularly use multiple
writing systems and so have multiple fonts for them that aren't
necessarily size-compatible.
2025-07-05 14:37:46 -07:00
Qwerasd
e441094af0 font: add constraint logic to rasterizers
This is in preparation to move constraint off the GPU to simplify our
shaders, instead we only need to constrain once at raster time and never
again.

This also significantly reworks the freetype renderGlyph function to be
generally much cleaner and more straightforward.

This commit doesn't actually apply the constraints to anything yet, that
will be in following commits.
2025-07-04 15:47:28 -06:00
Mitchell Hashimoto
fb9c52ecf4 Nuke GLFW from Orbit
This deletes the GLFW apprt from the Ghostty codebase.

The GLFW apprt was the original apprt used by Ghostty (well, before
Ghostty even had the concept of an "apprt" -- it was all just a single
application then). It let me iterate on the core terminal features,
rendering, etc. without bothering about the UI. It was a good way to get
started. But it has long since outlived its usefulness.

We've had a stable GTK apprt for Linux (and Windows via WSL) and a
native macOS app via libghostty for awhile now. The GLFW apprt only
remained within the tree for a few reasons:

  1. Primarily, it provided a faster feedback loop on macOS because
     building the macOS app historically required us to hop out of the
     zig build system and into Xcode, which is slow and cumbersome.

  2. It was a convenient way to narrow whether a bug was in the
     core Ghostty codebase or in the apprt itself. If a bug was in both
     the glfw and macOS app then it was likely in the core.

  3. It provided us a way on macOS to test OpenGL.

All of these reasons are no longer valid. Respectively:

  1. Our Zig build scripts now execute the `xcodebuild` CLI directly and
     can open the resulting app, stream logs, etc. This is the same
     experience we have on Linux. (Xcode has always been a dependency of
     building on macOS in general, so this is not cumbersome.)

  2. We have a healthy group of maintainers, many of which have access
     to both macOS and Linux, so we can quickly narrow down bugs
     regardless of the apprt.

  3. Our OpenGL renderer hasn't been compatible with macOS for some time
     now, so this is no longer a useful feature.

At this point, the GLFW apprt is just a burden. It adds complexity
across the board, and some people try to run Ghostty with it in the real
world and get confused when it doesn't work (it's always been lacking in
features and buggy compared to the other apprts).

So, it's time to say goodbye. Its bittersweet because it is a big part
of Ghostty's history, but we've grown up now and it's time to move on.
Thank you, goodbye.

(NOTE: If you are a user of the GLFW apprt, then please fork the project
prior to this commit or start a new project based on it. We've warned
against using it for a very, very long time now.)
2025-07-04 14:12:18 -07:00
Jason Rayne
1bdcbac96c Merge branch 'main' into ssh-integration 2025-07-03 22:41:29 -07:00
Jason Rayne
e25aa9f424 docs: update to reflect changes after porting terminfo host caching to Zig
- Minor tweak to Config.zig to show the new action.
- Rolled back README.md to remove reference to the now non-existent
'shared' subdir and bash-based cache script.
2025-07-03 16:22:57 -07:00
Mitchell Hashimoto
e1be836283 config: for now, make goto_tab NOT performable on macOS
Fixes #7786
Fixes regression from #7683

This is a band-aid fix. The issue is that performable keybinds don't
show up in the reverse mapping that GUI toolkits use to find their key
equivalents. The full explanation of why is already in Binding.zig.

For macOS, we have a way to validate menu items before they're triggered
so we ideally do want a way to get reverse mappings even with
performable keybinds. But I think this wants to be optional and that's
all a bigger change. For now, this is a simple fix that will work.
2025-07-03 13:45:41 -07:00
Mitchell Hashimoto
32764f3a1d fix test syntax 2025-07-03 09:29:36 -07:00
Mitchell Hashimoto
465ac5b1b7 clean up some of the color usage, use exhaustive switches 2025-07-03 09:25:56 -07:00
Mitchell Hashimoto
e87e5e7361 backwards compatibility handlers for removed fields 2025-07-03 07:30:55 -07:00
Daniel
95de198761 Squash and rebase, updated refactored version with selection and cursor cell color changes 2025-07-03 07:14:37 -07:00
Daniel
9e341a3d60 Created tagged union for selection colors, enabled parsing
Implemented cell color for Metal

Removed use of selection-invert-fg-bg

Mirrored feature to OpenGL

Added tests for SelectionColor

Fixed selection on inverted cell behavior

Implemented cell colors for cursor-text

Implemented cell colors for cursor-color, removed uses of cursor-invert-fg-bg during rendering

Updated docs for dynamically colored options

Updated docstrings, cleaned up awkward formatting, and moved style computation to avoid unnecssary invocations

Bump version in docstrings
2025-07-03 07:14:37 -07:00
Mitchell Hashimoto
f1f9d5eb4b Fix some config help that caused website errors when copied 2025-07-02 16:21:37 -07:00
Daniel Patterson
beb961fb80 Introduce font-shaping-break config option 2025-06-30 08:06:00 -07:00
Troels Thomsen
ef06e3d02c Introduce action for copying into clipboard 2025-06-29 09:32:48 +02:00
Mitchell Hashimoto
d44a6cde2c config: more general purpose backwards compatibility handlers (#7717)
Fixes #7706

We previously had a very specific backwards compatibility handler for
handling renamed fields. We always knew that wouldn't scale but I wanted
to wait for a real case. Well, #7706 is a real case, so here we are.

This commit makes our backwards compatibility handler more general
purpose, and makes a special-case handler for renamed fields built on
top of this same general purpose system. The new system lets us do a lot
more with regards to backwards compatibility.

To start, this addresses #7706 by allowing us to handle a removed single
enum value of a still-existing field.

In the future, I think this may continue to get _more_ general purpose
by moving the handlers from functions to structs so we can have more
metadata like descriptions and so on that we may use to generate docs or
other help strings.
2025-06-28 14:48:02 -07:00
Mitchell Hashimoto
84432a7beb config: more general purpose backwards compatibility handlers
Fixes #7706

We previously had a very specific backwards compatibility handler for
handling renamed fields. We always knew that wouldn't scale but I wanted
to wait for a real case. Well, #7706 is a real case, so here we are.

This commit makes our backwards compatibility handler more general
purpose, and makes a special-case handler for renamed fields built on
top of this same general purpose system. The new system lets us do a lot
more with regards to backwards compatibility.

To start, this addresses #7706 by allowing us to handle a removed single
enum value of a still-existing field.
2025-06-28 13:06:43 -07:00
Daniel Wennberg
4ae75cc868 Don't pass arena allocator to os.open 2025-06-28 00:21:38 -07:00
Mitchell Hashimoto
240c9b8afc gtk: add option to always display the tab bar (#5590)
Also fixes crashes in both vanilla GTK and Adwaita implementations of
`closeTab`, which erroneously close windows twice when there are no more
tabs left (we probably already handle it somewhere else).
2025-06-27 09:14:13 -07:00
Jeffrey C. Ollie
81403f59ce dbus and systemd activation - take 2
This replaces #7433. The improvements are:

1) Install the systemd user service in the proper directory depending
on if it's a 'user' install or a 'system' install. This is controlled
either by using the `--system` build flag (as most packages will) or by
the `-Dsystem-package` flag.

2) Add the absolute path to the `ghostty` binary in the application
file, the DBus service, and the systemd user service. This is done so
that they do not depend on `ghostty` being in the `PATH` of whatever
is launching Ghostty. That `PATH` is not necessarily the same as the
`PATH` in a user shell (especially for DBus activation and systemd user
services).

3) Adjust the DBus bus name that is expected by the system depending on
the optimization level that Ghostty is compiled with.
2025-06-26 10:28:46 -07:00
Jason Rayne
b5372468e4 docs: clarify infocmp/tic requirements for ssh-terminfo feature
infocmp is required locally to extract terminfo, tic is required on
remote hosts to install it
2025-06-25 17:47:26 -07:00
Jason Rayne
931efcd1e3 fix: restore background-image config accidentally removed during rebase 2025-06-25 16:15:41 -07:00
Jason Rayne
f617c9b3b7 docs: update ssh-terminfo description to reference new CLI actions
Updates Config.zig documentation to reflect that SSH cache management is
now handled by proper CLI actions (+list-ssh-cache and +clear-ssh-cache)
rather than shell wrapper commands.

Fixes documentation missed in e8c8a51.
2025-06-25 15:46:18 -07:00
Jason Rayne
c8d5e60390 docs: expand flag descriptions, usage overview 2025-06-25 15:46:18 -07:00
Jason Rayne
e73313ed40 change: migrate SSH integration from standalone option to shell-integration-features flags
- Add ssh_env and ssh_terminfo flags to ShellIntegrationFeatures
- Remove SSHIntegration enum and ssh-integration config option
- Update setupFeatures to handle new flags via reflection
- Remove setupSSHIntegration function and all references

Integrates SSH functionality into existing shell-integration-features
system for better consistency and user control.
2025-06-25 15:46:18 -07:00
Jason Rayne
3319b2b6ed docs: added full stop for consistency 2025-06-25 15:46:18 -07:00
Jason Rayne
af28763a34 fix: trailing newline in Config.zig 2025-06-25 15:46:18 -07:00
Jason Rayne
8fafd5ace1 docs: expand SSH integration configuration documentation
Add detailed explanations of shell function behavior, TERM compatibility
trade-offs, environment variable propagation, and authentication
requirements per maintainer feedback.
2025-06-25 15:46:18 -07:00
Jason Rayne
050cb3bfec fix: remove unnecessary jsonStringify method 2025-06-25 15:46:18 -07:00
Jason Rayne
34af3ffbaf docs: inline ssh-integration documentation instead of referencing enum 2025-06-25 15:46:18 -07:00
Jason Rayne
8f93d8fe03 fix: use kebab-case for ssh-integration enum values 2025-06-25 15:46:18 -07:00
Jason Rayne
142e07c502 feat: add SSH integration wrapper for shell integration
- Implements opt-in SSH wrapper following sudo pattern
- Supports term_only, basic, and full integration levels
- Fixes xterm-ghostty TERM compatibility on remote systems
- Propagates shell integration environment variables
- Allows for automatic installation of terminfo if desired
- Addresses GitHub discussions #5892 and #4156
2025-06-25 15:43:32 -07:00
Mitchell Hashimoto
fa47db5363 config: add command-palette-entry config option (#7688)
Implements #7158 for GTK
2025-06-25 16:48:10 -04:00
Mitchell Hashimoto
a8091fedf3 fix tests 2025-06-25 16:28:31 -04:00