Repository: vscode
Issue: Cannot set working directory when opening a new terminal
Labels: bug,WSL,terminal-process

Type: <b>Bug</b>

When using WSL in a multi-root workspace, the prompt appears to ask for the working directory, however the terminal opens in the home directory of the WSL VM.

Steps to replicate:
  1. Set up a WSL remote in VSCode
  2. Set up a multi-root workspace (e.g. workspace/folder1 and workspace/folder2)
  3. Click on Terminal -> New Terminal
  4. In the dropdown that appears, try to select a working directory

Expected result:
Terminal opens in the select working directory

Actual result:
Terminal opens in the home directory

![image](https://github.com/user-attachments/assets/bbc42be8-880a-4fa9-a1c7-2e67acdbad1b)

![image](https://github.com/user-attachments/assets/b04cec7d-68c6-4372-83b9-199462f842c1)


VS Code version: Code 1.94.0 (d78a74bcdfad14d5d3b1b782f87255d802b57511, 2024-10-02T13:08:12.626Z)
OS version: Windows_NT x64 10.0.19045
Modes:
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.153.1-microsoft-standard-WSL2

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 2304)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: enabled_on<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_graphite: disabled_off<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|63.71GB (39.07GB free)|
|Process Argv|--crash-reporter-id f0e14b48-154b-4bf9-8893-d28f8e8425e7|
|Screen Reader|no|
|VM|0%|

|Item|Value|
|---|---|
|Remote|WSL: Debian|
|OS|Linux x64 5.15.153.1-microsoft-standard-WSL2|
|CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 0)|
|Memory (System)|31.20GB (28.62GB free)|
|VM|0%|

|Item|Value|
|---|---|
|Remote|WSL: Debian|
|OS|Linux x64 5.15.153.1-microsoft-standard-WSL2|
|CPUs|Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz (16 x 0)|
|Memory (System)|31.20GB (28.62GB free)|
|VM|0%|
</details><details><summary>Extensions (16)</summary>

Extension|Author (truncated)|Version
---|---|---
vscode-neovim|asv|1.18.12
remote-ssh|ms-|0.114.3
remote-ssh-edit|ms-|0.87.0
remote-wsl|ms-|0.88.4
remote-explorer|ms-|0.4.3
githistory|don|0.6.20
xml|Dot|2.5.1
go|gol|0.42.1
rainbow-csv|mec|3.12.0
vscode-docker|ms-|1.29.3
makefile-tools|ms-|0.11.13
sqltools|mtx|0.28.3
sqltools-driver-pg|mtx|0.5.4
vscode-yaml|red|1.15.0
twinny|rjm|3.17.20
shellcheck|tim|0.37.1


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementst:30995554
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
g316j359:31013175
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
2f103344:31071589
impr_priority:31102340
nativerepl2:31139839
refactort:31108082
pythonrstrctxt:31112756
flighttreat:31134774
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
autoexpandse:31146404
iacca2:31150323
5fd0e150:31146321

```

</details>

<!-- generated by issue reporter -->