@@ -21,6 +21,7 @@ import { OperatingSystem } from '../../../../../../base/common/platform.js';
21
21
import { Emitter } from '../../../../../../base/common/event.js' ;
22
22
import { IChatService } from '../../../../chat/common/chatService.js' ;
23
23
import { ShellIntegrationQuality } from '../../browser/toolTerminalCreator.js' ;
24
+ import { ITerminalProfileResolverService } from '../../../../terminal/common/terminal.js' ;
24
25
25
26
class TestRunInTerminalTool extends RunInTerminalTool {
26
27
protected override _osBackend : Promise < OperatingSystem > = Promise . resolve ( OperatingSystem . Windows ) ;
@@ -67,6 +68,9 @@ suite('RunInTerminalTool', () => {
67
68
instantiationService . stub ( IChatService , {
68
69
onDidDisposeSession : chatServiceDisposeEmitter . event
69
70
} ) ;
71
+ instantiationService . stub ( ITerminalProfileResolverService , {
72
+ getDefaultShell : async ( ) => 'pwsh'
73
+ } ) ;
70
74
workspaceService = instantiationService . invokeFunction ( accessor => accessor . get ( IWorkspaceContextService ) ) as TestContextService ;
71
75
72
76
runInTerminalTool = store . add ( instantiationService . createInstance ( TestRunInTerminalTool ) ) ;
@@ -150,7 +154,7 @@ suite('RunInTerminalTool', () => {
150
154
command : 'rm file.txt' ,
151
155
explanation : 'Remove a file'
152
156
} ) ;
153
- assertConfirmationRequired ( result , 'Run command in terminal ' ) ;
157
+ assertConfirmationRequired ( result , 'pwsh ' ) ;
154
158
} ) ;
155
159
156
160
test ( 'should require confirmation for commands in deny list even if in allow list' , async ( ) => {
@@ -163,7 +167,7 @@ suite('RunInTerminalTool', () => {
163
167
command : 'rm dangerous-file.txt' ,
164
168
explanation : 'Remove a dangerous file'
165
169
} ) ;
166
- assertConfirmationRequired ( result , 'Run command in terminal ' ) ;
170
+ assertConfirmationRequired ( result , 'pwsh ' ) ;
167
171
} ) ;
168
172
169
173
test ( 'should handle background commands with confirmation' , async ( ) => {
@@ -176,7 +180,7 @@ suite('RunInTerminalTool', () => {
176
180
explanation : 'Start watching for file changes' ,
177
181
isBackground : true
178
182
} ) ;
179
- assertConfirmationRequired ( result , 'Run command in background terminal' ) ;
183
+ assertConfirmationRequired ( result , 'pwsh ( background terminal) ' ) ;
180
184
} ) ;
181
185
182
186
test ( 'should auto-approve background commands in allow list' , async ( ) => {
@@ -283,7 +287,7 @@ suite('RunInTerminalTool', () => {
283
287
explanation : 'Build the project'
284
288
} ) ;
285
289
286
- assertConfirmationRequired ( result , 'Run command in terminal ' ) ;
290
+ assertConfirmationRequired ( result , 'pwsh ' ) ;
287
291
ok ( result ! . confirmationMessages ! . terminalCustomActions , 'Expected custom actions to be defined' ) ;
288
292
289
293
const customActions = result ! . confirmationMessages ! . terminalCustomActions ! ;
@@ -345,7 +349,7 @@ suite('RunInTerminalTool', () => {
345
349
explanation : 'Build the project'
346
350
} ) ;
347
351
348
- assertConfirmationRequired ( result , 'Run command in terminal ' ) ;
352
+ assertConfirmationRequired ( result , 'pwsh ' ) ;
349
353
ok ( result ! . confirmationMessages ! . terminalCustomActions , 'Expected custom actions to be defined' ) ;
350
354
351
355
const customActions = result ! . confirmationMessages ! . terminalCustomActions ! ;
@@ -361,7 +365,7 @@ suite('RunInTerminalTool', () => {
361
365
explanation : 'Install dependencies and build'
362
366
} ) ;
363
367
364
- assertConfirmationRequired ( result , 'Run command in terminal ' ) ;
368
+ assertConfirmationRequired ( result , 'pwsh ' ) ;
365
369
ok ( result ! . confirmationMessages ! . terminalCustomActions , 'Expected custom actions to be defined' ) ;
366
370
367
371
const customActions = result ! . confirmationMessages ! . terminalCustomActions ! ;
0 commit comments