Repository: vscode
Issue: Terminal panel overwrites `terminalEditorActive` context key when a terminal editor is present
Labels: bug,help wanted,confirmed,terminal-editors

Type: <b>Bug</b>

The scenario I'm looking at is a terminal in both an editor and the panel.
![image](https://github.com/microsoft/vscode/assets/484784/2007836b-078e-438d-85c2-2113aa296ec5)

In this scenario `terminalEditorActive` changes based on which terminal is focused, but it should always be true.

When the terminal editor is focused I see these context keys
```
// From the terminal panel
"panelFocus": false,
"activePanel": "terminal",
"focusedView": "",

// From the terminal editor
"activeEditor": "terminalEditor",
"terminalEditorActive": true,
"terminalEditorFocus": true,
```

When the terminal panel is focused I see these context keys
```
// From the terminal panel
"panelFocus": true,
"activePanel": "terminal",
"focusedView": "terminal",

// From the terminal editor
"activeEditor": "terminalEditor",
"terminalEditorActive": false, // Should be true, but focusing the panel has overwritten it
"terminalEditorFocus": false,
```

We end up in a weird state where the activeEditor is "terminalEditor" yet terminalEditorActive is false.

Ref: https://github.com/microsoft/vscode/issues/173240

VS Code version: Code - Insiders 1.79.0-insider (2d416df5f00253f5ebd60d2f08508a440747fd8d, 2023-05-19T05:25:00.632Z)
OS version: Windows_NT x64 10.0.19045
Modes:

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen Threadripper PRO 3945WX 12-Cores      (24 x 3993)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<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>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled|
|Load (avg)|undefined|
|Memory (System)|63.86GB (35.24GB free)|
|Process Argv|--crash-reporter-id 2860e056-a3df-4573-a10a-18ca229997c6|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (1)</summary>

Extension|Author (truncated)|Version
---|---|---
akbyrd-vsc-extension|akb|0.8.1


</details><details>
<summary>A/B Experiments</summary>

```
vsliv695:30137379
vsins829:30139715
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
pythontb:30258533
pythonptprofiler:30281269
vshan820:30294714
vscod805cf:30301675
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593:30376534
pythonvs932:30404738
cppdebug:30492333
vscaat:30438846
vsclangdf:30492506
c4g48928:30535728
dsvsc012:30540252
pynewext54:30618038
pylantcb52:30590116
pyind779:30611226
pythonsymbol12:30651887
a9j8j154:30646983
showlangstatbar:30737417
pythonms35:30671666
j16hj152:30680472
ecj1e332:30687743
pythonfmttext:30716741
pythoncmvfstr:30726892
fixhidewlkth:30724384
showsbindicator:30724477
pythongtdpath:30726887

```

</details>

<!-- generated by issue reporter -->