question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

extra line after submitting command in VS Code terminal

See original GitHub issue

Originally 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.

image

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.

image

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:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
andschwacommented, Aug 24, 2021

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.

1reaction
andschwacommented, Oct 29, 2021

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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

VScode Python - Send selected lines to terminal adding extra ...
Your example with a function should be working: import time import os print('test') def main(): pass. And the result: > ...
Read more >
Integrated Terminal in Visual Studio Code
Use the Ctrl+Shift+` keyboard shortcut to create a new terminal. Use the View > Terminal or Terminal > New Terminal menu commands. From...
Read more >
Advanced Visual Studio Code for Python Developers
You can add any extra Python command-line flags to "args" . ... ~/.bashrc. When you open up a new terminal in VS Code,...
Read more >
VS Code tips — Insert line above/below - YouTube
Today's VS Code commands : insert line above/belowInsert a blank line above or below the cursor position. These commands are not effected by ......
Read more >
Windows Terminal command line arguments | Microsoft Learn
up , down , left , or right values accepted. Note. When opening Windows Terminal from cmd (Command Prompt), if you want to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found