extra line after submitting command in VS Code terminal
See original GitHub issueOriginally in https://github.com/PowerShell/PSReadLine/issues/1042
System Details
System Details Output
### VSCode version: 1.38.1 b37e54c98e1a74ba89e03073e5a3761284e3ffb0 x64
### VSCode extensions:
eamodio.gitlens@9.9.3
GitHub.vscode-pull-request-github@0.11.1
GitHub.vscode-pull-request-github-insiders@2019.9.23035
le0zh.vscode-regexp-preivew@0.0.3
ms-mssql.mssql@1.6.0
ms-vscode.cpptools@0.25.1
ms-vscode.csharp@1.21.2
ms-vscode.powershell@2019.5.0
ms-vscode.powershell-preview@2019.5.0
ms-vscode.Theme-TomorrowKit@0.1.4
Serhioromano.vscode-st@1.7.1
vscode.theme-monokai-less-dimmed@0.0.1
### PSES version: 2.0.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 7.0.0-preview.3
PSEdition Core
GitCommitId 7.0.0-preview.3
OS Microsoft Windows 10.0.18980
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
FYI, only the preview version is enabled. VS Code indicates that the non preview version is not actually installed.
From PSReadLine:
PS version: 7.0.0-preview.3
PSReadline version: 2.0.0-beta4
os: 10.0.18975.1000 (WinBuild.160101.0800)
PS file version: 7.0.0.0
BufferWidth: 174
BufferHeight: 25
This is actually a build of PSReadLine using PR PowerShell/psreadline#979
Steps to reproduce
Using the Integrated PowerShell Console in VS Code’s terminal (currently 1.38.1 Stable and Nightly) enter commands until the buffer (screen) is full. At that time, every command entered seems to receive a blank line immediately after the last line of the command, before the results or next prompt appears. This can be demonstrated with a blank command entry.

This does not happen with the normal Windows console, nor does this happen if I switch to CMD in a Integrated PowerShell Console session, inside VS Code’s terminal.

It would seem that when PSReadLine is enabled, an additional step is occurring that causes the extra line feed, only when the cursor is already at the bottom of the buffer. If PSReadLine support is disabled (pasting scripts become more difficult), the issue goes away.
This does not happen in the regular VS Code terminal when PowerShell is the shell, regardless of PSReadLine.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:10 (4 by maintainers)

Top Related StackOverflow Question
Indeed, we are. It is progressing! @rjmholt just replaced the entire prompt logic, much simplifying it, and is working on plumbing through cancellation tokens now. We can’t commit to any particular date, but we are actively working on it and hope to have it as soon as possible.
Hello, and thank you for your patience! The latest PowerShell Preview for VS Code is now out, and includes the reworking of our pipeline and threading architecture in https://github.com/PowerShell/PowerShellEditorServices/issues/1295. Could you verify if this issue still reproduces using v2021.10.3-preview? Please note that this preview is likely to include other bugs, and you should feel free to file new issues for those so we can work through them. Thanks again!