Skip to content
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

PowerShell Integrated Console Does Not Work in Constrained Language Mode [needs test] #3484

Closed
3 of 4 tasks
My-Random-Thoughts opened this issue Jul 28, 2021 · 7 comments · Fixed by PowerShell/PowerShellEditorServices#2055
Assignees
Labels
Area-Engine Issue-Bug A bug to squash.

Comments

@My-Random-Thoughts
Copy link

My-Random-Thoughts commented Jul 28, 2021

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.

Summary

When in ConstrainedLanguage mode the PowerShell integrated console does not load correctly. All I get is the title message: =====> PowerShell Integrated Console v2021.6.2 <=====

This affects both x32 and x64 terminals.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      5.1.18362.1593
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.18362.1593
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Visual Studio Code Version

`code --version` does not return any output

Version: 1.58.2 (user setup)
Commit: c3f126316369cd610563c75b1b1725e0679adfb3
Date: 2021-07-14T22:10:15.214Z (1 wk ago)
Electron: 12.0.13
Chrome: 89.0.4389.128
Node.js: 14.16.0
V8: 8.9.255.25-electron.0
OS: Windows_NT x64 10.0.18363

Extension Version

ms-vscode.powershell@2021.5.1
`code --{anything}` does not produce any output

PowerShell v2021.6.2 is installed

Steps to Reproduce

Open VSCode,
Create New PowerShell Document,
Integrated Terminal should open automatically if configured
Wait until the heat-death of the universe for it to complete opening

My settings file contains only the following configured terminals:

    "terminal.integrated.profiles.windows":{
        "PowerShell": {
            "source": "PowerShell",
            "icon": "terminal-powershell"
        },
    },
    "terminal.integrated.defaultProfile.windows": "PowerShell",

Visuals

No response

Logs

Logs.zip

@My-Random-Thoughts My-Random-Thoughts added the Issue-Bug A bug to squash. label Jul 28, 2021
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jul 28, 2021
@andyleejordan
Copy link
Member

Unfortunately we don't currently have extensive tests for Constrained Language Mode compatibility, so while this feature was at one point implemented, we have no way to guarantee that it will continue to work. We will need to work on our side to add sufficient testing so that we can both get the feature working again and then assert (with some amount of confidence) that it'll continue to work. I'm sorry 😢

@andyleejordan andyleejordan added Area-Engine and removed Needs: Triage Maintainer attention needed! labels Aug 3, 2021
@andyleejordan andyleejordan added this to the Consider-vNext milestone Aug 3, 2021
@andyleejordan andyleejordan moved this from Todo to Wishlist in American Pharoah Aug 3, 2022
@SydneyhSmith SydneyhSmith removed this from the Consider-vNext milestone Aug 9, 2022
@My-Random-Thoughts
Copy link
Author

Is there any update on when this may get fixed? I am still using the ISE because of this issue.

@andyleejordan
Copy link
Member

We are currently targeting CLM support in March.

@andyleejordan andyleejordan self-assigned this Feb 9, 2023
@SydneyhSmith SydneyhSmith moved this to Todo in Flying Fox Mar 7, 2023
@andyleejordan
Copy link
Member

Hi there, I tested this out today and it appears now to be functional! I put $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage" in my VS Code PowerShell Profile, started the extension, and then in the (functional!) Extension Terminal verified it was set correctly:

PowerShell Extension v2023.5.1
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.

@andys-mac-mini ~/src/vscode-powershell main ≡ +0 ~1 -0 !
> $ExecutionContext.SessionState.LanguageMode                                                                          
ConstrainedLanguage

I then opened a PowerShell script and confirmed that completions and references were working, and was able to start the debugger.

Please let me know if there's anything in particular still broken, but I believe this is resolved!

@andyleejordan andyleejordan moved this from Todo to Done in Flying Fox May 16, 2023
@andyleejordan andyleejordan added Resolution-Fixed Will close automatically. and removed Resolution-Fixed Will close automatically. labels May 16, 2023
@andyleejordan andyleejordan moved this from Done to In Progress in Flying Fox May 16, 2023
@andyleejordan
Copy link
Member

I'm going to leave this open and "In Progress" until I write some unit tests to continue to verify the above.

@SydneyhSmith SydneyhSmith changed the title PowerShell Integrated Console Does Not Work in Constrained Language Mode PowerShell Integrated Console Does Not Work in Constrained Language Mode [needs test] Aug 15, 2023
@andyleejordan
Copy link
Member

Ok, we still have tests...I'm not certain they're running in CI since they require admin. Working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Engine Issue-Bug A bug to squash.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants