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

Missing first character for execute selection #24296

Closed
tttienthinh opened this issue Oct 13, 2024 · 5 comments
Closed

Missing first character for execute selection #24296

tttienthinh opened this issue Oct 13, 2024 · 5 comments
Assignees
Labels
area-repl info-needed Issue requires more information from poster

Comments

@tttienthinh
Copy link

Type: Bug

Behaviour

KeyboardInterrupt
>>> mport pandas as pd

Instead of

KeyboardInterrupt
>>> import pandas as pd

while selecting "import pandas as pd" and doing SHIFT + Enter

Steps to reproduce:

  1. Install the Python Extension on VS Code (v2024.16.0 or v2024.16.0)
  2. Create a Python file (.py)
  3. Write some python code "import pandas as pd"
  4. Select it and run it with Shift + Enter
  5. You get "mport pandas as pd" in the terminal

Diagnostic data

To solve the problem, downgrade to (v2024.14.1 or under) by :
Going to Extension > Right click on Python extension > "Install Specific Version > 2024.14.1 > Restart extension

Extension version: 2024.16.1
VS Code version: Code 1.94.2 (384ff7382de624fb94dbaf6da11977bba1ecd427, 2024-10-09T16:08:44.566Z)
OS version: Windows_NT x64 10.0.22631
Modes:

  • Python version (& distribution if applicable, e.g. Anaconda): 3.12.2
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
User Settings


languageServer: "Pylance"

Installed Extensions
Extension Name Extension Id Version
JavaScript Debugger ms-vscode.js-debug 1.94.0
JavaScript Debugger Companion Extension ms-vscode.js-debug-companion 1.1.3
Pylance ms-python.vscode-pylance 2024.10.1
Python ms-python.python 2024.16.1
Python Debugger ms-python.debugpy 2024.10.0
Table Visualizer for JavaScript Profiles ms-vscode.vscode-js-profile-table 1.0.10
System Info
Item Value
CPUs 13th Gen Intel(R) Core(TM) i7-1360P (16 x 2611)
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
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
Load (avg) undefined
Memory (System) 15.65GB (6.30GB free)
Process Argv --crash-reporter-id d4f94bd2-b3d0-476a-a8e2-4ee326151f29
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:31024239
c4g48928:30535728
azure-dev_surveyone:30548225
2i9eh265:30646982
962ge761:30959799
pythongtdpath:30769146
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30995554
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
jg8ic977:31013176
a69g1124:31058053
dvdeprecation:31068756
dwnewjupytercf:31046870
impr_priority:31102340
nativerepl1:31139838
refactort:31108082
pythonrstrctxt:31112756
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
autoexpandse:31146404
iacca2:31156134
notype1:31157159
5fd0e150:31155592

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 13, 2024
@anthonykim1
Copy link

are you executing after you have explicitly highlighted the code you are sending or just shift+entering on the line without any highlights?

@anthonykim1 anthonykim1 added area-repl and removed triage-needed Needs assignment to the proper sub-team labels Oct 14, 2024
@anthonykim1 anthonykim1 self-assigned this Oct 14, 2024
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 14, 2024
@tttienthinh
Copy link
Author

tttienthinh commented Oct 14, 2024 via email

@karthiknadig
Copy link
Member

@tttienthinh Are you using powershell, cmd, or any other terminal shell?

@tttienthinh
Copy link
Author

I am using the PowerShell Terminal of VS Code I guess. This is what I get when I Shift+Enter for the first time :

PS C:\Users\...> & "C:/Program Files/Python312/python.exe"
Python 3.12.2 (tags/v3.12.2:6abddd9, Feb  6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

@anthonykim1
Copy link

I feel like this might be related to: #24422 (comment) looking at the KeyboardInterrupt that is mentioned here.
Can you go to the referenced link and follow the steps to disable terminal shell integration and see if that helps?

Let me know how this goes, thanks!

@anthonykim1 anthonykim1 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-repl info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants