File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/client/common/terminal Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +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' ;
2829
2930@injectable ( )
3031export class TerminalService implements ITerminalService , Disposable {
@@ -108,7 +109,17 @@ export class TerminalService implements ITerminalService, Disposable {
108109
109110 const config = getConfiguration ( 'python' ) ;
110111 const pythonrcSetting = config . get < boolean > ( 'terminal.shellIntegration.enabled' ) ;
111- if ( ( isPythonShell && ! pythonrcSetting ) || ( isPythonShell && isWindows ( ) ) ) {
112+
113+ // Need to check for if Python version is >= 3.13 since we have turned off SI on python side.
114+ // Because we are not sending explicit commandline info to core, it will inject ^C. (We want to avoid)
115+ if ( this . options && this . options . resource ) {
116+ const pythonVersion = await getActiveInterpreter (
117+ this . options . resource ,
118+ this . serviceContainer . get < IInterpreterService > ( IInterpreterService ) ,
119+ ) ;
120+ const minorVersion = pythonVersion ?. version ?. minor ;
121+
122+ if ( ( isPythonShell && ! pythonrcSetting ) || ( isPythonShell && isWindows ( ) ) || ( ( minorVersion ?? 0 ) >= 13 ) ) {
112123 // If user has explicitly disabled SI for Python, use sendText for inside Terminal REPL.
113124 terminal . sendText ( commandLine ) ;
114125 return undefined ;
You can’t perform that action at this time.
0 commit comments