@@ -20,12 +20,9 @@ import {
2020 TerminalShellType ,
2121} from './types' ;
2222import { traceVerbose } from '../../logging' ;
23- import { getConfiguration } from '../vscodeApis/workspaceApis' ;
2423import { useEnvExtension } from '../../envExt/api.internal' ;
2524import { ensureTerminalLegacy } from '../../envExt/api.legacy' ;
2625import { sleep } from '../utils/async' ;
27- import { isWindows } from '../utils/platform' ;
28- import { getPythonMinorVersion } from '../../repl/replUtils' ;
2926
3027@injectable ( )
3128export 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