Skip to content

Commit f046954

Browse files
authored
Default folder display name to cwd from session metadata (#3309)
* Default folder display name to cwd from session metadata * Updates
1 parent 0c65388 commit f046954

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/extension/chatSessions/vscode-node/copilotCLIChatSessionsContribution.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,10 +342,18 @@ export class CopilotCLIChatSessionContentProvider extends Disposable implements
342342
await trackSelectedFolderOrRepo(copilotcliSessionId, firstRepo, this.workspaceFolderService, this.copilotCLIWorktreeManagerService);
343343
}
344344
} else {
345+
const sessionWorkspaceFolder = await this.sessionService.getSessionWorkingDirectory(copilotcliSessionId, token);
346+
let folderName = sessionWorkspaceFolder ? basename(sessionWorkspaceFolder) : undefined;
347+
if (!folderName && this.workspaceService.getWorkspaceFolders().length === 1) {
348+
folderName = this.workspaceService.getWorkspaceFolderName(this.workspaceService.getWorkspaceFolders()[0]);
349+
}
350+
if (!folderName) {
351+
folderName = l10n.t('Unknown');
352+
}
345353
// This is an existing session without a worktree, display current workspace folder.
346354
options[REPOSITORY_OPTION_ID] = {
347355
id: '',
348-
name: this.workspaceService.getWorkspaceFolders().length === 1 ? this.workspaceService.getWorkspaceFolderName(this.workspaceService.getWorkspaceFolders()[0]) : l10n.t('Current Workspace'),
356+
name: folderName,
349357
icon: new vscode.ThemeIcon('repo'),
350358
locked: true
351359
};

0 commit comments

Comments
 (0)