-
Notifications
You must be signed in to change notification settings - Fork 317
Description
Prerequisites
- Write a descriptive title.
- Make sure you are able to repro it on the latest released version
- Search the existing issues, especially the pinned issues.
Exception report
N/AScreenshot
I'm using agentic AI a lot more and currently working in Visual Studio 2022 (latest) with Copilot. When I ask Copilot to do something very simple, such as echo Hello World and verify that it can get the response, it fails to get the response.
The issue comes down to this command that gets run every time that I open the terminal in Visual Studio, or every time I ask Copilot to run a command in the terminal when it is closed:
if (Get-Module -Name PSReadLine) { $Global:DevEnvOriginalPSConsoleHostReadLine = $function:PSConsoleHostReadLine; function Global:PSConsoleHostReadLine { $CommandLine = $Global:DevEnvOriginalPSConsoleHostReadLine.Invoke(); [Console]::Write("$([char]0x1b)]633;C$([char]0x1b)\"); $CommandLine } }If I undo that command, which so far I have only been able to do after the terminal opens, then CLI commands from agentic Copilot work. If I leave that command in place, then the agent fails to get results from commands that it tries to run in the terminal.
So, I'd like to know (if possible), where does this one-liner come from, why was it added, and can I disable it so that I can use Copilot to execute CLI commands in Visual Studio in agent mode without issue?
Environment data
PS Version: 7.5.2
PS HostName: ConsoleHost
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.26100.1 (WinBuild.160101.0800)
BufferWidth: 343
BufferHeight: 26Steps to reproduce
Try asking Copilot in Agent mode in Visual Studio to echo Hello World and confirm that it gets a response.
Expected behavior
It should get a response.
Actual behavior
It shows an error indicating that it failed to run the command.