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

Windows Terminal as external fails to open wsl terminal as default #159430

Closed
umagon opened this issue Aug 29, 2022 · 9 comments
Closed

Windows Terminal as external fails to open wsl terminal as default #159430

umagon opened this issue Aug 29, 2022 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member info-needed Issue requires more information from poster terminal-external WSL Issue when using WSL

Comments

@umagon
Copy link

umagon commented Aug 29, 2022

Type: Bug

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.70.2
  • OS Version: Windows 11

Steps to Reproduce:

  1. Install windows terminal extension
  2. Install Windows Terminal app.
  3. Set in your settings.json:
    "terminal.explorerKind": "external",
    "terminal.external.windowsExec": "wt"
  1. Configure in Windows Terminal to open default terminal "Ubuntu" (WSL).
  2. Go to VS Code and press Ctrl+Shift+C to open external terminal. Output:
    image

What I would expect to happen is to open like this, in the current ${workspaceDirectory}:
image

Extension version: 0.7.0
VS Code version: Code 1.70.2 (e4503b3, 2022-08-16T05:35:13.448Z)
OS version: Windows_NT x64 10.0.22000
Modes:
Remote OS version: Linux x64 5.10.102.1-microsoft-standard-WSL2

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 11.79GB (1.70GB free)
Process Argv --crash-reporter-id bebcbdab-92ab-48c1-81d1-99b63faaf89c
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu
OS Linux x64 5.10.102.1-microsoft-standard-WSL2
CPUs 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz (8 x 2419)
Memory (System) 5.69GB (4.63GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonvspyt551:30345470
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
wslgetstarted:30449410
cppdebug:30492333
pylanb8912:30545647
vsclangdf:30486550
c4g48928:30535728
hb751961:30553087
dsvsc012cf:30540253
azure-dev_surveyone:30548225
i497e931:30552240

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug WSL Issue when using WSL confirmed Issue has been confirmed by VS Code Team member and removed confirmation-pending labels Dec 5, 2022
@Tyriar
Copy link
Member

Tyriar commented Dec 7, 2022

I can reproduce this, we run wsl -d . where the cwd is set to the current workspace directory.

image

@zadjii-msft this seems like an issue on the Windows Terminal side of not correctly passing over the cwd in the right format to wsl, should we move this into microsoft/terminal?

@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 15, 2022
@zadjii-msft
Copy link
Member

Sorry for the late reply.

I'm pretty sure wsl -d . would never work. The -d option to wsl.exe specified the Distro that you want to run, not the CWD to use.

Usage: wsl.exe [Argument] [Options...] [CommandLine]

Arguments for running Linux binaries:

    If no command line is provided, wsl.exe launches the default shell.

    --exec, -e <CommandLine>
        Execute the specified command without using the default Linux shell.

    --
        Pass the remaining command line as is.

Options:
    --cd <Directory>
        Sets the specified directory as the current working directory.
        If ~ is used the Linux user's home path will be used. If the path begins
        with a / character, it will be interpreted as an absolute Linux path.
        Otherwise, the value must be an absolute Windows path.

    --distribution, -d <Distro>
        Run the specified distribution.

(FWIW I think the --cd option was only added later in Windows 10, and it wasn't publicly documented till VERY recently. I think with the Store-delivered WSL, that option will always be there, regardless of OS version... but all this kinda feels off topic.)

wt -d . -- wsl.exe, on the other hand, now that'll run into the same thing that's tracked in #147585 & microsoft/terminal#5506

@Tyriar
Copy link
Member

Tyriar commented Dec 15, 2022

@zadjii-msft oh I actually made a typo, we do wt -d . and if the default profile is wsl it gives that error. #147585 just opened the wrong directory not errored out like this, do you still think it's the same as that issue?

@umagon
Copy link
Author

umagon commented Dec 22, 2022

The bot closed this issue, but it should be open, right?

@Tyriar Tyriar reopened this Dec 23, 2022
@Tyriar
Copy link
Member

Tyriar commented Dec 23, 2022

Ping @zadjii-msft

@vscodenpa
Copy link

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@vscodenpa vscodenpa closed this as not planned Won't fix, can't repro, duplicate, stale Dec 30, 2022
@umagon
Copy link
Author

umagon commented Dec 31, 2022

The bot keeps closing it. :( @Tyriar is it because of the info-needed tag? Is this tag for me or for @zadjii-msft ?

@zadjii-msft
Copy link
Member

zadjii-msft commented Jan 3, 2023

Sorry bout that - I was out for the holidays. Curious to dig into this. Something's clearly messed up with this.

image

Since this repros outside of VsCode, I'll file a follow-up on the Terminal repo to dig into this. I can't find anything immediately on the backlog that matches this. (microsoft/terminal#14625)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug confirmed Issue has been confirmed by VS Code Team member info-needed Issue requires more information from poster terminal-external WSL Issue when using WSL
Projects
None yet
Development

No branches or pull requests

5 participants