Skip to content
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

do not use shell integration for Python subshell if Python setting is disabled #24418

Merged
merged 9 commits into from
Nov 12, 2024

Conversation

anthonykim1
Copy link

@anthonykim1 anthonykim1 commented Nov 12, 2024

Resolves: #24422
This PR will resolve KeyboardInterrupt from happening when shell integration is enabled on upstream shell but not on the sub-shell (Python)

If the user has explicitly set their Python shell integration setting to false,
then do not use shell integration inside the sub-shell (Python Terminal REPL in this case),
regardless of upper shell integration status (Terminal shell integration setting in vscode).

We should still be safe from manual installation of shell integration with the setting disabled(https://code.visualstudio.com/docs/terminal/shell-integration#_manual-installation)
since we are still reading the value of terminal.shellIntegration, and looking at Python's shell integration setting first to begin with.

@anthonykim1 anthonykim1 added bug Issue identified by VS Code Team member as probable bug area-terminal labels Nov 12, 2024
@anthonykim1 anthonykim1 added this to the November 2024 milestone Nov 12, 2024
@anthonykim1 anthonykim1 self-assigned this Nov 12, 2024
@anthonykim1
Copy link
Author

separated this out from #24416 (comment)

@anthonykim1 anthonykim1 merged commit 542ff38 into microsoft:main Nov 12, 2024
46 checks passed
anthonykim1 added a commit that referenced this pull request Dec 4, 2024
Related: #24418 
Further resolves:
#24422
Shell integration does not exist on windows python repl so dont use
execute command on python subshell in this case.

This will prevent keyboard interrupt from happening even when setting
for shell integration is enabled for python shell (which is currently
only supported on mac and linux)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-terminal 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'
2 participants