Repository: vscode
Issue: Restored terminals in editor area don't restore the current working directory from the previous session.
Labels: bug,help wanted,remote,terminal-editors


Type: <b>Bug</b>

- Ensure `"terminal.integrated.defaultLocation": "editor"` is set.
- Open Remote SSH session (I'm not sure whether this is actually required or not, but I use VS Code with Remote sessions exclusively)
- Choose `Terminal: Create New Terminal (With Profile)`, select the appropriate profile and confirm.
- Restart VS Code
- Observe a terminal will be restored in the editor area but in my case it's using the "bash" profile rather than the profile that I chose earlier.

VS Code version: Code 1.81.1 (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:40:25.698Z)
OS version: Darwin arm64 21.6.0
Modes:
Connection to 'SSH: homer.kelman.com' could not be established  Canceled
Remote OS version: Linux x64 4.18.0-477.13.1.el8_8.x86_64

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Apple M1 (8 x 24)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|2, 2, 2|
|Memory (System)|16.00GB (0.08GB free)|
|Process Argv|--crash-reporter-id 4abd401a-b2b8-4d50-b481-1e179f7002ef|
|Screen Reader|no|
|VM|0%|

Connection to 'SSH: homer.kelman.com' could not be established  Canceled

|Item|Value|
|---|---|
|Remote|SSH: cal-devel21|
|OS|Linux x64 4.18.0-477.13.1.el8_8.x86_64|
|CPUs|12th Gen Intel(R) Core(TM) i7-12700 (20 x 2100)|
|Memory (System)|30.84GB (23.91GB free)|
|VM|0%|
</details><details><summary>Extensions (35)</summary>

Extension|Author (truncated)|Version
---|---|---
Bookmarks|ale|13.4.1
FreeMarker|dco|0.0.9
vscode-position|jtr|1.1.2
jupyter-keymap|ms-|1.1.2
remote-containers|ms-|0.304.0
remote-ssh|ms-|0.102.0
remote-ssh-edit|ms-|0.86.0
remote-wsl|ms-|0.81.0
vscode-remote-extensionpack|ms-|0.24.0
remote-explorer|ms-|0.4.1
remote-server|ms-|1.4.0
open-in-browser|tec|2.0.0
asciidoctor-vscode|asc|3.1.3
atlascode|atl|3.0.4
gitlens|eam|14.2.1
jbang-vscode|jba|0.7.0
vscode-position|jtr|1.1.2
vscode-docker|ms-|1.26.0
fabric8-analytics|red|0.3.10
java|red|1.21.0
vscode-commons|red|0.0.6
vscode-rsp-ui|red|0.24.8
vscode-server-connector|red|0.26.12
vscode-xml|red|0.26.1
vscode-yaml|red|1.14.0
LiveServer|rit|5.7.9
intellicode-api-usage-examples|Vis|0.2.7
vscodeintellicode|Vis|1.2.30
vscode-gradle|vsc|3.12.7
vscode-java-debug|vsc|0.53.0
vscode-java-dependency|vsc|0.23.1
vscode-java-pack|vsc|0.25.13
vscode-java-test|vsc|0.39.1
vscode-maven|vsc|0.42.0
vscode-proto3|zxh|0.5.5


</details><details>
<summary>A/B Experiments</summary>

```
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
vscccc:30803845
282f8724:30602487
89544117:30613380
a9j8j154:30646983
showlangstatbar:30737416
03d35959:30757346
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
gsofb:30804716
pythonnosmt12:30797651
pythonidxpt:30805730
pythonnoceb:30805159
dsvsc013:30795093
dsvsc014:30804076
diffeditorv2:30812749

```

</details>

<!-- generated by issue reporter -->