Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need launch config option to disable multiple debug consoles #62419

Closed
weinand opened this issue Nov 1, 2018 · 14 comments
Closed

Need launch config option to disable multiple debug consoles #62419

weinand opened this issue Nov 1, 2018 · 14 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality release-notes Release notes issues verified Verification succeeded

Comments

@weinand
Copy link
Contributor

weinand commented Nov 1, 2018

Using debug consoles for multi-process debugging is painful in many situations.

We need a launch config flag to turn this off (and Cluster and multi process debugging should disable multiple debug consoles).

@isidorn
Copy link
Contributor

isidorn commented Nov 2, 2018

I think this makes sense and as you say it should be in launch config, not a vscode setting since it depends on the launch configuration.
The following names we already use in launch configs: console, internalConsoleOptions.
What would be the name of the new setting and do we make it a boolean or string in case it needs more tuning in the future.
The simplest one is multiConsole: true|false, but let's first decide on how to solve #62420 and see what you think of my suggestion

@isidorn
Copy link
Contributor

isidorn commented Nov 12, 2018

After discussions we decided to only add this as a compound configuration option.
Naming still to be decided.
We have also decided to wait for user feedback after the stable launch before we take any action here.

@isidorn
Copy link
Contributor

isidorn commented Nov 28, 2018

We did not really recieve user feedback regarding this one so pushing it to On-Deck until we see a higher need for this.

@tzachshabtay
Copy link

Adding my feedback from #64445 here as it was deleted as a duplicate of this one. What I would like to see is that the dropdown on the debug console for selecting processes will be multi-selection and not single-selection (i.e a list of checkboxes) so that I can check/uncheck the processes for which I'll see output.

@isidorn
Copy link
Contributor

isidorn commented Jan 11, 2019

@weinand do we want to do this this milestone?
If yes, here's my proposal:
We introduce a top level compound configuration which would control this, for example:

"compounds": [
        {
            "name": "Compound",
            "multiConsole": true,
            "configurations": ["Server", "Client"]
        }
    ]

So when the compound is launched if multiConsole is false we will put all output in one console.

Feedback on naming and wheter this is a boolean or string is welcome.

Downside of this approach is that it will not be possible to do this when launching multiple independedt debug configurations.

Related launch configuration attribute is named internalConsoleOptions - on when to open it.
So we could also call this internalMultiConsole.

@tzachshabtay
Copy link

@isidorn, but with your suggestion I'll need to restart everytime I want to change the view. With my suggestion you can change the view while the app is running. And with my suggestion there's no need to add any config.

@isidorn
Copy link
Contributor

isidorn commented Jan 22, 2019

Not convinced we need this.
Pushing out of this milestone
@weinand let me know if you would like this for this milestone and I can look into it. Also check out my proposel from above

@weinand
Copy link
Contributor Author

weinand commented Aug 15, 2019

We definitely need this. But probably not as a launch config attribute but an option on the debug API (e.g. method startDebugging).

@weinand weinand self-assigned this Aug 15, 2019
@isidorn
Copy link
Contributor

isidorn commented Aug 15, 2019

@weinand that makes sense since I believe the use case is for sessions that are "auto-started".
You can add it to the API and then I can adopt it in the REPL.

isidorn added a commit that referenced this issue Sep 19, 2019
Allow debug session to share repl with its parent; fixes #62419
@isidorn isidorn added the verification-needed Verification of issue is requested label Sep 19, 2019
@isidorn
Copy link
Contributor

isidorn commented Sep 19, 2019

To verify:

  1. Write an extension that uses vscode.proposed.d.ts
  2. Use the startDebugging api to start multiple sessions and make sure to pass DebugSessionOptions with both DebugConsoleMode and verify that new sessions get created in a new or a previous Debug Console (you will see a drop down in debug console title to differentiate)

@isidorn
Copy link
Contributor

isidorn commented Sep 19, 2019

Here's an example extension.ts I used for verifying.
In the second window you just need a Launch Config and Launch Config 2 launch configurations to verify.

'use strict';
// The module 'vscode' contains the VS Code extensibility API
// Import the module and reference it with the alias vscode in your code below
import * as vscode from 'vscode';

// this method is called when your extension is activated
// your extension is activated the very first time the command is executed
export function activate(context: vscode.ExtensionContext) {

    // Use the console to output diagnostic information (console.log) and errors (console.error)
    // This line of code will only be executed once when your extension is activated
    console.log('Congratulations, your extension "sept-extension" is now active!');
    let t = 0;
    // The command has been defined in the package.json file
    // Now provide the implementation of the command with  registerCommand
    // The commandId parameter must match the command field in package.json
    let disposable = vscode.commands.registerCommand('extension.sayHello', () => {
        console.log('hey there');
        t++;
        if (vscode.workspace.workspaceFolders) {
            vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], t <= 1 ? 'Launch Program' : 'Launch Program 2', {
               consoleMode: vscode.DebugConsoleMode.MergeWithParent,
               parentSession: vscode.debug.activeDebugSession
            });
        }
    });

    context.subscriptions.push(disposable);
}

// this method is called when your extension is deactivated
export function deactivate() {
}

@aeschli
Copy link
Contributor

aeschli commented Oct 3, 2019

@isidorn When I try the code above with ( t <= 1 ? 'Launch Program Foo' : 'Launch Program Bar') I get 2 debug consoles.
image

Is that the expected result?

@isidorn
Copy link
Contributor

isidorn commented Oct 3, 2019

If you passed consoleMode: vscode.DebugConsoleMode.MergeWithParent, then you shuold not get two debug sessions, it should just be one. I can also investigate, just let me know if you pass the proper option.

@aeschli
Copy link
Contributor

aeschli commented Oct 4, 2019

I works, the problem I had was that the first debug session has already ended.

@aeschli aeschli added verified Verification succeeded and removed verification-needed Verification of issue is requested labels Oct 4, 2019
@isidorn isidorn added the release-notes Release notes issues label Oct 4, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality release-notes Release notes issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants