Skip to content

Fix) Prevent keyboard interrupt for Python3.13 REPL non-Windows #24555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 9, 2024

Conversation

anthonykim1
Copy link

@anthonykim1 anthonykim1 commented Dec 9, 2024

Further resolves: #24422
Prevent keyboard interrupt for Mac and Linux when using Python3.13

Having Python3.13 as interpreter choice and then enabling shell integration where it is normally supported (we disabled temporarily for Python3.13 due to python/cpython#126131), lead to edge case.

So although we don't override user's PS1 in Python side after checking Python3.13 is selected, we were not aware of this in typescript side, leading to wrongly using executeCommand inside Python terminal REPL (Python3.13 IDLE), instead of sendText.

@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-repl labels Dec 9, 2024
@anthonykim1 anthonykim1 added this to the November 2024 milestone Dec 9, 2024
@anthonykim1 anthonykim1 self-assigned this Dec 9, 2024
@anthonykim1 anthonykim1 closed this Dec 9, 2024
@anthonykim1 anthonykim1 reopened this Dec 9, 2024
@anthonykim1 anthonykim1 removed this from the November 2024 milestone Dec 9, 2024
@anthonykim1 anthonykim1 marked this pull request as ready for review December 9, 2024 07:22
@anthonykim1 anthonykim1 enabled auto-merge (squash) December 9, 2024 07:22
@vs-code-engineering vs-code-engineering bot added this to the February 2025 milestone Dec 9, 2024
@anthonykim1 anthonykim1 removed this from the February 2025 milestone Dec 9, 2024
@anthonykim1 anthonykim1 merged commit faf37e2 into microsoft:main Dec 9, 2024
46 checks passed
const config = getConfiguration('python');
const pythonrcSetting = config.get<boolean>('terminal.shellIntegration.enabled');
if ((isPythonShell && !pythonrcSetting) || (isPythonShell && isWindows())) {

let isPython313 = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a bug here isPython313 is not set in the code below.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what happened but I meant to set it here:
isPython313 = pythonVersion?.sysVersion?.startsWith('3.13');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KeyboardInterrupt When Running Selection/Line in Python Terminal with 'Shift+Enter'
3 participants