microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.55k stars 29.4k forks source link

Tasks with CustomExecution fails if the default terminal profile is contributed by the same extension #200558

Open trond-snekvik opened 11 months ago

trond-snekvik commented 11 months ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Create an extension that contributes a terminal profile:
    "terminal": {
       "profiles": [
           {
               "id": "extension.terminal",
               "title": "Custom profile",
           }
       ]
    }
  2. From that extension's activation function, launch a task that creates a Pseudoterminal from a CustomExecution:

    
    const writer = new vscode.EventEmitter<string>();
    vscode.tasks.executeTask({
        definition: {
            type: 'custom',
        },
        name: 'Test task',
        isBackground: false,
        presentationOptions: {},
        runOptions: {},
        source: 'My extension',
        problemMatchers: [],
        scope: vscode.TaskScope.Workspace,
        execution: new vscode.CustomExecution(async () => ({
            onDidWrite: writer.event,
            open: () => writer.fire('open'),
            close: () => {
                throw new Error('Method not implemented.');
            },
        })),
    });
  3. Start debugging. The terminal launches as expected, and nothing else happens.
  4. Change the default terminal profile to our contributed Custom profile.
  5. Restart debugging. VS Code now errors out, complaining that there's no contributed profile for our Custom profile.

If we implement a terminal profile provider, VS Code will start a new terminal with the custom terminal profile instead of erroring out, but I expect the custom task to run.

bencefr commented 9 months ago

Any update? This is a serious issue, our extension has a lots of essential tasks wrapped in custom execution and all of them will fail when our users set their default terminal profile.

bencefr commented 8 months ago

Bump

bencefr commented 8 months ago

Anyone?

bencefr commented 7 months ago

This is a serious issue, anyone care to pick it up?

bencefr commented 6 months ago

Come on!

kylebonnici commented 1 month ago

This is still an issue @meganrogge any updates on an ETA to fix this?

meganrogge commented 1 month ago

No updates unfortunately. This is one of many, many issues I am responsible for. Thanks for your patience.

bencefr commented 2 weeks ago

This is still a very annoying issue, more and more users are effected by it. @meganrogge any ETA?