Skip to content

linux: per-surface control group isn't removed on close #6766

Open
@mitchellh

Description

@mitchellh

Discussed in #6669

Originally posted by heftig March 11, 2025
The surface control groups created are named <12 hex digits>.scope but aren't actually systemd scopes. I've found this confusing because I wanted to use systemd configuration and tools to configure these scopes.

In other terminals supporting scopes (like GNOME Terminal, Ptyxis and tmux), systemctl --user whoami outputs a unique scope for each surface, while for Ghostty it always outputs the same scope that Ghostty was started in.

In addition, Ghostty is leaking these cgroups, as one is created for each new surface and then not removed with the surface. This is visible in systemd-cgls --all.

Ghostty 1.1.2-arch, GNOME, Arch Linux.

Reproduction

  1. Launch Ghostty
  2. Create a bunch of tabs (any number will do, let's say 10). Close them all.
  3. Run systemd-cgls --all

Notice that there are a bunch of empty control groups.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions