Repository: vscode
Issue: `terminal.shellIntegration.executeCommand` doesn't execute the command in new shells in Powershell 7 on macOS
Labels: bug,terminal-shell-pwsh


Type: <b>Bug</b>

### Steps to reproduce

1. Set PowerShell 7 as default shell in VS Code for Mac. In my case I installed Powershell 7 with Homebrew
```jsonc
// settings.json
{
    "terminal.integrated.defaultProfile.osx": "pwsh",
}
```
2. Create a simple project to launch it, like a node project:
```javascript
// index.js
import http from 'http';

const server = http.createServer((req, res) => {
    res.writeHead(200, { 'Content-Type': 'text/plain' });
    res.end('Hello, World!');
});

server.listen(3000, () => {
    console.log('Server running at http://localhost:3000');
});
```
3. Add a launch.json to start the program:
```jsonc
// .vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Program",
            "command": "node ./index.js",
            "request": "launch",
            "type": "node-terminal"
        },
    ]
}
```

4. Launch the program (F5) and see.

### Result

It doesn't start unless you click Enter in the terminal

https://github.com/user-attachments/assets/e292490c-684d-43c6-a014-f23ffcdb1f51

### Extra info

If you change the default terminal to bash or other shell, it works fine and starts immediately.

https://github.com/user-attachments/assets/b20f6d13-7281-44ff-b864-7f59bbd0b50b

It works fine in Windows

VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Darwin arm64 24.1.0
Modes:

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

|Item|Value|
|---|---|
|CPUs|Apple M3 (8 x 2400)|
|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>webgl: enabled<br>webgl2: enabled<br>webgpu: enabled<br>webnn: disabled_off|
|Load (avg)|3, 3, 4|
|Memory (System)|8.00GB (0.12GB free)|
|Process Argv|./source/mt/mediotiempo-web/ --crash-reporter-id 47cfacf9-941c-410d-9458-3633353a7a87|
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (27)</summary>

Extension|Author (truncated)|Version
---|---|---
better-comments|aar|3.0.2
vscode-nginx-conf|ahm|0.3.5
aws-toolkit-vscode|ama|3.37.0
astro-vscode|ast|2.15.4
vscode-tailwindcss|bra|0.12.15
codeium|Cod|1.24.8
csharpier-vscode|csh|1.8.0
vscode-eslint|dba|3.0.10
gitlens|eam|16.0.4
EditorConfig|Edi|0.16.4
minifyall|jos|2.10.0
rainbow-csv|mec|3.13.0
vscode-docker|ms-|1.29.3
csdevkit|ms-|1.13.9
csharp|ms-|2.55.29
vscode-dotnet-runtime|ms-|2.2.3
remote-containers|ms-|0.388.0
live-server|ms-|0.4.15
powershell|ms-|2024.4.0
npm-outdated|msk|2.2.0
visualsvg|rag|1.0.3
vscode-xml|red|0.27.2
vscode-yaml|red|1.15.0
code-spell-checker|str|4.0.21
code-spell-checker-spanish|str|2.3.5
sort-json|Thi|19.1.2
markdown-all-in-one|yzh|3.6.2

(1 theme extensions excluded)

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

```
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492cf:30256860
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
dvdeprecation:31068756
dwnewjupytercf:31046870
nativerepl2:31139839
pythonrstrctxt:31112756
nativeloc2:31192216
cf971741:31144450
iacca1:31171482
notype1cf:31157160
5fd0e150:31155592
dwcopilot:31170013
stablechunks:31184530

```

</details>

<!-- generated by issue reporter -->