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

Support New VS Code Shell Integration Feature #3901

Closed
2 tasks done
juvtib opened this issue Mar 31, 2022 · 10 comments · Fixed by PowerShell/PowerShellEditorServices#1958
Closed
2 tasks done

Support New VS Code Shell Integration Feature #3901

juvtib opened this issue Mar 31, 2022 · 10 comments · Fixed by PowerShell/PowerShellEditorServices#1958
Assignees
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.

Comments

@juvtib
Copy link

juvtib commented Mar 31, 2022

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all issues to ensure it has not already been reported.

Summary

VS Code introduced the shell integration feature in January. When the PowerShell extension launches its Integrated Console, the shell integration is not launched with it. It is not obvious if or how to manually launch the new feature.

Please respect the terminal.integrated.shellIntegration.enabled setting. And allow the new VS Code feature to work with the terminal launched by the PowerShell extension.

Proposed Design

No response

@juvtib juvtib added the Issue-Enhancement A feature request (enhancement). label Mar 31, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label Mar 31, 2022
@JustinGrote
Copy link
Collaborator

It's still an experimental feature:
https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration

So it's unlikely to be the default, however we could look into adding a feature flag for it. The PSIC is not a normal integrated terminal so I'm not sure if there will be related regressions or something to tell vscode to flag the PSIC as an "integrated" terminal.

@JustinGrote JustinGrote added Area-Extension Terminal Up for Grabs Will shepherd PRs. and removed Needs: Triage Maintainer attention needed! labels Mar 31, 2022
@juvtib
Copy link
Author

juvtib commented Apr 1, 2022

I was going through my PowerShell logs and found shellIntegration.ps1 dot sourced. This must be from when VS Code starts.

Note I use PowerShell and VS Code as snaps on Linux.

. "/var/lib/snapd/snap/code/92/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1"

If I manually run

. "/var/lib/snapd/snap/code/current/usr/share/code/resources/app/out/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1"

in the PowerShell extension's integrated console, it appears to work:

@JustinGrote
Copy link
Collaborator

I noticed in the documentation they said they shim in a .ps1, so that wouldn't be that hard to just add a setting to call it if that's all it is, not sure if there's more to it though.

@juvtib
Copy link
Author

juvtib commented Apr 1, 2022

Are extensions able to read the preferences for VS Code? Or is there some benefit to creating a new preference besides terminal.integrated.shellIntegration.enabled?

@JustinGrote
Copy link
Collaborator

There are cases where you might want it for your integrated terminal but not PSIC, but yes, extensions can read settings and it would probably be gated behind both these settings, e.g.

powershell.enableShellIntegration and terminal.integrated.shellIntegration.enabled would both have to be specified in order for it to inject the .ps1 (or whatever else is required for shell integration)

@danielniccoli
Copy link

danielniccoli commented Aug 11, 2022

It's still an experimental feature: https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration

So it's unlikely to be the default, however we could look into adding a feature flag for it. The PSIC is not a normal integrated terminal so I'm not sure if there will be related regressions or something to tell vscode to flag the PSIC as an "integrated" terminal.

Shell integration is now enabled by default

@andyleejordan andyleejordan self-assigned this Aug 11, 2022
@andyleejordan
Copy link
Member

We are working on this actively!

@juvtib
Copy link
Author

juvtib commented Nov 21, 2022

Thanks for addressing this issue. I'm not sure how PowerShell Editor Services is integrated into the PowerShell extension and VS Code. How will I know when this feature makes it to VS Code or the Insiders edition?

@JustinGrote
Copy link
Collaborator

@juvtib PSES is basically the LSP for the plugin. If this has been committed to PSES I would expect to see it in the next preview release of the PowerShell extension which comes out pretty regularly.

@andyleejordan
Copy link
Member

Like today is the plan lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Extension Terminal Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs.
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants