You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support PowerShell intellisense in the terminal #154662
I have enabled both terminal.integrated.shellIntegration.suggestEnabled and terminal.integrated.shellIntegration.enabled - shell integration works fine but I don't get any suggestions at all.
@alessandro-newzoo it will only work on the latest insiders build released today, just setting that should make it work. It's triggered by typing - currently.
Here's roughly how it works:
terminal.integrated.shellIntegration.suggestEnabled sets $VSCODE_SUGGEST to 1:
Some vscode-side keybindings send custom sequences to pwsh which are understood by the key handlers (this ctrl+space keybinding seems to have broken somehow since I initially added it:
@alessandro-newzoo it will only work on the latest insiders build released today, just setting that should make it work. It's triggered by typing - currently.
Here's roughly how it works:
terminal.integrated.shellIntegration.suggestEnabled sets $VSCODE_SUGGEST to 1:
Some vscode-side keybindings send custom sequences to pwsh which are understood by the key handlers (this ctrl+space keybinding seems to have broken somehow since I initially added it:
The completions are fed into a suggest widget derived from the editor's intellisense widget.
oh okay I see, thank you so much for the thorough explaination!
Weird that this setting terminal.integrated.shellIntegration.suggestEnabled has been there in Stable for so long then, why is it even there?
Curious if after #210289 we could enable is by default in Insiders? I've been using it for the past few weeks and haven't found any other issues. Thoughts? Daniel Imms (@Tyriar)
@alessandro-newzoo sorry about the slow response, but it's been available as an experimental setting for some time but I was pulled off the project to work on some other things. In retrospect it should have remained as an Insiders-only setting back then, but now thanks to cpendery (@cpendery)'s work it's becoming more reliable.
cpendery (@cpendery) I switched it on and it still had some problems where it would brick input where you could not interact with the suggest widget or the terminal and not close it. Not sure if that's been fixed yet but that's why it was switched off. I've got it enabled now and I was seeing that problem so hopefully I'll hit it again and be able to diagnose.
It's also not clear if we will have it enabled by default in the future and it might be too disruptive for users to enable it in Insiders. I want suggest to be available as a discoverable option but not necessarily the default experience. The best next step to get more self-hosting will probably be to enable it in the vscode repo, I'll try get some testing in over the next week and we can maybe create a test plan item to get some new eyes on it for this release.
Activity
6 remaining items
Tyriar commentedon Dec 5, 2023
cpendery (@cpendery) has started some contributions in this area so we can start testing this again 👏
With
"terminal.integrated.shellIntegration.suggestEnabled": trueset in the latest build off main (landing in Insiders after the upcoming release):x-xyzxyz commentedon Dec 8, 2023
Daniel Imms (@Tyriar) How exactly does this work? I have found zero documentation available about this, and if I google terminal.integrated.shellIntegration.suggestEnabled pretty much nothing comes up?
I have enabled both
terminal.integrated.shellIntegration.suggestEnabledandterminal.integrated.shellIntegration.enabled- shell integration works fine but I don't get any suggestions at all.Tyriar commentedon Dec 8, 2023
@alessandro-newzoo it will only work on the latest insiders build released today, just setting that should make it work. It's triggered by typing
-currently.Here's roughly how it works:
terminal.integrated.shellIntegration.suggestEnabledsets$VSCODE_SUGGESTto 1:vscode/src/vs/platform/terminal/node/terminalEnvironment.ts
Lines 149 to 151 in faacc5f
That's read by shell integration and enabled some special pwsh key handlers, including for the
-key:vscode/src/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1
Lines 156 to 157 in faacc5f
Some vscode-side keybindings send custom sequences to pwsh which are understood by the key handlers (this ctrl+space keybinding seems to have broken somehow since I initially added it:
vscode/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts
Lines 204 to 208 in faacc5f
When suggest is triggered, we trigger
TabExpansion2and form a custom vscode escape sequence:vscode/src/vs/workbench/contrib/terminal/browser/media/shellIntegration.ps1
Lines 183 to 205 in faacc5f
This is handled by vscode here:
vscode/src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalSuggestAddon.ts
Lines 123 to 125 in faacc5f
The completions are fed into a suggest widget derived from the editor's intellisense widget.
x-xyzxyz commentedon Dec 11, 2023
oh okay I see, thank you so much for the thorough explaination!
Weird that this setting
terminal.integrated.shellIntegration.suggestEnabledhas been there in Stable for so long then, why is it even there?cpendery commentedon Apr 13, 2024
Curious if after #210289 we could enable is by default in Insiders? I've been using it for the past few weeks and haven't found any other issues. Thoughts? Daniel Imms (@Tyriar)
Tyriar commentedon Apr 15, 2024
@alessandro-newzoo sorry about the slow response, but it's been available as an experimental setting for some time but I was pulled off the project to work on some other things. In retrospect it should have remained as an Insiders-only setting back then, but now thanks to cpendery (@cpendery)'s work it's becoming more reliable.
cpendery (@cpendery) I switched it on and it still had some problems where it would brick input where you could not interact with the suggest widget or the terminal and not close it. Not sure if that's been fixed yet but that's why it was switched off. I've got it enabled now and I was seeing that problem so hopefully I'll hit it again and be able to diagnose.
It's also not clear if we will have it enabled by default in the future and it might be too disruptive for users to enable it in Insiders. I want suggest to be available as a discoverable option but not necessarily the default experience. The best next step to get more self-hosting will probably be to enable it in the vscode repo, I'll try get some testing in over the next week and we can maybe create a test plan item to get some new eyes on it for this release.
Tyriar commentedon Apr 15, 2024
Created a test plan item: #210394
Tyriar commentedon Apr 25, 2024
A lot of good feedback from testing: https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Aterminal-suggest
shellIntegration.suggestEnabled -> suggest.enabled
Tyriar commentedon Dec 10, 2024
Closing this as we will be moving away from the pwsh native approach and instead going for the
terminal-suggestbuilt-in extension to provide completions. See #226562, https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+label%3Aterminal-suggest