Hello, when running the .AppImage on Linux and creating the corresponding .desktop application, t3code was unable to find the codex CLI even though it was correctly available in my PATH (set in both .bashrc and .zshrc).
At first I assumed this was something specific to my system, but after digging into it I determined the issue was caused by how PATH hydration was handled in the t3code startup sequence. This PR fixes that
Fixes #234
Fixes #367
Fixes #269
Fixes #301
Also related to #226
What Changed#
- Fixed desktop PATH hydration so Linux packaged launches resolve
codex the same way terminal launches do.
- Moved server PATH hydration earlier in startup so provider health checks run after PATH has been normalized.
- Added regression tests covering startup ordering and shared shell PATH behavior.
Why#
When launching from a Linux desktop entry, the app could report that the Codex CLI was missing or not executable even though codex worked fine in the terminal. This happened for two reasons:
- PATH hydration for desktop/server startup only handled macOS, so Linux GUI launches could miss shell-managed paths.
- Provider health was computed before PATH normalization ran, which could cause the Codex status to be reported incorrectly during startup.
Note
Fix Codex CLI detection on Linux by extending shell environment hydration to Linux#
- Extends
fixPath in os-jank.ts and syncShellEnvironment in syncShellEnvironment.ts to run on both darwin and linux (previously macOS-only).
- Adds
resolveLoginShell in shell.ts to determine the login shell per platform: uses the provided $SHELL, falls back to /bin/zsh on macOS and /bin/bash on Linux, and returns undefined on unsupported platforms.
- Both
fixPath and syncShellEnvironment now return early without modifying the environment if no login shell can be resolved (e.g. on Windows).
- Behavioral Change:
fixPath now accepts an options object for env, platform, and readPath overrides and writes PATH back to the provided env rather than always process.env.
Macroscope summarized ccb8b25.
Note
Medium Risk
Changes process environment hydration on Linux and alters default shell selection behavior, which can impact CLI discovery and startup behavior across platforms. Risk is moderate due to OS-specific variability, but changes are guarded to only run on darwin/linux with added regression tests.
Overview
Fixes Linux packaged startup CLI detection by extending login-shell environment hydration to Linux in both desktop (syncShellEnvironment) and server (fixPath) startup.
Adds shared resolveLoginShell helper to choose a platform-appropriate default shell (/bin/zsh on macOS, /bin/bash on Linux) and no-op on unsupported platforms, and adds tests verifying PATH/SSH_AUTH_SOCK hydration plus that server fixPath runs before server start.
Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ccb8b259acaff86a0cb7a189c82c817be1bbf7c1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
3e2e068f-20a6-464f-b122-c431d1781c2aYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
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