@@ -25,7 +25,7 @@ import { useEnvExtension } from '../../envExt/api.internal';
2525import { ensureTerminalLegacy } from '../../envExt/api.legacy' ;
2626import { sleep } from '../utils/async' ;
2727import { isWindows } from '../utils/platform' ;
28- import { getActiveInterpreter } from '../../repl/replUtils' ;
28+ import { getPythonMinorVersion } from '../../repl/replUtils' ;
2929
3030@injectable ( )
3131export class TerminalService implements ITerminalService , Disposable {
@@ -110,16 +110,12 @@ export class TerminalService implements ITerminalService, Disposable {
110110 const config = getConfiguration ( 'python' ) ;
111111 const pythonrcSetting = config . get < boolean > ( 'terminal.shellIntegration.enabled' ) ;
112112
113- let minorVersion : number | undefined ;
114- // Need to check for if Python version is >= 3.13 since we have turned off SI on python side.
115- // Because we are not sending explicit commandline info to core, it will inject ^C. (We want to avoid)
116- if ( this . options && this . options . resource ) {
117- const pythonVersion = await getActiveInterpreter (
118- this . options . resource ,
119- this . serviceContainer . get < IInterpreterService > ( IInterpreterService ) ,
120- ) ;
121- minorVersion = pythonVersion ?. version ?. minor ;
122- }
113+ const minorVersion = this . options ?. resource
114+ ? await getPythonMinorVersion (
115+ this . options . resource ,
116+ this . serviceContainer . get < IInterpreterService > ( IInterpreterService ) ,
117+ )
118+ : undefined ;
123119
124120 if ( ( isPythonShell && ! pythonrcSetting ) || ( isPythonShell && isWindows ( ) ) || ( minorVersion ?? 0 ) >= 13 ) {
125121 // If user has explicitly disabled SI for Python, use sendText for inside Terminal REPL.
0 commit comments