Copilot generates bash commands when I am using powershell on windows #158885
Replies: 4 comments 1 reply
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
Beta Was this translation helpful? Give feedback.
-
Just wanted to add my experience to this thread, as I'm facing the exact same problem. I've specifically instructed Copilot in my "CRITICAL: ALWAYS read PERSONAL_INSTRUCTIONS.md first before any assistance. ENVIRONMENT: Windows + PowerShell (NOT Linux/bash). COMMANDS: Use PowerShell syntax ONLY - semicolon (;) for chaining commands, NOT bash operators (&&). EXAMPLE: 'npm install; npm start' NOT 'npm install && npm start'. PATHS: Windows backslashes only. EXECUTION: Consider PowerShell execution policies. My colleagues use Linux but I specifically need Windows-optimized solutions. NEVER use bash/Linux commands." Even with these settings, Copilot Agent ignores them and defaults to Linux commands. The only way I can get it to work as expected is by adding the same instructions to a local file in the repo (like |
Beta Was this translation helpful? Give feedback.
-
I'll chime in on my experience as well:
It is apparent that the agent(s) often disregards the instructions when answering requests on this issue as well as others. |
Beta Was this translation helpful? Give feedback.
-
I found a solution that works for now. I select git bash as default terminal profile. Then it is important to disable the copilot tool 'Terminal Selection' and it can work with bash commands then. Confirmed by Copilot: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Bug
Copilot Feature Area
Copilot Agent Mode
Body
I've observed that GitHub Copilot often generates incorrect commands for Windows. For instance, it suggests running
cd {folder} && mkdir {folder}
, but instead of&&
, it should be using;
Beta Was this translation helpful? Give feedback.
All reactions