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

Shift+Enter on .py sends code before 'python.exe' #22583

Closed
gah-bo opened this issue Dec 1, 2023 · 2 comments
Closed

Shift+Enter on .py sends code before 'python.exe' #22583

gah-bo opened this issue Dec 1, 2023 · 2 comments
Assignees
Labels
area-repl triage-needed Needs assignment to the proper sub-team

Comments

@gah-bo
Copy link

gah-bo commented Dec 1, 2023

Type: Bug

Shift+Enter (S+E) on .py (highlighted line) opens a new terminal and inputs highlighted code BEFORE initializing python.exe.

I can get code to run with S+E by doing S+E on a line, getting an error because python isn't initialized, then python.exe is initialized automatically, and I can then do S+E to actually run the code.

VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:51:52.184Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs AMD Ryzen 7 5800X3D 8-Core Processor (16 x 3394)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.93GB (21.69GB free)
Process Argv --crash-reporter-id c026e9aa-1501-4d7a-a6b4-8b4dee4f3d7e
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
ruff cha 2023.50.0
githistory don 0.6.20
godot-tools gee 1.3.1
copilot Git 1.139.0
copilot-chat Git 0.10.2
rainbow-csv mec 3.8.0
python ms- 2023.20.0
vscode-pylance ms- 2023.11.10
jupyter ms- 2023.10.1100000000
jupyter-keymap ms- 1.1.2
jupyter-renderers ms- 1.0.17
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
material-icon-theme PKi 4.32.0
sas-lsp SAS 1.5.0
material-theme zhu 3.16.2
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931cf:30280410
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
pythonvs932:30410667
py29gd2263:30899288
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
282f8724:30602487
89544117:30613380
a9j8j154:30646983
showlangstatbar:30737416
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30910334
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30902429
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
dsvsc019cf:30909685

@gah-bo gah-bo changed the title Shift+Enter on .py sends code BEFORE initializing python.exe Shift+Enter on .py sends code before 'python.exe' Dec 1, 2023
@joyceerhl joyceerhl transferred this issue from microsoft/vscode Dec 1, 2023
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 1, 2023
@anthonykim1
Copy link

Can you try opting into "pythonTerminalEnvVarActivation" by adding

"python.experiments.optInto": ["pythonTerminalEnvVarActivation"],

in your settings.json and see if you still get the behavior? Thanks

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Dec 13, 2023
@gah-bo
Copy link
Author

gah-bo commented Dec 14, 2023

Can you try opting into "pythonTerminalEnvVarActivation" by adding

"python.experiments.optInto": ["pythonTerminalEnvVarActivation"],

in your settings.json and see if you still get the behavior? Thanks

That did it! Thank you

@gah-bo gah-bo closed this as completed Dec 14, 2023
@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Dec 14, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-repl triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants