Skip to content

Commit 74ecafc

Browse files
Add 'console' to launch.json schema (#1281)
* Add 'console' to launch.json schema This checkin completes the external (and integrated) console work by updating the launch.json schema to add the new attributes. I also updated the documentation and templates. * Fix typeos
1 parent c4c977c commit 74ecafc

File tree

4 files changed

+38
-8
lines changed

4 files changed

+38
-8
lines changed

debugger.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,14 @@ Environment variables may be passed to your program using this schema:
117117
"myVariableName":"theValueGoesHere"
118118
}
119119

120-
#####External console (terminal) window
121-
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:
120+
#####Console (terminal) window
121+
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:
122122

123-
"externalConsole": true
123+
"console": "integratedTerminal"
124+
125+
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.
126+
127+
When this is set to `externalTerminal` the target process will run in a separate terminal.
124128

125129
##### Stepping into properties and operators
126130
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:

package.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,24 @@
618618
"description": "Environment variables passed to the program.",
619619
"default": {}
620620
},
621+
"console": {
622+
"type": "string",
623+
"enum": [
624+
"internalConsole",
625+
"integratedTerminal",
626+
"externalTerminal"
627+
],
628+
"enumDescriptions": [
629+
"Output to the VS Code Debug Console. This doesn't support reading console input (ex:Console.ReadLine)",
630+
"VS Code's integrated terminal",
631+
"External terminal that can be configured via user settings"
632+
],
633+
"description": "Where to launch the debug target.",
634+
"default": "internalConsole"
635+
},
621636
"externalConsole": {
622637
"type": "boolean",
623-
"description": "If 'true' the debugger should launch the target application into a new external console.",
638+
"description": "Attribute 'externalConsole' is deprecated, use 'console' instead.",
624639
"default": false
625640
},
626641
"sourceFileMap": {
@@ -1111,7 +1126,7 @@
11111126
"args": [],
11121127
"cwd": "${workspaceRoot}",
11131128
"stopAtEntry": false,
1114-
"externalConsole": false
1129+
"console": "internalConsole"
11151130
},
11161131
{
11171132
"name": ".NET Core Launch (web)",

src/assets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface ConsoleLaunchConfiguration extends DebugConfiguration {
2727
cwd: string;
2828
stopAtEntry: boolean;
2929
env?: any;
30-
externalConsole?: boolean;
30+
console?: string;
3131
}
3232

3333
interface CommandLine {
@@ -188,7 +188,7 @@ export class AssetGenerator {
188188
program: this.computeProgramPath(),
189189
args: [],
190190
cwd: '${workspaceRoot}',
191-
externalConsole: false,
191+
console: "internalConsole",
192192
stopAtEntry: false,
193193
internalConsoleOptions: "openOnSessionStart"
194194
};

src/tools/OptionsSchema.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,20 @@
273273
"description": "Environment variables passed to the program.",
274274
"default": {}
275275
},
276+
"console": {
277+
"type": "string",
278+
"enum": [ "internalConsole", "integratedTerminal", "externalTerminal" ],
279+
"enumDescriptions": [
280+
"Output to the VS Code Debug Console. This doesn't support reading console input (ex:Console.ReadLine)",
281+
"VS Code's integrated terminal",
282+
"External terminal that can be configured via user settings"
283+
],
284+
"description": "Where to launch the debug target.",
285+
"default": "internalConsole"
286+
},
276287
"externalConsole": {
277288
"type": "boolean",
278-
"description": "If 'true' the debugger should launch the target application into a new external console.",
289+
"description": "Attribute 'externalConsole' is deprecated, use 'console' instead.",
279290
"default": false
280291
},
281292
"sourceFileMap": {

0 commit comments

Comments
 (0)