Skip to content

Commit 59a5bb6

Browse files
authored
Merge branch 'main' into resonant-duck
2 parents 78865d0 + 6ec13c7 commit 59a5bb6

File tree

7 files changed

+303
-60
lines changed

7 files changed

+303
-60
lines changed

build/azure-pipeline.stable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ extends:
128128
project: 'Monaco'
129129
definition: 593
130130
buildVersionToDownload: 'latestFromBranch'
131-
branchName: 'refs/heads/release/2025.14'
131+
branchName: 'refs/heads/release/2025.16'
132132
targetPath: '$(Build.SourcesDirectory)/python-env-tools/bin'
133133
artifactName: 'bin-$(buildTarget)'
134134
itemPattern: |

package-lock.json

Lines changed: 34 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "Python language support with extension access points for IntelliSense (Pylance), Debugging (Python Debugger), linting, formatting, refactoring, unit tests, and more.",
5-
"version": "2025.19.0-dev",
5+
"version": "2025.21.0-dev",
66
"featureFlags": {
77
"usingNewInterpreterStorage": true
88
},

src/client/chat/utils.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,29 @@ import { JUPYTER_EXTENSION_ID, NotebookCellScheme } from '../common/constants';
1919
import { dirname, join } from 'path';
2020
import { resolveEnvironment, useEnvExtension } from '../envExt/api.internal';
2121
import { ErrorWithTelemetrySafeReason } from '../common/errors/errorUtils';
22+
import { getWorkspaceFolders } from '../common/vscodeApis/workspaceApis';
2223

2324
export interface IResourceReference {
2425
resourcePath?: string;
2526
}
2627

2728
export function resolveFilePath(filepath?: string): Uri | undefined {
2829
if (!filepath) {
29-
return workspace.workspaceFolders ? workspace.workspaceFolders[0].uri : undefined;
30+
const folders = getWorkspaceFolders() ?? [];
31+
return folders.length > 0 ? folders[0].uri : undefined;
3032
}
31-
// starts with a scheme
32-
try {
33-
return Uri.parse(filepath);
34-
} catch (e) {
35-
return Uri.file(filepath);
33+
// Check if it's a URI with a scheme (contains "://")
34+
// This handles schemes like "file://", "vscode-notebook://", etc.
35+
// But avoids treating Windows drive letters like "C:" as schemes
36+
if (filepath.includes('://')) {
37+
try {
38+
return Uri.parse(filepath);
39+
} catch {
40+
return Uri.file(filepath);
41+
}
3642
}
43+
// For file paths (Windows with drive letters, Unix absolute/relative paths)
44+
return Uri.file(filepath);
3745
}
3846

3947
/**

src/client/common/terminal/service.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,9 @@ import {
2020
TerminalShellType,
2121
} from './types';
2222
import { traceVerbose } from '../../logging';
23-
import { getConfiguration } from '../vscodeApis/workspaceApis';
2423
import { useEnvExtension } from '../../envExt/api.internal';
2524
import { ensureTerminalLegacy } from '../../envExt/api.legacy';
2625
import { sleep } from '../utils/async';
27-
import { isWindows } from '../utils/platform';
28-
import { getPythonMinorVersion } from '../../repl/replUtils';
2926

3027
@injectable()
3128
export class TerminalService implements ITerminalService, Disposable {
@@ -108,20 +105,10 @@ export class TerminalService implements ITerminalService, Disposable {
108105
await promise;
109106
}
110107

111-
const config = getConfiguration('python');
112-
const pythonrcSetting = config.get<boolean>('terminal.shellIntegration.enabled');
113-
114-
const minorVersion = this.options?.resource
115-
? await getPythonMinorVersion(
116-
this.options.resource,
117-
this.serviceContainer.get<IInterpreterService>(IInterpreterService),
118-
)
119-
: undefined;
120-
121-
if ((isPythonShell && !pythonrcSetting) || (isPythonShell && isWindows()) || (minorVersion ?? 0) >= 13) {
122-
// If user has explicitly disabled SI for Python, use sendText for inside Terminal REPL.
108+
if (isPythonShell) {
109+
// Prevent KeyboardInterrupt in Python REPL: https://github.com/microsoft/vscode-python/issues/25468
123110
terminal.sendText(commandLine);
124-
return undefined;
111+
traceVerbose(`Python REPL detected, sendText: ${commandLine}`);
125112
} else if (terminal.shellIntegration) {
126113
const execution = terminal.shellIntegration.executeCommand(commandLine);
127114
traceVerbose(`Shell Integration is enabled, executeCommand: ${commandLine}`);

0 commit comments

Comments
 (0)