@@ -27,7 +27,6 @@ import { ExtensionDescriptionRegistry } from 'vs/workbench/services/extensions/c
27
27
import type * as vscode from 'vscode' ;
28
28
import { ExtHostConfigProvider , IExtHostConfiguration } from '../common/extHostConfiguration' ;
29
29
import { IExtHostCommands } from 'vs/workbench/api/common/extHostCommands' ;
30
- import { createHash } from 'crypto' ;
31
30
32
31
export class ExtHostDebugService extends ExtHostDebugServiceBase {
33
32
@@ -90,8 +89,8 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
90
89
91
90
const terminalName = args . title || nls . localize ( 'debug.terminal.title' , "Debug Process" ) ;
92
91
93
- const termKey = createKeyForShell ( shell , shellArgs , args ) ;
94
- let terminal = await this . _integratedTerminalInstances . checkout ( termKey , terminalName , true ) ;
92
+ const shellConfig = JSON . stringify ( { shell, shellArgs } ) ;
93
+ let terminal = await this . _integratedTerminalInstances . checkout ( shellConfig , terminalName ) ;
95
94
96
95
let cwdForPrepareCommand : string | undefined ;
97
96
let giveShellTimeToInitialize = false ;
@@ -103,7 +102,6 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
103
102
cwd : args . cwd ,
104
103
name : terminalName ,
105
104
iconPath : new ThemeIcon ( 'debug' ) ,
106
- env : args . env ,
107
105
} ;
108
106
giveShellTimeToInitialize = true ;
109
107
terminal = this . _terminalService . createTerminalFromOptions ( options , {
@@ -113,7 +111,7 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
113
111
forceShellIntegration : true ,
114
112
useShellEnvironment : true
115
113
} ) ;
116
- this . _integratedTerminalInstances . insert ( terminal , termKey ) ;
114
+ this . _integratedTerminalInstances . insert ( terminal , shellConfig ) ;
117
115
118
116
} else {
119
117
cwdForPrepareCommand = args . cwd ;
@@ -145,7 +143,7 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
145
143
}
146
144
}
147
145
148
- const command = prepareCommand ( shell , args . args , ! ! args . argsCanBeInterpretedByShell , cwdForPrepareCommand ) ;
146
+ const command = prepareCommand ( shell , args . args , ! ! args . argsCanBeInterpretedByShell , cwdForPrepareCommand , args . env ) ;
149
147
terminal . sendText ( command ) ;
150
148
151
149
// Mark terminal as unused when its session ends, see #112055
@@ -165,14 +163,6 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
165
163
}
166
164
}
167
165
168
- /** Creates a key that determines how terminals get reused */
169
- function createKeyForShell ( shell : string , shellArgs : string | string [ ] , args : DebugProtocol . RunInTerminalRequestArguments ) {
170
- const hash = createHash ( 'sha256' ) ;
171
- hash . update ( JSON . stringify ( { shell, shellArgs } ) ) ;
172
- hash . update ( JSON . stringify ( Object . entries ( args . env || { } ) . sort ( ( [ k1 ] , [ k2 ] ) => k1 . localeCompare ( k2 ) ) ) ) ;
173
- return hash . digest ( 'base64' ) ;
174
- }
175
-
176
166
let externalTerminalService : IExternalTerminalService | undefined = undefined ;
177
167
178
168
function runInExternalTerminal ( args : DebugProtocol . RunInTerminalRequestArguments , configProvider : ExtHostConfigProvider ) : Promise < number | undefined > {
0 commit comments