mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-11 05:30:03 -05:00
@@ -164,13 +164,6 @@ export interface ITerminalChatService {
|
||||
* @returns The chat session resource if found, undefined otherwise
|
||||
*/
|
||||
getChatSessionResourceForInstance(instance: ITerminalInstance): URI | undefined;
|
||||
/**
|
||||
* @deprecated Use getChatSessionResourceForInstance instead
|
||||
* Returns the chat session ID for a given terminal instance, if it has been registered.
|
||||
* @param instance The terminal instance to look up
|
||||
* @returns The chat session ID if found, undefined otherwise
|
||||
*/
|
||||
getChatSessionIdForInstance(instance: ITerminalInstance): string | undefined;
|
||||
|
||||
/**
|
||||
* Check if a terminal is a background terminal (tool-driven terminal that may be hidden from
|
||||
|
||||
@@ -14,7 +14,6 @@ import { KeybindingsRegistry, KeybindingWeight } from '../../../../../platform/k
|
||||
import { ChatViewId, IChatWidgetService } from '../../../chat/browser/chat.js';
|
||||
import { ChatContextKeys } from '../../../chat/common/actions/chatContextKeys.js';
|
||||
import { IChatService } from '../../../chat/common/chatService/chatService.js';
|
||||
import { LocalChatSessionUri } from '../../../chat/common/model/chatUri.js';
|
||||
import { ChatAgentLocation, ChatConfiguration } from '../../../chat/common/constants.js';
|
||||
|
||||
import { isDetachedTerminalInstance, ITerminalChatService, ITerminalEditorService, ITerminalGroupService, ITerminalInstance, ITerminalService } from '../../../terminal/browser/terminal.js';
|
||||
@@ -392,10 +391,11 @@ registerAction2(class ShowChatTerminalsAction extends Action2 {
|
||||
const lastCommand = instance.capabilities.get(TerminalCapability.CommandDetection)?.commands.at(-1)?.command;
|
||||
|
||||
// Get the chat session title
|
||||
const chatSessionId = terminalChatService.getChatSessionIdForInstance(instance);
|
||||
const chatSessionResource = terminalChatService.getChatSessionResourceForInstance(instance);
|
||||
let chatSessionTitle: string | undefined;
|
||||
if (chatSessionId) {
|
||||
chatSessionTitle = chatService.getSessionTitle(LocalChatSessionUri.forSession(chatSessionId));
|
||||
if (chatSessionResource) {
|
||||
const liveTitle = chatService.getSession(chatSessionResource)?.title;
|
||||
chatSessionTitle = liveTitle ?? chatService.getSessionTitle(chatSessionResource);
|
||||
}
|
||||
|
||||
const description = chatSessionTitle;
|
||||
|
||||
@@ -13,7 +13,7 @@ import { IContextKey, IContextKeyService } from '../../../../../platform/context
|
||||
import { IStorageService, StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js';
|
||||
import { IChatService } from '../../../chat/common/chatService/chatService.js';
|
||||
import { TerminalChatContextKeys } from './terminalChat.js';
|
||||
import { chatSessionResourceToId, LocalChatSessionUri } from '../../../chat/common/model/chatUri.js';
|
||||
import { LocalChatSessionUri } from '../../../chat/common/model/chatUri.js';
|
||||
import { isNumber, isString } from '../../../../../base/common/types.js';
|
||||
|
||||
const enum StorageKeys {
|
||||
@@ -180,11 +180,6 @@ export class TerminalChatService extends Disposable implements ITerminalChatServ
|
||||
return this._chatSessionResourceByTerminalInstance.get(instance);
|
||||
}
|
||||
|
||||
getChatSessionIdForInstance(instance: ITerminalInstance): string | undefined {
|
||||
const resource = this._chatSessionResourceByTerminalInstance.get(instance);
|
||||
return resource ? chatSessionResourceToId(resource) : undefined;
|
||||
}
|
||||
|
||||
isBackgroundTerminal(terminalToolSessionId?: string): boolean {
|
||||
if (!terminalToolSessionId) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user