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 integrated python starts in shell #22499

Closed
mRcSchwering opened this issue Nov 20, 2023 · 2 comments
Closed

Shift + Enter integrated python starts in shell #22499

mRcSchwering opened this issue Nov 20, 2023 · 2 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@mRcSchwering
Copy link

Type: Bug

When I have my cursor in a .py file on a line e.g. import math and click shift + enter the following happens:

  1. Integrated terminal opens with shell running
  2. conda activate ... command is executed in shell (my environment)
  3. import math is run (the .py line) in shell (which eventually fails)
  4. Python terminal is opened

import math (the selected line) is executed before the python terminal was opened.
This is quite annoying because a import statement in shell actually does something (import-im6.q16).

Extension version: 2023.20.0
VS Code version: Code 1.84.2 (1a5daa3a0231a0fbba4f14db7ec463cf99d7768e, 2023-11-09T10:50:47.800Z)
OS version: Linux x64 6.5.0-10008-tuxedo
Modes:

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz (8 x 3300)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 1, 0, 0
Memory (System) 15.31GB (11.56GB free)
Process Argv . --crash-reporter-id 7b9518d5-1aa3-4d00-a3a3-f30d4eeeb444
Screen Reader no
VM 0%
DESKTOP_SESSION plasma
XDG_CURRENT_DESKTOP KDE
XDG_SESSION_DESKTOP KDE
XDG_SESSION_TYPE x11
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
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30880072
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
3biah626:30602489
89544117:30613380
showlangstatbar:30737416
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30887144
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
synctok:30869157
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixtcf:30871695
pythonregdiag2:30871582
pyreplss1:30886140
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
dsvsc016cf:30886111
dsvsc017cf:30886113
dsvsc018cf:30886115
aa_t_chat:30882232

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Nov 20, 2023
@anthonykim1
Copy link

Hello, @mRcSchwering
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 Nov 20, 2023
@mRcSchwering
Copy link
Author

I added it to user/settings.json and now it works

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Nov 20, 2023
@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

3 participants