Skip to content

Tasks do not trigger onDidStartTerminalShellExecution #272945

@nturinski

Description

@nturinski

Does this issue occur when all extensions are disabled?: No
You need to have a task definition in an extension in order for this to be applicable.

Version: 1.106.0-insider (user setup)
Commit: d8b0787
Date: 2025-10-10T08:19:44.111Z
Electron: 37.6.0
ElectronBuildId: 12506819
Chromium: 138.0.7204.251
Node.js: 22.19.0
V8: 13.8.258.32-electron.0
OS: Windows_NT x64 10.0.26200

Coming from an offline email with @isidorn
Steps to Reproduce:

  1. In our package.json, we have a taskDefinition as follows:
"taskDefinitions": [
            {
                "type": "func",
                "required": [
                    "command"
                ],
                "properties": {
                    "command": {
                        "type": "string"
                    },
                    "args": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            }
        ],
  1. In the tasks.json, there is the following task:
{
			"type": "func",
			"dependsOn": "build (functions)",
			"options": {
				"cwd": "${workspaceFolder}/bin/Debug/net9.0"
			},
			"command": "host start",
			"args": [
				"--dotnet-isolated-debug",
				"--enable-json-output"
			],
			"isBackground": true,
			"problemMatcher": "$func-dotnet-watch"
		}
  1. In our extension code, we dynamically create the task in the following constructor:
new Task(definition, folder, command, func, new ShellExecution(commandLine, options), problemMatcher);
  1. Set a vscode.window.onDidStartTerminalShellExecution or a vscode.window.onDidChangeTerminalShellIntegration event handler.
  2. Start our launch with F5 which kicks off our task.
  3. When the other type process tasks run, these trigger an event on the event handlers. However, the func task does not fire an event despite being run in the same terminal as the process tasks.

Metadata

Metadata

Assignees

Labels

author-verification-requestedIssues potentially verifiable by issue authorfeature-requestRequest for new features or functionalityinsiders-releasedPatch has been released in VS Code InsiderstasksTask system issuesterminal-shell-integrationShell integration infrastructure, command decorations, etc.verification-neededVerification of issue is requestedverifiedVerification succeeded

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions