Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions debugger.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,14 @@ Environment variables may be passed to your program using this schema:
"myVariableName":"theValueGoesHere"
}

#####External console (terminal) window
The target process can optionally launch into a separate console window. You will want this if your console app takes console input (ex: Console.ReadLine). This can be enabled with:
#####Console (terminal) window
By default, processes are launched with their console output (stdout/stderr) going to the VS Code Debugger Console. This is useful for executables that take their input from the network, files, etc. But this does NOT work for applications that want to read from the console (ex: `Console.ReadLine`). For these applications, use a setting such as the following:

"externalConsole": true
"console": "integratedTerminal"

When this is set to `integratedTerminal` the target process will run inside [VS Code's integrated terminal](https://code.visualstudio.com/docs/editor/integrated-terminal). Click the 'Terminal' tab in the tab group beneath the editor to interact with your application.

When this is set to `externalTerminal` the target process will run in a separate terminal.

##### Stepping into properties and operators
The debugger steps over properties and operators in managed code by default. In most cases, this provides a better debugging experience. To change this and enable stepping into properties or operators add:
Expand Down
19 changes: 17 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,9 +618,24 @@
"description": "Environment variables passed to the program.",
"default": {}
},
"console": {
"type": "string",
"enum": [
"internalConsole",
"integratedTerminal",
"externalTerminal"
],
"enumDescriptions": [
"Output to the VS Code Debug Console. This doesn't support reading console input (ex:Console.ReadLine)",
"VS Code's integrated terminal",
"External terminal that can be configured via user settings"
],
"description": "Where to launch the debug target.",
"default": "internalConsole"
},
"externalConsole": {
"type": "boolean",
"description": "If 'true' the debugger should launch the target application into a new external console.",
"description": "Attribute 'externalConsole' is deprecated, use 'console' instead.",
"default": false
},
"sourceFileMap": {
Expand Down Expand Up @@ -1111,7 +1126,7 @@
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"externalConsole": false
"console": "internalConsole"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can go either way on this, but we might want to have 'integratedTerminal' as the default. The rationale being in the "console" launch configuration you are more likely interacting with an app that takes input. We can wait for community feedback on this too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I discussed this with Charlie offline. The problem is that the terminal will get hidden by the debug console by default, so it may not be very obvious where to go and interact with the application. So we will leave it this way for now.

},
{
"name": ".NET Core Launch (web)",
Expand Down
4 changes: 2 additions & 2 deletions src/assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface ConsoleLaunchConfiguration extends DebugConfiguration {
cwd: string;
stopAtEntry: boolean;
env?: any;
externalConsole?: boolean;
console?: string;
}

interface CommandLine {
Expand Down Expand Up @@ -188,7 +188,7 @@ export class AssetGenerator {
program: this.computeProgramPath(),
args: [],
cwd: '${workspaceRoot}',
externalConsole: false,
console: "internalConsole",
stopAtEntry: false,
internalConsoleOptions: "openOnSessionStart"
};
Expand Down
13 changes: 12 additions & 1 deletion src/tools/OptionsSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,20 @@
"description": "Environment variables passed to the program.",
"default": {}
},
"console": {
"type": "string",
"enum": [ "internalConsole", "integratedTerminal", "externalTerminal" ],
"enumDescriptions": [
"Output to the VS Code Debug Console. This doesn't support reading console input (ex:Console.ReadLine)",
"VS Code's integrated terminal",
"External terminal that can be configured via user settings"
],
"description": "Where to launch the debug target.",
"default": "internalConsole"
},
"externalConsole": {
"type": "boolean",
"description": "If 'true' the debugger should launch the target application into a new external console.",
"description": "Attribute 'externalConsole' is deprecated, use 'console' instead.",
"default": false
},
"sourceFileMap": {
Expand Down