Repository navigation
CLI not able to run any commands #196
Description
Activity
@javiercn confirmed that his PowerShell profile emits a lot of extra info by default on startup. I suspect this is confusing the output parser. So I expect we can fix this by passing
-NoProfiletopwsh.exewhen running shell commands (which is something we should be doing anyway to avoid any other interference).We've fixed this in 0.0.335!
@RyanHecht I seem to still get this error in version 0.0.336, so not sure it has been resolved
✗ Get current branch name $ git rev-parse --abbrev-ref HEAD <exited with error: PowerShell 6+ (pwsh) is not available. Please install it from https://aka.ms/powershell. Error: Error: Command failed: pwsh.exe --version 'pwsh.exe' is not recognized as an internal or external command, operable program or batch file. >PS C:\> copilot -version 0.0.336 Commit: 75151b8Reacted by uyrabi, Joaquin Guerrero, Ahmad Bassel and Milton@glenschrader That's a different thing - as per the message, you do need to install PowerShell (6+), as it's a prerequisite for this tool on Windows.
@SteveSandersonMS thanks, I have to admit I just assumed Windows 11 would have the latest powershell installed (or at least 6).
Still getting the "Permission denied and could not request permission from user" in version 0.0.346. Commit: 74e4d22
I have same problem with GitHub Copilot v0.0.395 and I have pwsh.exe --version -> PowerShell 7.5.4 in my system currently installed. Claude cli, Gemini cli and Cursor cli all work fine.
Something wrong with copilot cli. not just python commands, any powershell or git commands all are failing with the same error message:

❯ run pwd
✓ Print working directory
$ pwd
└ 1 line...Read shell output:
Waiting up to 5 seconds for command output
Invalid session ID: 0. Please supply a valid session ID to read output from.same issue here....
My initial command:
copilot -p "Read SPEC.md and start the project"Same problem, message repeated:
Permission denied and could not request permission from userFixed by adding:
copilot -p "Read SPEC.md and start the project" --allow-allI am using GitHub Copilot CLI 0.0.409. on Windows 11 with PowerShell 7.5.4
I can see that different issues were reported here. To solve the last one from @mfide one has to update powershell on windows at least to version 6 as copilot itself suggested:
● The issue is with the environment configuration, not my capabilities. The powershell tool I have access to is configured to use PowerShell 6+ (pwsh.exe), but this system appears to only have Windows PowerShell 5.1 installed. Error message (in German): Error: Command failed: pwsh.exe --version Der Befehl "pwsh.exe" ist entweder falsch geschrieben oder konnte nicht gefunden werden. Translation: "The command 'pwsh.exe' is either misspelled or could not be found." The Problem: - The CLI tool wrapper expects pwsh.exe (PowerShell Core/6+) - Your system doesn't have it installed - You likely have Windows PowerShell 5.1 instead Solutions: 1. Install PowerShell 6+ from https://aka.ms/powershell (https://aka.ms/powershell) 2. Or: Use your local terminal directly (PowerShell, CMD, or Git Bash) and run commands yourself - I can provide guidancenevertheless, this doesn't solve the fact that most shell commands doesn't really work. For instance:
$ cd .. No Contentlsorpwdwould worki also have same issue copilot can't able to access both
cmdandpwsh.@RyanHecht the issue was not fixed.
Same for me with latest version
Permission denied and could not request permission from userReacted by garkaselite


Describe the bug
This is on windows. Whenever I try to make it do anything, it fails to run any command (powershell or CMD)
Below is just an extract of me asking it to describe the project structure for a folder it has access to.
Affected version
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
Additional context
No response