feat: default the T3 home to XDG_DATA_HOME on Linux - #2
Merged
Merged
Conversation
When T3CODE_HOME and the base-dir flags are unset, Linux now resolves the
T3 home to ${XDG_DATA_HOME:-~/.local/share}/t3code instead of ~/.t3.
An existing ~/.t3 keeps winning when the XDG directory does not exist,
so current installs are not moved. macOS and Windows keep ~/.t3.
One pure resolver in @t3tools/shared/defaultT3Home feeds the server
resolveBaseDir, the desktop resolveDesktopBaseDir and early startup, and
the two dev database scripts. The remote SSH scripts apply the same
default before honoring T3CODE_HOME. The session scanner also skips
t3code/worktrees. Docs that stated the old default are updated.
PixelHabits
force-pushed
the
xdg-home
branch
from
September 15, 2026 15:40
c0203bb to
ff5fe51
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
Fork-only. Stacked on #1, so the diff shows both commits until that one merges.
When
T3CODE_HOMEand the base-dir flags are unset, Linux resolves the T3 home to${XDG_DATA_HOME:-~/.local/share}/t3codeinstead of~/.t3. Precedence:T3CODE_HOMEor--base-dir/--home-dir~/.t3macOS and Windows keep
~/.t3. Nothing is moved automatically.Where
packages/shared/src/defaultT3Home.ts: one pure resolver plus a host wrapper that reads platform and env throughHostProcessPlatform/HostProcessEnvironment.resolveBaseDir, desktopresolveDesktopBaseDirand early Electron startup, the two dev database scripts.T3CODE_HOME.t3code/worktrees.Not covered
~/.t3/devicein the mobile device hub script and the WSL runtime paths.Verification
@t3tools/shared,@t3tools/desktop,t3,@t3tools/ssh