fix(server): scrub AppImage XDG_DATA_DIRS and GSETTINGS_SCHEMA_DIR from terminals - #5075
Conversation
…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>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: 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. |
## 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
What Changed
Added
XDG_DATA_DIRSandGSETTINGS_SCHEMA_DIRto the AppImage environment scrub inapps/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
AppRunpointsXDG_DATA_DIRSat an$APPDIR/usr/shareentry andGSETTINGS_SCHEMA_DIRat the bundled$APPDIR/usr/share/glib-2.0/schemas. The existing scrub (added for #1699) only cleanedPATH/LD_LIBRARY_PATH, so those two leaked into the PTY andgsettingsinside the terminal reported "No schemas installed".Both are colon-separated search paths, so they join the same
APPIMAGE_PATH_LIKE_ENV_KEYSscrub: 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
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_DIRSandGSETTINGS_SCHEMA_DIRmount paths from the server process (fixes #5059, alongside existing #1699 scrub forPATH/LD_LIBRARY_PATH).Both variables are treated like other colon-separated search paths: AppImage
$APPDIRsegments are stripped, host entries stay, and if only mount segments remain the variable is removed so tools likegsettingsuse host defaults instead of reporting missing bundled schemas.The AppImage terminal test now asserts scrubbed
XDG_DATA_DIRSand undefinedGSETTINGS_SCHEMA_DIRwhen 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_DIRSandGSETTINGS_SCHEMA_DIRfrom terminal environments when launched via AppImageExtends
APPIMAGE_PATH_LIKE_ENV_VARSin Manager.ts to strip AppImage mount segments fromXDG_DATA_DIRSandGSETTINGS_SCHEMA_DIRwhen spawning terminals. If stripping leaves a variable with no remaining entries, the variable is removed entirely from the environment.Macroscope summarized 23781bb.