Skip to content

Ghostty terminal keybind launches single-instance mode that can crash all windows #5447

@nikitalbnv

Description

@nikitalbnv

Summary

On my Omarchy install, the terminal keybind launches Ghostty through xdg-terminal-exec. That uses the Ghostty desktop file, which launches Ghostty with --gtk-single-instance=true.

When I run OpenCode inside tmux from a Ghostty window opened this way, Ghostty can crash. Because it is single-instance mode, all Ghostty windows from that shared process can close.

If I launch Ghostty by typing ghostty in another terminal, the same OpenCode plus tmux flow does not crash.

What I expected

The terminal keybind should launch Ghostty the same way as typing ghostty, or at least should not force a mode that can take down every Ghostty window when one surface crashes.

What happened

The keybind path launches:

/usr/bin/ghostty --gtk-single-instance=true

Typing ghostty launches:

/usr/bin/ghostty

The --gtk-single-instance=true path is the one that crashes all shared Ghostty windows for me.

Reproduction

On Omarchy with Ghostty as the default terminal:

  1. Press the terminal keybind.
  2. Run:
tmux
opencode
  1. Interact with OpenCode.
  2. Ghostty can crash. In single-instance mode, other Ghostty windows from the same process can close too.

Direct launch works:

ghostty

Then:

tmux
opencode

This does not crash for me.

Evidence

Omarchy keybind uses xdg-terminal-exec:

$terminal = uwsm-app -- xdg-terminal-exec
bindd = SUPER, BACKSPACE, Terminal, exec, $terminal --working-directory="$(omarchy-cmd-terminal-cwd)"

xdg-terminal-exec --print-cmd returns:

/usr/bin/ghostty
--gtk-single-instance=true

The selected desktop file is:

/usr/share/applications/com.mitchellh.ghostty.desktop

It has:

Exec=/usr/bin/ghostty --gtk-single-instance=true

Local workaround

I added a user desktop file override:

~/.local/share/applications/com.mitchellh.ghostty.desktop

With:

Exec=/usr/bin/ghostty
DBusActivatable=false

After that, xdg-terminal-exec --print-cmd returns:

/usr/bin/ghostty

Now the terminal keybind works and the OpenCode plus tmux flow is stable.

Versions

Omarchy on Arch Linux
Hyprland on Wayland
Ghostty 1.3.1-arch2
tmux 3.6a
OpenCode 1.14.25

Related

I also opened a Ghostty discussion because Ghostty should not segfault either:

ghostty-org/ghostty#12460

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions