PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.72k stars 495 forks source link

integrated console starts immediately if untitled editor is reloaded #1420

Open msftrncs opened 6 years ago

msftrncs commented 6 years ago

Issue Type: Bug

Start VSCode with PowerShell extension enabled, with an untitled and dirty PowerShell editor reloaded from hot-exit, but not restarted with the focus (so other editors that are not PowerShell must be also reloaded from hot-exit), and the PowerShell integrated console starts immediately (as soon as extensions start), with its 'starting' status and later the icon appearing in the status bar, even though its unwarranted. This only seems to happen while there is an untitled PowerShell language mode editor that is also dirty, restarted via hot-exit, without it being in focus. (Integrated console starting is expected if any editor in PowerShell language mode restarts with the focus)

image

image

Examples above are with an also untitled dirty SQL language file reloaded with the focus. I can however confirm that it also occurs if a saved and not dirty file is reloaded with the focus, such as Batch:

image

Extension version: 1.8.0 VS Code version: Code 1.25.0 (0f080e5267e829de46638128001aeb7ca2d6d50e, 2018-07-05T13:11:58.697Z) OS version: Windows_NT x64 10.0.17134

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i5 CPU U 430 @ 1.20GHz (4 x 1197)| |GPU Status|2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: unavailable_software
video_decode: enabled
video_encode: enabled
vpx_decode: unavailable_software
webgl: enabled
webgl2: enabled| |Memory (System)|1.74GB (0.66GB free)| |Process Argv|C:\Program Files\Microsoft VS Code\Code.exe| |Screen Reader|no| |VM|0%|
msftrncs commented 6 years ago

Reference to my original mention of this issue on VS Code: https://github.com/Microsoft/vscode/issues/53643

rkeithhill commented 6 years ago

What exactly is the bug? Is it that the PowerShell extension is started upon VSCode restart from a hot exit with an untitled PowerShell editor (with text) that is open but not active (not focused)? I can repro that. But, as you suspect in your vscode issue, it is VSCode that is choosing to activate the PowerShell extension in this case. I'm not sure there is a bug in this extension.

That said, I'm still not quite why you think it is unwarranted? You do have an editor open with PowerShell content in it.

msftrncs commented 6 years ago

because it simply doesn't happen if there are no untitled dirty editors that start as part of the hot-exit. That makes it an abnormal behavior. During normal operations the PowerShell icon only appears while an editor set to PowerShell language mode has focus, and it only starts after the first PowerShell editor has received focus after the start up. As small and unimportant as this is, its still a bug, that it behaves differently under the conditions of an untitled dirty PowerShell mode editor.

Oh, and if this was fixed (as a VS Code issue), it probably also would fix the MSSQL extension issue that was at the heart of my original issue.

viloun commented 5 years ago

I think this is the bug that I ran into. If I have an "Untitled-1" file and mark it as Powershell, then the "Powershell Integrated Console" crashes, and it never returns. This means that I can no longer use the Debug and the status always says "Starting PowerShell..." and it never starts up. If I remove the "Untitled-1" temp file and restart vscode, then everything behaves normally.

My environment:

VSCode version: 1.29.1 bc24f98b5f70467bc689abf41cc5550ca637088e x64

VSCode extensions:

Angular.ng-template@0.1.11 christian-kohler.path-intellisense@1.4.2 donjayamanne.githistory@0.4.4 donjayamanne.python@0.7.0 EditorConfig.EditorConfig@0.12.5 eg2.tslint@1.0.40 eg2.vscode-npm-script@0.3.5 esbenp.prettier-vscode@1.7.2 fabianlauer.vs-code-xml-format@0.1.5 jmrog.vscode-nuget-package-manager@1.1.6 johnpapa.angular-essentials@0.4.0 johnpapa.Angular2@7.0.1 johnpapa.winteriscoming@0.8.8 ms-mssql.mssql@1.4.0 ms-vscode.cpptools@0.20.1 ms-vscode.csharp@1.17.1 ms-vscode.PowerShell@1.10.1 ms-vsts.team@1.144.1 msjsdiag.debugger-for-chrome@4.11.1 natewallace.angular2-inline@0.0.17 PeterJausovec.vscode-docker@0.4.0 PKief.material-icon-theme@3.6.1 rbbit.typescript-hero@3.0.0

PSES version: 1.10.1.0

PowerShell version:

Name Value


PSVersion 5.1.14393.693 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14393.693 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1

rjmholt commented 5 years ago

@viloun that sounds like a separate bug. Can you open a new issue and attach your logs please? The information to do so will be in the bug template

viloun commented 5 years ago

It's opened here: https://github.com/PowerShell/vscode-powershell/issues/1649