PowerShell / PowerShell/vscode-powershell

Error on read command input

Open
#4,851 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Extension Terminal Issue-Bug Needs: Maintainer Attention
Dominant language
TypeScript
Stars
1.9k
Forks
547
PR merge metrics
No merged PRs in 30d

Description

Prerequisites
  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.
Summary

https://github.com/PowerShell/vscode-powershell/issues/4837

I am unable to use my profile in the vscode extension terminal because it will cause PSReadLine errors

PowerShell Version
~/Documents/workstation/esh e91e649@master >$PSVersionTable; $Host

Name                           Value
----                           -----
PSVersion                      7.4.0
PSEdition                      Core
GitCommitId                    7.4.0
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Name             : Visual Studio Code Host
Version          : 2023.8.0
InstanceId       : 6250413c-638c-4418-810f-b7fd28bd672e
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : zh-CN
CurrentUICulture : zh-CN
PrivateData      : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
~/Documents/workstation/esh e91e649@master >code --version
1.85.0-insider
2e721b6ec731c22cd3c2853dbc7ad69deb447515
x64
Extension Version
~/Documents/workstation/esh e91e649@master >code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2023.8.0
Steps to Reproduce

run this in vscode powershell extension host

$a=[System.Collections.ArrayList]@()
Add-Member -InputObject $a -MemberType ScriptMethod -Name Pop -Value {
	$value = $this[$this.Count-1]
	$this.RemoveAt($this.Count-1)
	$value
}
Register-EngineEvent PowerShell.OnIdle -Action {
	if($a.Count -gt 0) {
		$a.Pop().Invoke()
	}
}

then wait.

Visuals

图片

Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked issue #4837, then run the provided PowerShell reproduction in the VS Code PowerShell extension host and wait for the error. Use the reported PowerShell, VS Code, and extension versions when comparing behavior; done means the profile can be used without the reported PSReadLine error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.