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

Test: Shell Integration API #226655

Closed
3 tasks done
Tyriar opened this issue Aug 26, 2024 · 7 comments
Closed
3 tasks done

Test: Shell Integration API #226655

Tyriar opened this issue Aug 26, 2024 · 7 comments

Comments

@Tyriar
Copy link
Member

Tyriar commented Aug 26, 2024

Refs: #145234

Complexity: 5

Create Issue


The Terminal.shellIntegration API has been finalized this iteration. To test this:

  1. Clone and open the extension sample https://github.com/microsoft/vscode-extension-samples/tree/main/shell-integration-sample
  2. Test to make sure the extension functionality works - open the custom profile via the dropdown on the terminal:
    image
  3. Explore the API and its docs. Here are the entry points: Terminal.shellIntegration, onDidChangeTerminalShellIntegration, onDidStartTerminalShellExecution, onDidEndTerminalShellExecution
  4. Exercise other functionality of the API, the sample only uses onDidChangeTerminalShellIntegration and executeCommand(string, string[])
@dbaeumer
Copy link
Member

dbaeumer commented Aug 27, 2024

@Tyriar I tried for one hour to get shell integration work for me on my Windows machine but no luck. Whatever I do, I never received any onDidChangeTerminalShellIntegration events, so the sample never worked. Here is what I tried:

Any hint on how to enable this

@dbaeumer
Copy link
Member

For some reason the shell integration script never gets loaded. When I execute __VSCode-Escape-Value I always get

__VSCode-Escape-Value: The term '__VSCode-Escape-Value' is not recognized as a name of a cmd
let, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct a
nd try again.

@dbaeumer
Copy link
Member

This even happens when I do the following:

  • run . "$(code-insiders --locate-shell-integration-path pwsh)" in PowerShell
  • ensure __VSCode-Escape-Value is there
  • start code-insiders from that shell.

@Tyriar
Copy link
Member Author

Tyriar commented Aug 27, 2024

@dbaeumer sounds like it should be working with that setup. Try installing pwsh 7 and using that if you haven't, Windows PowerShell (5) which is shipped with Windows should work but maybe that's why?

@dbaeumer
Copy link
Member

@Tyriar I use pwsh 7.4.5. Anything I can do (logging) to find out why it is not working?

@Tyriar
Copy link
Member Author

Tyriar commented Aug 27, 2024

@dbaeumer when you hover the tab you should see a long command line like this:

image

Make sure you don't have terminal.integrated.windowsEnableConpty set.

If that doesn't help enable a trace log and check the pty host output channel when you create a terminal. You should see a [trace] [RPC Request] PtyService#createProcess log which will have some config associated with it like this:

{"shellIntegration":{"enabled":true,"suggestEnabled":true,"nonce":"80e12edd-a671-4229-a4b9-028ae4b8f609"},"windowsEnableConpty":true,"windowsUseConptyDll":true,"environmentVariableCollections", ...

That would be helpful

@meganrogge
Copy link
Contributor

Cool 👏 , I think this will be powerful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants
@dbaeumer @Tyriar @meganrogge @justschen and others