Repository navigation
Description
System Details
System Details Output
### VSCode version: 1.41.1 26076a4de974ead31f97692a0d32f90d735645c0 x64
### VSCode extensions:
[email protected]
### PSES version: 2.0.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 5.1.17763.771
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.771
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
-
Launch VSCode
-
Close any open files.
-
Close VSCode.
-
Open a very basic
.ps1file from a saved workspace.

The console changes to "PowerShell integrated console"

However, the console (terminal or whatever you're calling it these days) is blank.
(Please note, PowerShell Preview extension is installed. I have reported the notification bug in The 'PowerShell' extension is recommended for this file type #2406 )
If I scroll up, I can see your ASCII art:

There is no prompt. (C:\>). I have to press enter to get a prompt.
- Set focus to the script window.
- Press
f5to run the script.

As you can see, indentation and output are all over the place. Lines merged and strange indentation.
Even when the output isn't so mangled, the output still starts after the prompt (C:\ >) as opposed to ISEs behaviour where it is on its own line:

Expected Behaviour
What I want to see is an output like ISE.

The output is on a new line, at the start of the line with no indentation and the prompt is clean, on a new line waiting for the next command.
Actual Behaviour
See "Issue description".
This behaviour isn't something new. It's been happening for ~12 months or more. In both the current and preview version of the PowerShell extension. It's finally annoyed me enough to write this.
I've also noticed other spurious behaviour. For instance, I can start typing in the console and it starts at some random position in the previous output, not after the C:\ > (greater-than symbol) as one would expect.
This behaviour happens on multiple PCs and laptops. The examples above have been taken from a laptop freshly installed today, with Windows 10 Enterprise 1909.
Attached Logs
Follow the instructions in the troubleshooting docs
about capturing and sending logs.

Activity
rjmholt commentedon Jan 10, 2020
Thanks for opening this issue Arcotek Limited (@arcotek-ltd).
That's been changed in PowerShell/PowerShellEditorServices#1141. From next release we'll just have a small indication in the Integrated Console to let you know you're not in ordinary PowerShell. This will be disablable with a VSCode setting.
This is a Windows-specific terminal bug that we haven't been able to reproduce ourselves. The latest VSCode release has had some issues in the terminal layer which have impacted the Integrated Console experience in particular unfortunately.
I've seen the particular rogue indentation you have in the screenshot there too. Hopefully we can address that soon, similar to PowerShell/PowerShellEditorServices#1097, but it hasn't been as high priority as the functional bugs we've been working on recently. Due to the way running scripts and running prompts work, this can be a tricky problem to solve, so it's something we're gradually solving.
Do you have other cases where the indentation is wrong you can share? That was the only case I saw in your issue.
This is for you to set in your
promptfunction, which you can define in your$profile. The PowerShell extension tries not to have opinions or force settings onto users, since what looks good to some does not to others. Instead you're free to define your own prompt in the$profile. The current prompt is the default for PowerShell. Please note that the PowerShell extension's$profilelies on a different path to those of PowerShell and the ISE, but you can also define a$profilefor all hosts if you prefer a unified experience ($profile.CurrentUserAllHosts).We've been working recently on the functional bugs in the lead up to the PowerShell 7 release. After that, and hopefully with a fix in VSCode/Windows for the recent UI issues, I'm hopeful we can address some of the cosmetic issues.
Of the four issues you raise here, hopefully one is resolved instantly for you and one will be resolved in the next release. The console prompt not appearing is a nebulous issue that we've been trying to identify the cause of in #2014, but is very dependent on lower layers like xtermjs, VSCode and Windows. That leaves the indented prompt after run, which, to keep this issue cohesive so that it represents a work item for us, I'll use as the ongoing focus for this issue.
[-]PowerShell Integrated Console output is a mess.[/-][+]Prompt incorrectly indented after debugger run[/+]rjmholt commentedon Jan 10, 2020
Issue likely introduced in PowerShell/PowerShellEditorServices#1097
TylerLeonhardt commentedon Jan 10, 2020
Actually, I think this might be the same issue as #2408
TylerLeonhardt commentedon Jan 11, 2020
The history was introduced with PSReadLine. PSReadLine involved quite a massive change to the PowerShell extension.
Totally hear the frustration, we're working hard on trying to stabilize the PSReadLine support so it can replace the current stable extension.