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 / Run selected line in terminal issue. #24312

Closed
azharmajeed-cml opened this issue Oct 14, 2024 · 6 comments
Closed

Shift + Enter / Run selected line in terminal issue. #24312

azharmajeed-cml opened this issue Oct 14, 2024 · 6 comments
Assignees
Labels
area-repl area-terminal info-needed Issue requires more information from poster

Comments

@azharmajeed-cml
Copy link

azharmajeed-cml commented Oct 14, 2024

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.94.2
  • OS Version: Windows 11

Steps to Reproduce:

  1. Run python code with shift enter to run in the terminal.
  2. Ex: if i run import pandas as pd, by running shift enter, or right click with the mouse and select the run selected line in interactive terminal, the first letter of the line does not get included and it ends up throwing an error.

This was working fine until a couple of days ago.
Please let me know if you need any more information.

Image

@amunger
Copy link

amunger commented Oct 14, 2024

Can you run Developer: Toggle Keyboard Shortcuts Troubleshooting before pressing shift+enter to get the actual command being run in the log - There should be a line like [info] [KeybindingService]: + Invoking command python.execInREPL in the output panel.

@amunger amunger added the info-needed Issue requires more information from poster label Oct 14, 2024
@azharmajeed-cml
Copy link
Author

There is an Invoking command python.execSelectionInTerminal line

2024-10-16 10:35:15.561 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-16 10:35:15.562 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-10-16 10:35:15.562 [info] [KeybindingService]: / Received keydown event - modifiers: [shift], code: ShiftRight, keyCode: 16, key: Shift
2024-10-16 10:35:15.562 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: ShiftRight, keyCode: 4 ('Shift')
2024-10-16 10:35:15.562 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-10-16 10:35:15.659 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-16 10:35:15.659 [info] [KeybindingService]: | Resolving shift+Enter
2024-10-16 10:35:15.659 [info] [KeybindingService]: \ From 16 keybinding entries, matched python.execSelectionInTerminal, when: editorTextFocus && !findInputFocussed && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python', source: user extension ms-python.python.
2024-10-16 10:35:15.660 [info] [KeybindingService]: / Received keydown event - modifiers: [shift], code: Enter, keyCode: 13, key: Enter
2024-10-16 10:35:15.660 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: Enter, keyCode: 3 ('Enter')
2024-10-16 10:35:15.660 [info] [KeybindingService]: | Resolving shift+Enter
2024-10-16 10:35:15.660 [info] [KeybindingService]: \ From 16 keybinding entries, matched python.execSelectionInTerminal, when: editorTextFocus && !findInputFocussed && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python', source: user extension ms-python.python.
2024-10-16 10:35:15.660 [info] [KeybindingService]: + Invoking command python.execSelectionInTerminal.
2024-10-16 10:35:15.769 [info] [KeybindingService]: + Ignoring single modifier shift due to it being pressed together with other keys.
2024-10-16 10:35:23.967 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-10-16 10:35:23.998 [info] [KeybindingService]: | Resolving Enter
2024-10-16 10:35:23.999 [info] [KeybindingService]: \ From 34 keybinding entries, no when clauses matched the context.
2024-10-16 10:35:23.999 [info] [KeybindingService]: / Received keydown event - modifiers: [], code: Enter, keyCode: 13, key: Enter
2024-10-16 10:35:23.999 [info] [KeybindingService]: | Converted keydown event - modifiers: [], code: Enter, keyCode: 3 ('Enter')
2024-10-16 10:35:23.999 [info] [KeybindingService]: | Resolving Enter
2024-10-16 10:35:23.999 [info] [KeybindingService]: \ From 34 keybinding entries, no when clauses matched the context.

@amunger amunger transferred this issue from microsoft/vscode Oct 16, 2024
@amunger amunger assigned anthonykim1 and unassigned amunger Oct 16, 2024
@amunger amunger removed the info-needed Issue requires more information from poster label Oct 16, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Oct 16, 2024
@amunger amunger changed the title Shift + Enter / Run selected line in interactive window issue. Shift + Enter / Run selected line in terminal issue. Oct 16, 2024
@anthonykim1
Copy link

@azharmajeed-cml thanks for filing this issue. Which version of Python are you on? and also which version of the Python Extension are you running?

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 16, 2024
@azharmajeed-cml
Copy link
Author

Hi @anthonykim1 I am running Python 3.11.2 and the extension's version is v2024.16.1

@github-actions github-actions bot removed the info-needed Issue requires more information from poster label Oct 17, 2024
@anthonykim1
Copy link

@azharmajeed-cml Interesting, are you able to post a short video example on this?
Also curious what happens if you explicitly highlight the code you want to execute and then run execute command via shift+enter

@github-actions github-actions bot added the info-needed Issue requires more information from poster label Oct 21, 2024
@anthonykim1 anthonykim1 added area-terminal area-repl and removed triage-needed Needs assignment to the proper sub-team labels Oct 22, 2024
Copy link

Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on, then we will be happy to re-open this issue to pick up where we left off.

Happy Coding!

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

No branches or pull requests

3 participants