@@ -7,7 +7,7 @@ import type { IMarker as IXtermMarker } from '@xterm/xterm';
7
7
import { timeout } from '../../../../../base/common/async.js' ;
8
8
import { CancellationToken } from '../../../../../base/common/cancellation.js' ;
9
9
import { CancellationError } from '../../../../../base/common/errors.js' ;
10
- import { MarkdownString } from '../../../../../base/common/htmlContent.js' ;
10
+ import { MarkdownString , type IMarkdownString } from '../../../../../base/common/htmlContent.js' ;
11
11
import { Disposable , DisposableStore } from '../../../../../base/common/lifecycle.js' ;
12
12
import { OperatingSystem , OS } from '../../../../../base/common/platform.js' ;
13
13
import { count } from '../../../../../base/common/strings.js' ;
@@ -22,11 +22,13 @@ import { ITerminalLogService } from '../../../../../platform/terminal/common/ter
22
22
import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js' ;
23
23
import { IRemoteAgentService } from '../../../../services/remote/common/remoteAgentService.js' ;
24
24
import { IChatService , type IChatTerminalToolInvocationData } from '../../../chat/common/chatService.js' ;
25
+ import { ILanguageModelsService } from '../../../chat/common/languageModels.js' ;
25
26
import { CountTokensCallback , ILanguageModelToolsService , IPreparedToolInvocation , IToolData , IToolImpl , IToolInvocation , IToolInvocationPreparationContext , IToolResult , ToolDataSource , ToolProgress , type IToolConfirmationMessages } from '../../../chat/common/languageModelToolsService.js' ;
26
27
import { ITerminalService , type ITerminalInstance } from '../../../terminal/browser/terminal.js' ;
27
28
import type { XtermTerminal } from '../../../terminal/browser/xterm/xtermTerminal.js' ;
28
29
import { ITerminalProfileResolverService } from '../../../terminal/common/terminal.js' ;
29
30
import { getRecommendedToolsOverRunInTerminal } from './alternativeRecommendation.js' ;
31
+ import { getOutput , pollForOutputAndIdle , promptForMorePolling , racePollingOrPrompt } from './bufferOutputPolling.js' ;
30
32
import { CommandLineAutoApprover } from './commandLineAutoApprover.js' ;
31
33
import { BasicExecuteStrategy } from './executeStrategy/basicExecuteStrategy.js' ;
32
34
import type { ITerminalExecuteStrategy } from './executeStrategy/executeStrategy.js' ;
@@ -35,8 +37,6 @@ import { RichExecuteStrategy } from './executeStrategy/richExecuteStrategy.js';
35
37
import { isPowerShell } from './runInTerminalHelpers.js' ;
36
38
import { extractInlineSubCommands , splitCommandLineIntoSubCommands } from './subCommands.js' ;
37
39
import { ShellIntegrationQuality , ToolTerminalCreator , type IToolTerminal } from './toolTerminalCreator.js' ;
38
- import { ILanguageModelsService } from '../../../chat/common/languageModels.js' ;
39
- import { getOutput , pollForOutputAndIdle , promptForMorePolling , racePollingOrPrompt } from './bufferOutputPolling.js' ;
40
40
41
41
const TERMINAL_SESSION_STORAGE_KEY = 'chat.terminalSessions' ;
42
42
@@ -262,6 +262,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
262
262
if ( ! toolSpecificData ) {
263
263
throw new Error ( 'toolSpecificData must be provided for this tool' ) ;
264
264
}
265
+ let toolResultMessage : string | IMarkdownString | undefined ;
265
266
266
267
const chatSessionId = invocation . context ?. sessionId ;
267
268
if ( ! invocation . context || chatSessionId === undefined ) {
@@ -397,6 +398,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
397
398
switch ( toolTerminal . shellIntegrationQuality ) {
398
399
case ShellIntegrationQuality . None : {
399
400
strategy = this . _instantiationService . createInstance ( NoneExecuteStrategy , toolTerminal . instance ) ;
401
+ toolResultMessage = new MarkdownString ( 'Enable [shell integration](https://code.visualstudio.com/docs/terminal/shell-integration) to improve command detection' ) ;
400
402
break ;
401
403
}
402
404
case ShellIntegrationQuality . Basic : {
@@ -461,6 +463,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl {
461
463
resultText . push ( terminalResult ) ;
462
464
463
465
return {
466
+ toolResultMessage,
464
467
content : [ {
465
468
kind : 'text' ,
466
469
value : resultText . join ( '' ) ,
0 commit comments