Skip to content

[Bug]: Linux AppImage replaces XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR in spawned terminals #5059

Description

@AmbitiousRealism2025

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Install T3 Code Desktop from the official Linux AppImage (in this case through the t3code-bin AUR package).
  2. Launch T3 Code under a Wayland desktop session.
  3. Open a T3 Code/Codex thread that can run shell commands.
  4. Inspect the relevant environment variables:
env | grep -E '^(XDG_DATA_DIRS|GSETTINGS_SCHEMA_DIR)='
  1. Query a standard system GSettings schema:
gsettings get org.gnome.desktop.interface color-scheme
  1. Compare with the systemd user-manager environment:
systemctl --user show-environment | grep -E '^(XDG_DATA_DIRS|GSETTINGS_SCHEMA_DIR)='

Expected behavior

T3 Code should preserve the host's normal data and schema discovery paths for spawned terminals, agents, and child applications.

If the AppImage requires bundled data paths, it should append or scope them narrowly rather than replacing the host paths. A T3-specific GSETTINGS_SCHEMA_DIR should not hide system schemas from unrelated child processes.

Actual behavior

Inside the T3 Code-spawned environment:

GSETTINGS_SCHEMA_DIR=/opt/t3code-bin/usr/share/glib-2.0/schemas
XDG_DATA_DIRS=/home/<user>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/opt/t3code-bin/usr/share

The T3 value for XDG_DATA_DIRS omits /usr/local/share and /usr/share. The T3-specific GSETTINGS_SCHEMA_DIR also overrides normal schema discovery.

As a result, a standard query fails:

$ gsettings get org.gnome.desktop.interface color-scheme
No schemas installed

The systemd user-manager environment is clean and retains the system paths:

XDG_DATA_DIRS=/home/<user>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/

It does not contain the T3-specific GSETTINGS_SCHEMA_DIR. Running the same query with the contaminated variable unset and normal data directories restored succeeds.

This can break GTK/libadwaita schema lookup, icons, themes, and GUI applications launched from T3 Code terminals or agent processes.

Impact

Major degradation or frequent failure — host desktop applications and tools launched through T3 Code can lose access to installed schemas and shared desktop data.

Version or commit

T3 Code Desktop 0.0.31-1, official AppImage packaged through t3code-bin.

Environment

  • CachyOS Linux x86_64
  • MangoWM on Wayland
  • T3 Code Desktop AppImage
  • GTK 3 and GTK 4/libadwaita applications installed from system packages

Logs or stack traces

$ env | grep -E '^(XDG_DATA_DIRS|GSETTINGS_SCHEMA_DIR)='
GSETTINGS_SCHEMA_DIR=/opt/t3code-bin/usr/share/glib-2.0/schemas
XDG_DATA_DIRS=/home/<user>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/opt/t3code-bin/usr/share

$ gsettings get org.gnome.desktop.interface color-scheme
No schemas installed

Control test:

$ env -u GSETTINGS_SCHEMA_DIR \
    XDG_DATA_DIRS="/home/<user>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share" \
    gsettings get org.gnome.desktop.interface color-scheme
'prefer-dark'

Screenshots, recordings, or supporting files

No screenshot required; the environment and command output provide a deterministic reproduction.

Workaround

For affected commands or launchers, unset the injected schema directory and restore the normal system data paths:

env -u GSETTINGS_SCHEMA_DIR \
  XDG_DATA_DIRS="$HOME/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share" \
  <command>

This is only a per-process workaround.

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