fix(desktop): use consistent env for persistent terminal sessions#783
fix(desktop): use consistent env for persistent terminal sessions#783
Conversation
The daemon-based terminal manager was merging the daemon's process.env with the filtered environment from buildTerminalEnv(). This caused inconsistent behavior between persistent and non-persistent modes: - Non-persistent: uses only the filtered env from buildTerminalEnv() - Persistent: merged daemon's process.env + filtered env The daemon's process.env could be stale (from when daemon was first spawned) or contain different values than expected, leading to unpredictable terminal environments. Now both modes use only the filtered env from buildTerminalEnv(), ensuring consistent and predictable behavior.
…ions" This reverts commit 6d1c275.
…sions" This reverts commit 64e29dd.
📝 WalkthroughWalkthroughSession.spawn now builds the child process environment using buildSafeEnv(...) over the merged host/env map instead of locally filtering process.env; TERM is set to "xterm-256color" and ELECTRON_RUN_AS_NODE behavior for the Electron subprocess is preserved. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
1ce6346 to
bc840ed
Compare
…essions Merge process.env with passed env (passed takes precedence), then filter through buildSafeEnv allowlist. This ensures shells always have a working base environment while filtering out secrets and Electron-specific vars.
bc840ed to
3cb7471
Compare
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
Summary
Test plan
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.