@@ -104,8 +104,8 @@ export class TerminalService implements ITerminalService, Disposable {
104104 }
105105 const config = getConfiguration ( 'python' ) ;
106106 const pythonrcSetting = config . get < boolean > ( 'terminal.shellIntegration.enabled' ) ;
107- // const pythonVersion = ' await this.getPythonVersion()' ;
108- // const isPython313 = pythonVersion?.startsWith('3.13');
107+ const pythonVersion = await this . getPythonVersion ( ) ;
108+ const isPython313 = pythonVersion ?. startsWith ( '3.13' ) ;
109109
110110 if ( isPythonShell && ( ! pythonrcSetting || isWindows ( ) ) ) {
111111 // If user has explicitly disabled SI for Python, use sendText for inside Terminal REPL.
@@ -183,16 +183,16 @@ export class TerminalService implements ITerminalService, Disposable {
183183 } ) ;
184184 }
185185
186- // private async getPythonVersion(): Promise<string | undefined> {
187- // const pythonPath = this.serviceContainer
188- // .get<IConfigurationService>(IConfigurationService)
189- // .getSettings(this.options?.resource).pythonPath;
190- // const interpreterInfo =
191- // this.options?.interpreter ||
192- // (await this.serviceContainer
193- // .get<IInterpreterService>(IInterpreterService)
194- // .getInterpreterDetails(pythonPath));
195- // const pythonVersion = interpreterInfo && interpreterInfo.version ? interpreterInfo.version.raw : undefined;
196- // return pythonVersion;
197- // }
186+ private async getPythonVersion ( ) : Promise < string | undefined > {
187+ const pythonPath = this . serviceContainer
188+ . get < IConfigurationService > ( IConfigurationService )
189+ . getSettings ( this . options ?. resource ) . pythonPath ;
190+ const interpreterInfo =
191+ this . options ?. interpreter ||
192+ ( await this . serviceContainer
193+ . get < IInterpreterService > ( IInterpreterService )
194+ . getInterpreterDetails ( pythonPath ) ) ;
195+ const pythonVersion = interpreterInfo && interpreterInfo . version ? interpreterInfo . version . raw : undefined ;
196+ return pythonVersion ;
197+ }
198198}
0 commit comments