Skip to content

Starting PowerShell extension from VSCode results in PSReadLine error #3453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
cdonnellytx opened this issue Oct 21, 2022 · 4 comments
Closed
3 tasks done

Comments

@cdonnellytx
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.2.6
PowerShell: 2022.10.0
OS: Microsoft Windows 10.0.22000
BufferWidth: 210
BufferHeight: 26

Last 0 Keys:



### Exception

System.Management.Automation.PSInvalidOperationException: You should only run a nested pipeline from within a running pipeline.
   at System.Management.Automation.Runspaces.PipelineBase.DoConcurrentCheck(Boolean syncCall, Object syncObject, Boolean isInLock)
   at System.Management.Automation.Runspaces.RunspaceBase.DoConcurrentCheckAndAddToRunningPipelines(PipelineBase pipeline, Boolean syncCall)
   at System.Management.Automation.Runspaces.PipelineBase.CoreInvoke(IEnumerable input, Boolean syncCall)
   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, IList`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 76
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeCommand[TResult](PowerShell pwsh, PSCommand psCommand, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 99
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.ExecuteNormally(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 125
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.Run(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 77
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteSynchronously(CancellationToken executorCancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 92
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.get_Result() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 58    
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteAndGetResult(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 108
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokePSCommand[TResult](PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 461
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.InvokePSCommand(PSCommand psCommand, PowerShellExecutionOptions executionOptions, CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 464
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.OnPowerShellIdle(CancellationToken idleCancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 1140
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()

Screenshot

PowerShell Extension screenshot

Environment data

PS Version: 7.2.6
PS HostName: Visual Studio Code Host
PSReadLine Version: 2.2.6
PSReadLine EditMode: Windows
OS: 10.0.22000.1 (WinBuild.160101.0800)
BufferWidth: 210
BufferHeight: 26

Steps to reproduce

Prerequisites:

  • Visual Studio Code
  • ms-vscode.powershell extension (v2022.10.0)
  1. Start Visual Studio Code
  2. Make sure the PowerShell extension is loaded. (Easiest way seems to be to open a .ps1 file in an editor tab.)

Expected behavior

No exception...

Actual behavior

The above exception happens...

@ghost ghost added the Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. label Oct 21, 2022
@cdonnellytx
Copy link
Author

FWIW, I'm guessing this is probably a bug with the VSCode PowerShell plugin itself, since it was last released yesterday. I'm mainly posting this here because the error message says to do so, and others may find it useful.

@daxian-dbw
Copy link
Member

Thanks for opening the issue. cc @andschwa FYI

@cdonnellytx
Copy link
Author

OK, I've looped in the VSCode folks.

@daxian-dbw daxian-dbw added Resolution-External and removed Needs-Triage 🔍 It's a new issue that core contributor team needs to triage. labels Oct 21, 2022
@daxian-dbw
Copy link
Member

Great, then I will close this one as external.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants