89 Commits

Author SHA1 Message Date
Mitchell Hashimoto
01401ef675 build: fix Windows static lib linking with MSVC
Three issues when linking the static library with the MSVC linker:

Use the LLVM backend on Windows to produce valid COFF objects.
The self-hosted backend generates compiler_rt objects with invalid
COMDAT sections that the MSVC linker rejects (LNK1143).

Disable bundling ubsan_rt on Windows. Zig's ubsan runtime emits
/exclude-symbols linker directives that MSVC does not understand
(LNK4229).

Add ntdll and kernel32 as transitive link dependencies for the
static library on Windows. The Zig standard library uses NT API
functions (NtClose, NtCreateSection, etc.) that consumers must
link.
2026-03-23 11:31:41 -07:00
Mitchell Hashimoto
5a46e61bee cmake: fix Windows build support
On Windows, shared libraries (DLLs) require an import library (.lib)
for linking, and the DLL itself is placed in bin/ rather than lib/ by
the Zig build. The CMake wrapper was missing IMPORTED_IMPLIB on the
shared imported target, causing link failures, and assumed the shared
library was always in lib/.

Add GHOSTTY_VT_IMPLIB for the import library name, set IMPORTED_IMPLIB
on the ghostty-vt target, and fix the shared library path to use bin/
on Windows. Install the DLL and PDB to bin/ and the import library to
lib/ following standard Windows conventions. Apply the same fixes to
ghostty-vt-config.cmake.in for the find_package path.
2026-03-23 10:31:11 -07:00
Mitchell Hashimoto
555bf7e922 build: add cmake static library support
Expose both shared and static libraries as separate CMake imported
targets (ghostty-vt and ghostty-vt-static) rather than toggling
between them with BUILD_SHARED_LIBS. The zig build already produces
both in a single invocation, so both are always available.

The find_package config template is updated to export both targets
as ghostty-vt::ghostty-vt and ghostty-vt::ghostty-vt-static.

Add a c-vt-cmake-static example that demonstrates linking the static
library via FetchContent with -Dsimd=false to avoid C++ runtime
dependencies.
2026-03-21 15:08:24 -07:00
Mitchell Hashimoto
3fc04fd4ae build: replace lib-vt step with -Demit-lib-vt option
Remove the dedicated `zig build lib-vt` step and replace it with a
`-Demit-lib-vt` build option. This fixes two problems:

1. We can default XCFramework, app, etc. steps to false if emit-lib-vt
   is true, so that the lib-vt build doesn't pull in unrelated
   artifacts. **Most importantly, lib-vt alone can be build without
   full Xcode installations.**

2. We can build lib-vt as part of a bundle with other artifacts if we
   really want.
2026-03-21 07:03:06 -07:00
Mitchell Hashimoto
3dee62f904 build: add CMake support for libghostty-vt
Add a top-level CMakeLists.txt that wraps `zig build lib-vt` so that
CMake-based downstream projects can consume libghostty-vt without
needing to interact with the Zig build system directly. A custom
command triggers the zig build during `cmake --build`, and the
resulting shared library is exposed as an IMPORTED target.

Downstream projects can pull in the library via FetchContent, which
fetches the source and builds it as part of their own CMake build, or
via find_package after a manual install step. The package config
template in dist/cmake/ sets up the ghostty-vt::ghostty-vt target
with proper include paths and macOS rpath handling.

A c-vt-cmake example demonstrates the FetchContent workflow, creating
a terminal, writing VT sequences, and formatting the output as plain
text. CI is updated to auto-discover and build CMake-based examples
alongside the existing Zig-based ones.
2026-03-20 10:42:42 -07:00
Yuzu Vita
4b1e48b71e swap arguments 2026-03-18 13:40:28 +08:00
Yuzu Vita
2d514013d5 fix "open terminal here" action on Plasma 2026-03-17 22:18:07 +08:00
Mitchell Hashimoto
332b2aefc6 1.3.1 2026-03-13 09:00:30 -07:00
Mitchell Hashimoto
703d11c642 Bump version to 1.3.0 2026-03-09 08:48:36 -07:00
David Matos
c755720e17 Merge pot files 2026-01-22 12:00:53 +01:00
David Matos
4f0f464fb3 Merge branch 'main' into localize-nautilus-script 2026-01-21 14:28:01 +01:00
Sebastian Wiesner
ab4b54e2a4 Drop GNOME 42 compatibility
GNOME 43 is from 2022-09, i.e. almost as old as Ghostty, so  not longer
worth supporting here.
2025-12-30 13:30:18 +01:00
Sebastian Wiesner
5c35a4710d Rename class
It's a menu provider not a single action.
2025-12-30 13:30:18 +01:00
Sebastian Wiesner
dee093db57 Extract duplicated code into single helper
Extract duplicated code from the two different menu item hooks into a
single helper function, and then inline _make_item, as it's only used
once now.
2025-12-30 13:30:18 +01:00
Sebastian Wiesner
09d6a1ee2e Lift functions out of class
Neither of these used self.
2025-12-30 13:30:18 +01:00
Sebastian Wiesner
f1bed9dd6a Inline trivial method 2025-12-30 13:30:18 +01:00
Sebastian Wiesner
622d49206a Remove unused imports 2025-12-29 22:36:27 +01:00
Sebastian Wiesner
d09bac64ae Remove systemd integration from nautilus extension
As far as I understand ghostty integrates with systemd already nowadays,
and manages its own scopes/cgroups for tabs.  As such, explicitly moving
launching ghostty into a separate systemd scope from nautilus no longer
seems necessary.
2025-12-29 22:36:27 +01:00
David Matos
35779be65d i18n: Localize Nautilus .py script 2025-12-19 10:31:39 -05:00
Mitchell Hashimoto
78e539d684 Revert "macos: populate the sparkle:channel element" 2025-12-15 12:28:40 -08:00
Jon Parise
786dc93438 macos: populate the sparkle:channel element
This makes the update channel name available alongside the version,
data, etc., which we can use in our update view (on the Released line).
2025-12-14 17:19:53 -05:00
Mitchell Hashimoto
d7b9ce76a6 typos 2025-10-06 08:47:02 -07:00
Mitchell Hashimoto
ffbdfbd1e6 prettier 2025-10-06 08:45:25 -07:00
Mitchell Hashimoto
48d5fc925f doxygen: better scrollbar styling 2025-10-06 08:28:24 -07:00
Mitchell Hashimoto
992e9e2a6e doxygen: mobile styling 2025-10-06 08:25:44 -07:00
Mitchell Hashimoto
21d545c3b4 doxygen prettier 2025-10-05 20:28:37 -07:00
Mitchell Hashimoto
a73a67d252 doxygen improvements 2025-10-05 20:16:42 -07:00
Mitchell Hashimoto
587f47a587 apprt/gtk-ng: clean up our single instance, new window interactions
This removes `launched-from` entirely and moves our `gtk-single-instance`
detection logic to assume true unless we detect CLI instead of assume
false unless we detect desktop/dbus/systemd.

The "assume true" scenario for single instance is desirable because
detecting a CLI instance is much more reliable.

Removing `launched-from` fixes an issue where we had a
difficult-to-understand relationship between `launched-from`,
`gtk-single-instance`, and `initial-window`. Now, only
`gtk-single-instance` has some hueristic logic. And `initial-window`
ALWAYS sends a GTK activation signal regardless of single instance or
not.

As a result, we need to be explicit in our systemd, dbus, desktop files
about what we want Ghostty to do, but everything works as you'd mostly
expect.

Now, if you put plain old `ghostty` in your terminal, you get a new
Ghostty instance. If you put it anywhere else, you get a GTK single
instance activation call (either creates a first instance or opens a new
window in the existing instance). Works for launchers and so on.
2025-09-05 10:17:17 -05:00
Jeffrey C. Ollie
2435cee11b linux/systemd: add an app- prefix to the systemd unit
The XDG Freedesktop Portal has a _major_ undocumented requirement for
programs that are launched/controlled by `systemd` to interact with the
Portal. The unit _must_ be named `app-<appid>.service`. The Portal uses
the systemd unit name figure out what the program's application ID is
and it will only look at unit names that begin with `app-`. I can find
no place that this is documented other than by inspecting the code or the
issue and PR that introduced this feature. See the following code:

7d4d48cf07/src/xdp-utils.c (L152-L220)

This may fix many people's issues with getting global shortcuts
to work.

Note that this is a breaking change if you have been using Ghostty
compiled from source since #7433 was merged. You will need to ensure
that any Ghosty systemd unit files _not_ prefixed with `app-` are
deleted.

Original discussion/PR in the XDG Desktop Portal repository:

https://github.com/flatpak/xdg-desktop-portal/issues/579
https://github.com/flatpak/xdg-desktop-portal/pull/719

Originally discussed on Discord:

https://discord.com/channels/1005603569187160125/1394845362186879026

Co-authored-by: ambareeshbalaji@gmail.com
2025-07-16 10:26:30 -05:00
Jeffrey C. Ollie
c9d0bbefc2 linux: switch systemd user service to type=notify-reload
This allows `systemctl` to send SIGUSR2 to Ghostty to trigger a reload,
which is more convenient than scripting `ps` and `kill` to find the
Ghostty main PID.
2025-07-09 13:11:01 -05:00
Jeffrey C. Ollie
871f90e448 linux/kde: add KDE shortcut to desktop file
Fixes #7673

This adds `Ctrl+Alt+T` as a KDE shortcut to the desktop file. If Konsole
is installed (or any other prorgam that has the same shortcut) the user
will need to go into the KDE system settings and manually reassign the
`Ctrl+Alt+T` shortcut to Ghostty.

If Ghostty is the only terminal installed that claims that shortcut KDE
_should_ automatically enable the shortcut (but YMMV).

Non-KDE systems will ignore this setting and if the user desires a
global shortcut to open a Ghostty window it will need to be accomplished
in other ways.
2025-07-06 13:05:00 -05:00
Jeffrey C. Ollie
190c744a6f linux: add install target to systemd user service
This will allow users to enable Ghostty startup on login. Users will
need to explicitly enable startup on login via this command:

```sh
systemctl enable --user com.mitchellh.ghostty.service
```
2025-07-01 16:51:23 -05:00
Mitchell Hashimoto
6d6dcf863a Correct AppStream metainfo XML, broken trailing tags 2025-06-26 13:37:20 -07:00
Mitchell Hashimoto
b4e81949ee wrong service name for dbus systemd service 2025-06-26 13:12:05 -07:00
Mitchell Hashimoto
739b691a6d use cmake formatting to template, avoids the custom binary 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
8a95212197 fix up the name in the metainfo when templating 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
eb5a488b57 clean up duplicated code in installation of desktop services 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
cf561fcc55 rename templated files with .in suffix 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
b68f9f2321 make sure that the desktop file uses the absolute path everywhere 2025-06-26 10:28:46 -07:00
Jeffrey C. Ollie
ddada2fb3f flatpak: remove references to systemd unit
Replaces #7676

When building as a flatpak, don't install the systemd user services
since flatpaks can't use them. Remove references to the systemd service
from the DBus service.

Also, customize the app metadata depending on the debug mode.

Co-authored-by: Leorize <leorize+oss@disroot.org>
2025-06-26 10:28:46 -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
Mitchell Hashimoto
f941a2185e Revert "linux: add dbus and systemd activation services (#7433)"
Reverts two commits:

977cd530c7
820b7e432b

These break build from source on Linux for two reasons:

1.) The systemd user service needs to be installed in the `share`
prefix, not the `lib` prefix. This lets it get picked up in `~/.local`
but is also correct for just standard FHS paths.

2.) The `ghostty` path in the systemd user service needs to be absolute.
We should interpolate in the build install prefix to form an absolute
path.
2025-06-24 22:07:09 -04:00
Mitchell Hashimoto
977cd530c7 linux: add dbus and systemd activation services (#7433) 2025-06-24 18:14:24 -04:00
Mitchell Hashimoto
c1c3f639c5 macos: Ghostty Icon Update for macOS Tahoe
This updates the Ghostty icon to be compatible with macOS Tahoe
(supports glass effects, light/dark, tinting, etc.). This icon is made
in the new Apple Icon Composer as the source format, and all other
formats are exported from it.

This commit also updates the icon for non-Apple platforms because the
icon is fundamentally the same and I don't see any reason to maintain
multiple icons of fundamentally the same design and style.

This commit also includes updates to the macOS app so that the About
Window and so on will use the new icon.
2025-06-21 12:34:49 -07:00
Jeffrey C. Ollie
e5c737a423 linux: use launched-from for new window action 2025-06-13 10:22:16 -05:00
Jeffrey C. Ollie
57392dfcb5 linux: use explicit launched-from config in service files 2025-06-13 10:22:16 -05:00
Jeffrey C. Ollie
8824d11e1c linux: add dbus and systemd activation services 2025-06-13 10:22:12 -05:00
Leorize
0473b0c3f4 metainfo: update with extra data
* Added URLs to more resources
* Fixed developer ID
* Added device compatibility information
2025-04-22 10:56:09 -07:00
Leorize
ebc169dbaf Fix flatpak packaging to a working state
This should make testing Flatpak builds a lot easier.

To build, enter `flatpak/` directory and run:

    flatpak-builder --repo=repo builddir com.mitchellh.ghostty.yml

alternatively, using org.flatpak.Builder flatpak:

    flatpak run -p org.flatpak.Builder \
      --repo=repo \
      builddir \
      com.mitchellh.ghostty.yml

The resulting flatpak can be installed using

    flatpak install ./repo com.mitchellh.ghostty

Credit of AppStream metadata goes to @yorickpeterse.
2025-04-22 10:56:09 -07:00
Mitchell Hashimoto
692168f8dd dist: remove cdata tags from appcast, we escape it all 2025-01-29 15:08:30 -08:00