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

Can't open external terminals by default from a WSL session in VS Code #167865

Open
Tyriar opened this issue Dec 1, 2022 · 9 comments
Open

Can't open external terminals by default from a WSL session in VS Code #167865

Tyriar opened this issue Dec 1, 2022 · 9 comments
Assignees
Labels
feature-request Request for new features or functionality terminal Integrated terminal issues WSL Issue when using WSL
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Dec 1, 2022

When debugging using an external terminal from WSL you see this:

MicrosoftTeams-image

It ends up calling the Linux exec setting:

MicrosoftTeams-image (1)

Ref:

Is there some way we can route WSL debug requests to a local external terminal? @aeschli thoughts on this? Do you think this should be handled somehow in the WSL extension? Feels like the a soft layer breaker if it goes into core.

cc @shanselman

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority terminal Integrated terminal issues WSL Issue when using WSL labels Dec 1, 2022
@Tyriar Tyriar added this to the December 2022 milestone Dec 1, 2022
@roblourens
Copy link
Member

roblourens commented Dec 2, 2022

In the Slack thread, @aeschli pointed out the WSL_DISTRO_NAME environment var. I think it doesn't feel too bad just for us to read that to determine that the remote EH is inside WSL

@connor4312 connor4312 removed their assignment Dec 5, 2022
@connor4312
Copy link
Member

microsoft/vscode-remote-release#45 is related as well. Maybe we have something generic in for remotes in core?

@aeschli
Copy link
Contributor

aeschli commented Dec 19, 2022

If there's a contribution point or a env variable I can set in the WSL extension. That would be the cleanest way.

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2023

Unassigning Rob again, I think I'm doing all the work here, just might need a review/help from others.

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2023

Debugging with Windows Terminal also doesn't seem to work when these are set:

  "terminal.external.windowsExec": "wt",
  "terminal.external.windowsExec": "wt.exe",

image

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2023

We explicitly support spawning a terminal:

// Add starting directory parameter for Windows Terminal (see #90734)
if (basename === 'wt' || basename === 'wt.exe') {
cmdArgs.push('-d .');
}

Not debug's runInTerminal:

return new Promise<number | undefined>((resolve, reject) => {
const title = `"${dir} - ${TERMINAL_TITLE}"`;
const command = `""${args.join('" "')}" & pause"`; // use '|' to only pause on non-zero exit code
const cmdArgs = [
'/c', 'start', title, '/wait', exec, '/c', command
];

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2023

I don't think it's possible to use wt properly based on --help, no /c, no --wait 🤔

image

@Tyriar
Copy link
Member Author

Tyriar commented Jan 11, 2023

Actually /c is SUBCOMMAND, eg. wt "cmd.exe"

@Tyriar Tyriar modified the milestones: January 2023, February 2023 Jan 23, 2023
@meganrogge meganrogge modified the milestones: February 2023, March 2023 Feb 17, 2023
@Tyriar Tyriar modified the milestones: March 2023, April 2023 Mar 20, 2023
@meganrogge meganrogge modified the milestones: April 2023, On Deck Apr 5, 2023
@Tyriar Tyriar removed the important Issue identified as high-priority label Oct 3, 2023
@Tyriar Tyriar modified the milestones: On Deck, Backlog Oct 3, 2023
@gregg-miskelly
Copy link
Member

gregg-miskelly commented Oct 20, 2023

I very similar issue exists for Codespaces where the runInTerminal request will fail, and it isn't obvious to users that that is the problem. Would you like me to open a new issue? Or would this issue track all remoting scenarios?

CC @timheuer who reported this to me

@Tyriar Tyriar added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality terminal Integrated terminal issues WSL Issue when using WSL
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants