mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 10:19:02 +00:00
still show focus action even if no command so it's available for basic, none execute strategies (#274893)
fixes #274876
This commit is contained in:
@@ -199,7 +199,6 @@ export class ChatTerminalToolProgressPart extends BaseChatToolInvocationSubPart
|
|||||||
const actionBar = this._actionBar.value;
|
const actionBar = this._actionBar.value;
|
||||||
const isTerminalHidden = this._terminalChatService.isBackgroundTerminal(terminalToolSessionId);
|
const isTerminalHidden = this._terminalChatService.isBackgroundTerminal(terminalToolSessionId);
|
||||||
const command = this._getResolvedCommand(terminalInstance);
|
const command = this._getResolvedCommand(terminalInstance);
|
||||||
if (command) {
|
|
||||||
const existingFocus = this._focusAction.value;
|
const existingFocus = this._focusAction.value;
|
||||||
if (existingFocus) {
|
if (existingFocus) {
|
||||||
const existingIndex = actionBar.viewItems.findIndex(item => item.action === existingFocus);
|
const existingIndex = actionBar.viewItems.findIndex(item => item.action === existingFocus);
|
||||||
@@ -212,7 +211,6 @@ export class ChatTerminalToolProgressPart extends BaseChatToolInvocationSubPart
|
|||||||
actionBar.push(focusAction, { icon: true, label: false, index: 0 });
|
actionBar.push(focusAction, { icon: true, label: false, index: 0 });
|
||||||
this._ensureShowOutputAction();
|
this._ensureShowOutputAction();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private _ensureShowOutputAction(): void {
|
private _ensureShowOutputAction(): void {
|
||||||
if (!this._actionBar.value) {
|
if (!this._actionBar.value) {
|
||||||
@@ -262,9 +260,7 @@ export class ChatTerminalToolProgressPart extends BaseChatToolInvocationSubPart
|
|||||||
const commandDetectionListener = this._register(new MutableDisposable<IDisposable>());
|
const commandDetectionListener = this._register(new MutableDisposable<IDisposable>());
|
||||||
const tryResolveCommand = async (): Promise<ITerminalCommand | undefined> => {
|
const tryResolveCommand = async (): Promise<ITerminalCommand | undefined> => {
|
||||||
const resolvedCommand = this._resolveCommand(terminalInstance);
|
const resolvedCommand = this._resolveCommand(terminalInstance);
|
||||||
if (resolvedCommand?.endMarker) {
|
|
||||||
await this._addActions(terminalInstance, this._terminalData.terminalToolSessionId!);
|
await this._addActions(terminalInstance, this._terminalData.terminalToolSessionId!);
|
||||||
}
|
|
||||||
return resolvedCommand;
|
return resolvedCommand;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -544,7 +540,7 @@ class ToggleChatTerminalOutputAction extends Action implements IAction {
|
|||||||
export class FocusChatInstanceAction extends Action implements IAction {
|
export class FocusChatInstanceAction extends Action implements IAction {
|
||||||
constructor(
|
constructor(
|
||||||
private readonly _instance: ITerminalInstance,
|
private readonly _instance: ITerminalInstance,
|
||||||
private readonly _command: ITerminalCommand,
|
private readonly _command: ITerminalCommand | undefined,
|
||||||
isTerminalHidden: boolean,
|
isTerminalHidden: boolean,
|
||||||
@ITerminalService private readonly _terminalService: ITerminalService,
|
@ITerminalService private readonly _terminalService: ITerminalService,
|
||||||
@ITerminalEditorService private readonly _terminalEditorService: ITerminalEditorService,
|
@ITerminalEditorService private readonly _terminalEditorService: ITerminalEditorService,
|
||||||
@@ -568,6 +564,8 @@ export class FocusChatInstanceAction extends Action implements IAction {
|
|||||||
}
|
}
|
||||||
this._terminalService.setActiveInstance(this._instance);
|
this._terminalService.setActiveInstance(this._instance);
|
||||||
await this._instance?.focusWhenReady(true);
|
await this._instance?.focusWhenReady(true);
|
||||||
|
if (this._command) {
|
||||||
this._instance.xterm?.markTracker.revealCommand(this._command);
|
this._instance.xterm?.markTracker.revealCommand(this._command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user