[Bug] -i initial prompt can remain pending until a second user message on Windows
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Shell
- Sterne
- 11.2k
- Forks
- 1.9k
- Ø Merge
- 14 Std. 16 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
Describe the bug
Starting Copilot CLI with -i/--interactive <prompt> can open the interactive session without executing the supplied initial prompt. The terminal remains responsive. After the user submits another message, the original initial prompt is then executed automatically.
Debug logging shows the pending request is emitted before the foreground session host is registered:
[WARNING] pending-request event was not delivered to the session host
GenericFailure, no session host is registered for session <redacted>
...
[INFO] Starting Copilot CLI: 1.0.84-3
...
[INFO] Registering foreground session: <redacted>
This appears to be a startup ordering/race issue rather than command-line quoting or CR/LF handling.
Affected version
GitHub Copilot CLI 1.0.84-3
Steps to reproduce the behavior
- On Windows, open PowerShell.
- Run
copilot -i "Test of prompt.". - Observe that the interactive UI launches but the supplied prompt may remain unexecuted.
- Submit any second message in the session.
- Observe that the original
Test of prompt.request is then executed automatically.
The same diagnostic ordering occurs when invoking the WinGet executable directly:
& "$env:LOCALAPPDATA\Microsoft\WinGet\Links\copilot.exe" -i "Test of prompt."
Expected behavior
The prompt supplied through -i should execute automatically as soon as the interactive session is ready, without requiring another user message.
Additional context
- Date reproduced: September 9, 2026
- OS: Windows, x64
- Shell: PowerShell 7.6.5
- Terminal hosts tested: Windows Console Host and Windows Terminal
- Copilot CLI: 1.0.84-3 (reported as latest)
- Both the WindowsApps launch alias and direct WinGet executable were tested.
- The WindowsApps package was repaired from
1.0.83.0 / NeedsRemediationto1.0.84.0 / Ok; the pending-request warning still occurred afterward with both launch paths. - Fresh traces consistently recorded the warning about no registered session host roughly 1.2 seconds before
Registering foreground session. - Full debug logs are not attached because they may contain environment/account metadata, but can be provided privately if requested.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, copilot -i "Test of prompt." in PowerShell unter Windows zu reproduzieren, und untersuche das Debug-Log rund um das Ereignis pending-request und den Eintrag Registering foreground session. Erledigt ist die Aufgabe, wenn die ursprüngliche Eingabeaufforderung ausgeführt wird, sobald die interaktive Sitzung bereit ist, ohne dass eine zweite Nachricht erforderlich ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- powershell, shell
- Bereich
- cli, operating-systems
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100