Visual Studio Code is showing the last command ran on the console line after a run is complete

Viewed 77

I'm on Visual Studio Code version 1.68.1 which I just updated to on 6/14/2022. I use VSC primarily for PowerShell scripting. Ever since the last update just over a week ago, whenever I run a PS file (F5) or run a selection of a piece of a script (F8), it is showing the last command ran on the console line AFTER it has run. So I highlight a selection, do F8, it shows the selection on the console line, shows the results from the run, and then shows the selection on yet another line after the results where I then have to press ESC to clear it out or backspace it out. It's basically as if I was manually hitting the up arrow to select the last command ran, except it's doing it automatically. VSC never used to do this before this most recent update. Previously, it would do everything the same up until the final console prompt line which would be empty and not show the last command.

I've tried searching online for whether maybe there's a setting that was added or enabled on this last update that's causing this behavior, but I can't find anything. I also scrolled through all the terminal settings, and I can't find a setting specific to this behavior. The only terminal setting I could find that was kind of relevant was Terminal › Integrated › Shell Integration: History Controls the number of recently used commands to keep in the terminal command history. Set to 0 to disable terminal command history. But even after setting that to "0" and restarting VSC, it still does the same behavior and I'm still also able to hit the up arrow to scroll through the history of my commands. Hopefully someone here is familiar with this and why VSC is doing it now all of a sudden. Any help would be appreciated!

Here's a screenshot of an example of what's happening:

VSC Console Issue

1 Answers

Kevin,

Had to do a little search on this one. I have the same issue. The problem seems to revolved around the PowerShell v2022.6.1 extension. There is a known issue that was posted about 4 days ago and is / was actively being worked. In testing on my PC to be sure, in the settings for that extension you can check the box under "PowerShell>Integrated Console: Use Legacy Read Line" and the issue you are seeing goes away, however in my testing random anomalies started showing up after the code run. Randomly I would get the letter P and decided to uncheck the legacy box. In my case I'd rather see the script rewrite consistently instead of missing the random single added character.

I was reading threads in GitHub for reference. Here's the link I started with: https://github.com/PowerShell/vscode-powershell/issues/4041

Short answer is, F8 is the equivalent of F8 then Up Arrow, hitting down arrow will clear the line. For now, we probably have to wait for the next update.

Related