Skip to content

fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals - #5075

Merged
maria-rcks merged 1 commit into
pingdotgg:mainfrom
arhxam:fix/appimage-terminal-xdg-gsettings
Aug 4, 2026
Merged

fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals#5075
maria-rcks merged 1 commit into
pingdotgg:mainfrom
arhxam:fix/appimage-terminal-xdg-gsettings

Conversation

@arhxam

@arhxam arhxam commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What Changed

Added XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR to the AppImage environment scrub in apps/server/src/terminal/Manager.ts. Extended the existing AppImage terminal test.

Why

Closes #5059.

The integrated terminal inherits the server process environment. On Linux AppImage builds the runtime's AppRun points XDG_DATA_DIRS at an $APPDIR/usr/share entry and GSETTINGS_SCHEMA_DIR at the bundled $APPDIR/usr/share/glib-2.0/schemas. The existing scrub (added for #1699) only cleaned PATH/LD_LIBRARY_PATH, so those two leaked into the PTY and gsettings inside the terminal reported "No schemas installed".

Both are colon-separated search paths, so they join the same APPIMAGE_PATH_LIKE_ENV_KEYS scrub: the AppImage mount segments are dropped, the user's real entries preserved, and when only mount segments remain the variable is removed so the shell falls back to the platform default. The added assertions fail before and pass after; all 50 Manager tests pass.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes

Note

Low Risk
Scoped to Linux AppImage terminal spawn env scrubbing with existing path-filter logic and test coverage; no change when not launched from an AppImage.

Overview
Extends the AppImage terminal environment scrub so integrated PTYs no longer inherit XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR mount paths from the server process (fixes #5059, alongside existing #1699 scrub for PATH / LD_LIBRARY_PATH).

Both variables are treated like other colon-separated search paths: AppImage $APPDIR segments are stripped, host entries stay, and if only mount segments remain the variable is removed so tools like gsettings use host defaults instead of reporting missing bundled schemas.

The AppImage terminal test now asserts scrubbed XDG_DATA_DIRS and undefined GSETTINGS_SCHEMA_DIR when it pointed only at the mount.

Reviewed by Cursor Bugbot for commit 23781bb. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Scrub XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminal environments when launched via AppImage

Extends APPIMAGE_PATH_LIKE_ENV_VARS in Manager.ts to strip AppImage mount segments from XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR when spawning terminals. If stripping leaves a variable with no remaining entries, the variable is removed entirely from the environment.

Macroscope summarized 23781bb.

…om terminals

The integrated terminal inherits the server process environment. On Linux
AppImage builds the runtime's `AppRun` points `XDG_DATA_DIRS` at an
`$APPDIR/usr/share` entry and `GSETTINGS_SCHEMA_DIR` at the bundled
`$APPDIR/usr/share/glib-2.0/schemas`. The existing scrub (added for pingdotgg#1699) only
cleaned `PATH`/`LD_LIBRARY_PATH`, so those two leaked into the PTY and
`gsettings` inside the terminal reported "No schemas installed" (and tools saw
the AppImage's data dir instead of the host's).

Both are colon-separated search paths, so add them to the same
`APPIMAGE_PATH_LIKE_ENV_KEYS` scrub: the AppImage mount segments are dropped and
the user's real entries preserved, and when only mount segments remain the
variable is removed so the shell falls back to the platform default. Extended
the existing AppImage terminal test to assert both.

Closes pingdotgg#5059

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eacf1ada-8637-4638-a9d2-75efbe4fa8f5

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Jul 31, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 23781bb

Straightforward bug fix extending an existing AppImage environment scrubbing mechanism to two additional variables (XDG_DATA_DIRS, GSETTINGS_SCHEMA_DIR). The change is minimal, uses established infrastructure, and includes test coverage.

You can customize Macroscope's approvability policy. Learn more.

@maria-rcks
maria-rcks merged commit c30a6d9 into pingdotgg:main Aug 4, 2026
17 checks passed
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 4, 2026
## What's Changed
* fix(web): increase tooltip z-index to overlay popovers and menus by @naMqe-h in pingdotgg/t3code#5326
* fix(server): use a Cursor todo's title when its content is blank by @arhxam in pingdotgg/t3code#5073
* fix(ssh): isolate managed tunnel processes by @nateEc in pingdotgg/t3code#4347
* fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals by @arhxam in pingdotgg/t3code#5075

## New Contributors
* @naMqe-h made their first contribution in pingdotgg/t3code#5326

**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260804.997...v0.0.32-nightly.20260804.998

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260804.998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants