Skip to content

Duplication of last command into terminal #4056

Closed
@martincrothers

Description

@martincrothers

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

When executing PowerShell code in Visual Studio Code, the executed command(s) get re-inserted into the terminal on the next line after completion (pic for clarity).
image

Versions I was running:
Extension: 2022.6.1
VS Code: 1.68.1
PowerShell: 7.2.5
OS: Windows 10 (OS Build 19043.1766)

I rolled back the extension to 2022.5.1 and the issue went away. Before rolling back the extension I tried rolling back VSCode to the previous version (1.67.2), but that did not resolve the issue. Rolling back the extension worked on both versions of VSCode. I did not try rolling back PowerShell.

PowerShell Version

PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.2.5
PSEdition                      Core
GitCommitId                    7.2.5
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

PS C:\> code --version
1.67.2
c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5
x64

Extension Version

PS C:\> code --list-extensions --show-versions | Select-String powershell
ms-vscode.powershell@2022.5.1

Steps to Reproduce

With code in the editor window, press F5 or the run button; or select some code and press F8 or the run selection button.

The example I had in the screenshot was a .ps1 file that only contained:

$pwd

...to keep the screenshot simple.

Visuals

No response

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions