@@ -145,7 +145,12 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
145
145
const generateLaunchConfig = ! config . request ;
146
146
147
147
const settings = Settings . load ( ) ;
148
- let createNewIntegratedConsole = settings . debugging . createTemporaryIntegratedConsole ;
148
+
149
+ // If the createTemporaryIntegratedConsole field is not specified in the launch config, set the field using
150
+ // the value from the corresponding setting. Otherwise, the launch config value overrides the setting.
151
+ if ( config . createTemporaryIntegratedConsole === undefined ) {
152
+ config . createTemporaryIntegratedConsole = settings . debugging . createTemporaryIntegratedConsole ;
153
+ }
149
154
150
155
if ( config . request === "attach" ) {
151
156
const platformDetails = getPlatformDetails ( ) ;
@@ -192,7 +197,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
192
197
? currentDocument . uri . toString ( )
193
198
: currentDocument . fileName ;
194
199
195
- if ( settings . debugging . createTemporaryIntegratedConsole ) {
200
+ if ( config . createTemporaryIntegratedConsole ) {
196
201
// For a folder-less workspace, vscode.workspace.rootPath will be undefined.
197
202
// PSES will convert that undefined to a reasonable working dir.
198
203
config . cwd =
@@ -222,6 +227,12 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
222
227
}
223
228
224
229
if ( currentDocument . isUntitled ) {
230
+ if ( config . createTemporaryIntegratedConsole ) {
231
+ const msg = "Debugging Untitled files in a temporary console is currently not supported." ;
232
+ vscode . window . showErrorMessage ( msg ) ;
233
+ return ;
234
+ }
235
+
225
236
if ( currentDocument . languageId === "powershell" ) {
226
237
if ( ! generateLaunchConfig ) {
227
238
// Cover the case of existing launch.json but unsaved (Untitled) document.
@@ -264,14 +275,6 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
264
275
if ( ( currentDocument !== undefined ) && ( config . cwd === "${file}" ) ) {
265
276
config . cwd = currentDocument . fileName ;
266
277
}
267
-
268
- // If the createTemporaryIntegratedConsole field is not specified in the launch config, set the field using
269
- // the value from the corresponding setting. Otherwise, the launch config value overrides the setting.
270
- if ( config . createTemporaryIntegratedConsole === undefined ) {
271
- config . createTemporaryIntegratedConsole = createNewIntegratedConsole ;
272
- } else {
273
- createNewIntegratedConsole = config . createTemporaryIntegratedConsole ;
274
- }
275
278
}
276
279
277
280
// Prevent the Debug Console from opening
@@ -282,7 +285,7 @@ export class DebugSessionFeature implements IFeature, DebugConfigurationProvider
282
285
283
286
const sessionFilePath = utils . getDebugSessionFilePath ( ) ;
284
287
285
- if ( createNewIntegratedConsole ) {
288
+ if ( config . createTemporaryIntegratedConsole ) {
286
289
if ( this . tempDebugProcess ) {
287
290
this . tempDebugProcess . dispose ( ) ;
288
291
}
0 commit comments