From e9a5fab224539010fdcdbce881d00f221d314322 Mon Sep 17 00:00:00 2001 From: Ajay Kumbhare Date: Fri, 12 Jan 2024 00:01:19 +0530 Subject: [PATCH] fix: terminal renaming not functioning as expected in editor area #202267 --- src/vs/workbench/contrib/terminal/browser/terminalActions.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts index 5febebadd1b..3517feca516 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalActions.ts @@ -1902,7 +1902,9 @@ async function focusActiveTerminal(instance: ITerminalInstance, c: ITerminalServ async function renameWithQuickPick(c: ITerminalServicesCollection, accessor: ServicesAccessor, resource?: unknown) { let instance: ITerminalInstance | undefined = resource as ITerminalInstance; - if (!instance) { + // Check if the 'instance' does not exist or if 'instance.rename' is not defined + if (!instance || !instance?.rename) { + // If not, obtain the resource instance using 'getResourceOrActiveInstance' instance = getResourceOrActiveInstance(c, resource); }