Skip to content

Commit 03f82dc

Browse files
authored
fix: normalize path for UI display when removing virtual environments (#853)
fixes #484
1 parent 3755f50 commit 03f82dc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/managers/builtin/venvUtils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getWorkspacePersistentState } from '../../common/persistentState';
1010
import { pickEnvironmentFrom } from '../../common/pickers/environments';
1111
import { EventNames } from '../../common/telemetry/constants';
1212
import { sendTelemetryEvent } from '../../common/telemetry/sender';
13+
import { normalizePath } from '../../common/utils/pathUtils';
1314
import {
1415
showErrorMessage,
1516
showInputBox,
@@ -501,8 +502,11 @@ export async function removeVenv(environment: PythonEnvironment, log: LogOutputC
501502
? path.dirname(path.dirname(environment.environmentPath.fsPath))
502503
: environment.environmentPath.fsPath;
503504

505+
// Normalize path for UI display - ensure forward slashes on Windows
506+
const displayPath = normalizePath(envPath);
507+
504508
const confirm = await showWarningMessage(
505-
l10n.t('Are you sure you want to remove {0}?', envPath),
509+
l10n.t('Are you sure you want to remove {0}?', displayPath),
506510
{
507511
modal: true,
508512
},
@@ -529,7 +533,7 @@ export async function removeVenv(environment: PythonEnvironment, log: LogOutputC
529533
return result;
530534
}
531535

532-
traceInfo(`User cancelled removal of virtual environment: ${envPath}`);
536+
traceInfo(`User cancelled removal of virtual environment: ${displayPath}`);
533537
return false;
534538
}
535539

0 commit comments

Comments
 (0)