Skip to content

Removing/unloading PSReadline in profile causes endless errors #1395

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
MartinSGill opened this issue Nov 26, 2020 · 2 comments
Closed

Removing/unloading PSReadline in profile causes endless errors #1395

MartinSGill opened this issue Nov 26, 2020 · 2 comments
Labels
Resolution-Answered Will close automatically.

Comments

@MartinSGill
Copy link
Contributor

Issue migrated from PSReadline repo. cf. PowerShell/PSReadLine#1967

Quoted From: PowerShell/PSReadLine#1967 (comment)

I did some more digging and I'm not sure this qualifies as a bug anymore, at least not one against PSReadline, although it might still be a bug against vscode-powershell.

From the days before VSCode supported PSReadline I had a condition in my profile to remove-module PSReadline -Force if the profile wasn't running in ConsoleHost. I never even realized that this still existed as PSReadline was happily working in VSCode.

Interestingly calling Remove-Module PSReadline -Force from the integrated terminal after my profile has loaded works without issue. It's just when I do it from my profile that it breaks.

I suspect that the vscode-powershell integration with PSReadline has a custom handler for unloading psreadline that doesn't work correctly if PSReadline is unloaded by the profile.

Not sure if that qualifies as a bug or not, truthfully.

Steps to reproduce:

  • Create profile that calls Remove-Module PSReadline -Force
  • Ensure "load profile" option is enabled for integrated terminal
  • Start an integrated terminal (e.g. by opening a powershell file)
  • Observe error

Environment

PSReadLine: 2.2.0-beta1
PowerShell: 2020.6.0
OS: Microsoft Windows 10.0.19042
BufferWidth: 128
BufferHeight: 12

VSCode:

Version: 1.51.1 (system setup)
Commit: e5a624b788d92b8d34d1392e4c4d9789406efe8f
Date: 2020-11-10T23:34:32.027Z
Electron: 9.3.3
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042

Powershell:

Name                           Value
----                           -----
PSVersion                      7.1.0
PSEdition                      Core
GitCommitId                    7.1.0
OS                             Microsoft Windows 10.0.19042
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
@ghost ghost added the Needs: Triage Maintainer attention needed! label Nov 26, 2020
@SydneyhSmith
Copy link
Collaborator

Thanks @MartinSGill this error likely occurs because we load the profile just before the integrated console has loaded...this may inadvertently be changed by #1295

@SydneyhSmith SydneyhSmith added Resolution-Answered Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Mar 23, 2021
@ghost ghost closed this as completed Feb 4, 2022
@ghost
Copy link

ghost commented Feb 4, 2022

This issue has been marked as answered and has not had any activity in a day. It has been automatically closed for housekeeping purposes.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Answered Will close automatically.
Projects
None yet
Development

No branches or pull requests

2 participants