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

Debug Protocol: support for launching debuggee in VS Code terminal #47

Closed
weinand opened this issue Jul 19, 2016 · 3 comments
Closed

Debug Protocol: support for launching debuggee in VS Code terminal #47

weinand opened this issue Jul 19, 2016 · 3 comments
Assignees

Comments

@weinand
Copy link
Contributor

weinand commented Jul 19, 2016

No description provided.

@daviwil
Copy link

daviwil commented Aug 19, 2016

Ohhhh, nice! This might be interesting for PowerShell.

@weinand
Copy link
Contributor Author

weinand commented Aug 23, 2016

I've added the first 'reverse request' to the protocol. A debug adapter can now launch a runtime or debug target in VS Code's integrated terminal.

This is the runInTerminalRequest in the protocol:

    /** runInTerminal request; value of command field is "runInTerminal".
        With this request a debug adapter can run a command in a terminal.
    */
    export interface RunInTerminalRequest extends Request {
        arguments: RunInTerminalRequestArguments;
    }
    /** Arguments for "runInTerminal" request. */
    export interface RunInTerminalRequestArguments {
        /** What kind of terminal to launch. */
        kind?: 'integrated' | 'external';
        /** Optional title of the terminal. */
        title?: string;
        /** Working directory of the command. */
        cwd: string;
        /** List of arguments. The first argument is the command to run. */
        args: string[];
        /** Environment key-value pairs that are added to the default environment. */
        env?: { [key: string]: string; }
    }
    /** Response to Initialize request. */
    export interface RunInTerminalResponse extends Response {
        body: {
            /** The process ID */
            processId?: number;
        };
    }

The debug adapter should only use the runInTerminalRequest if the attribute supportsRunInTerminalRequest is true in the initializeRequest:

    /** Client supports the runInTerminal request. */
    supportsRunInTerminalRequest?: boolean;

@daviwil
Copy link

daviwil commented Aug 23, 2016

This is really interesting, might have an application for the long-running debug session idea we talked about some time ago. Scenario:

  1. PowerShell extension uses the new debug launcher API to launch the long-running debug configuration
  2. My TypeScript-based debug adapter code immediately sends the RunInTerminalRequest so that my language/debug server process gets launched in the integrated terminal
  3. The PowerShell extension connects to the language server running in that application
  4. User now has a fully integrated development/debugging session and can run debug commands, etc directly through the integrated terminal using the native PowerShell console host

What do you think?

One question: if we did manage to start this long-running debug session, is there any way we could get a flag to make the status bar not be orange all the time? I know that sort of breaks the original UX of running in the debugger, but I think it might be a little annoying to the user if it looks like they're perpetually in the debug state.

/cc @rkeithhill

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants