diff --git a/docs/explore-notes/conpty-sessions.md b/docs/explore-notes/conpty-sessions.md index e3824ea5..2aecb7c3 100644 --- a/docs/explore-notes/conpty-sessions.md +++ b/docs/explore-notes/conpty-sessions.md @@ -46,6 +46,21 @@ except for a fresh task session with a brief, where `--add-dir ` mus `--model` is deliberately **NOT** forced on an interactive session — the user can still switch models in the TUI. +### ⚠️ Gotcha: no directory arg may end in a separator + +`PtyTerminalSession` hands `Args` to `TerminalControl.Args`, which the library flattens into ONE +Windows command line with each token quoted. Windows argv rules read `\"` as an *escaped* quote, +so a token like `"C:\repo\"` never closes and every following argument is swallowed by the +preceding **variadic** flag. A list working dir stored as `C:\Dev\Repos\Bandel.Hub\` therefore +fed `--add-dir` the repo, `--append-system-prompt-file`, its value **and** the positional kickoff: +the CLI warned `brief.md is not a directory` and the session opened with no prompt at all +(2026-08-06). `BuildForMergeHelperAsync`/`BuildForMergeHelperHandoffAsync` now run the repo +through `TrimTrailingSeparator`; session dirs the worker builds never carry one. + +Diagnosing this from code or a PowerShell repro is a dead end — PowerShell quotes correctly, so +every repro passes. Read the real command line instead: +`Get-CimInstance Win32_Process -Filter "Name = 'claude.exe'"`. + ## Resuming a task session (`TaskEntity.InteractiveSessionId`) `claude --session-id ` lets the caller pre-assign a conversation's session id instead of