Skip to content

terminal.shellIntegration.executeCommand doesn't execute the command in new shells in Powershell 7 on macOS #236397

@Eptagone

Description

@Eptagone

Type: Bug

Steps to reproduce

  1. Set PowerShell 7 as default shell in VS Code for Mac. In my case I installed Powershell 7 with Homebrew
// settings.json
{
    "terminal.integrated.defaultProfile.osx": "pwsh",
}
  1. Create a simple project to launch it, like a node project:
// 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');
});
  1. Add a launch.json to start the program:
// .vscode/launch.json
{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Launch Program",
            "command": "node ./index.js",
            "request": "launch",
            "type": "node-terminal"
        },
    ]
}
  1. Launch the program (F5) and see.

Result

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

Launch.with.pwsh.mov

Extra info

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

Launch.with.bash.mov

It works fine in Windows

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

System Info
Item Value
CPUs Apple M3 (8 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
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_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
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%
Extensions (27)
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)

A/B Experiments
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

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugterminal-shell-integrationShell integration infrastructure, command decorations, etc.terminal-shell-pwshAn issue in the terminal specific to PowerShell, including shell integration

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions