fix(ui): strip CLAUDE_CODE_CHILD_SESSION/CLAUDECODE before every ConPTY launch
Changelog / changelog (push) Successful in 2s
Release / release (push) Successful in 42s

ClaudeDo.App inherits its own process environment from whatever started it
(e.g. a dev/test launch from inside a claude session). Every embedded
claude.exe it spawns into a Mission Control tile then inherited those
markers too, so the child session mistook itself for a subagent: transcript
saving disabled and a degraded startup banner (white instead of orange,
missing box rules). PtyTerminalSession.StartAsync is the one choke point
all ConPTY launches already share for env handling, so clearing both vars
there covers task, ad-hoc, planning, and list-handler sessions regardless
of how ClaudeDo.App itself was started.
This commit is contained in:
mika kuns
2026-09-03 07:22:59 +02:00
parent 06bc3d2105
commit 51ee505057
@@ -68,6 +68,14 @@ public sealed class PtyTerminalSession : IDisposable
await WaitForLaunchGateAsync(s_launchGate, s_launchGateTimeout, ct); await WaitForLaunchGateAsync(s_launchGate, s_launchGateTimeout, ct);
try try
{ {
// If ClaudeDo.App itself was started from inside a claude session (e.g. a dev/test
// launch), it inherits these markers and every embedded PTY session would otherwise
// inherit them too — the child claude then thinks it's a spawned subagent and
// disables transcript saving / degrades its own startup banner. Every ConPTY tile
// must look like a fresh top-level session regardless of how ClaudeDo.App was launched.
Environment.SetEnvironmentVariable("CLAUDE_CODE_CHILD_SESSION", null);
Environment.SetEnvironmentVariable("CLAUDECODE", null);
foreach (var (key, value) in descriptor.Env) foreach (var (key, value) in descriptor.Env)
Environment.SetEnvironmentVariable(key, value); Environment.SetEnvironmentVariable(key, value);