mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-12-28 09:04:40 +00:00
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.
15 lines
278 B
SYSTEMD
15 lines
278 B
SYSTEMD
[Unit]
|
|
Description=@NAME@
|
|
After=graphical-session.target
|
|
After=dbus.socket
|
|
Requires=dbus.socket
|
|
|
|
[Service]
|
|
Type=notify-reload
|
|
ReloadSignal=SIGUSR2
|
|
BusName=@APPID@
|
|
ExecStart=@GHOSTTY@ --gtk-single-instance=true --initial-window=false
|
|
|
|
[Install]
|
|
WantedBy=graphical-session.target
|