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 to execute code in the REPL broken #16010

Closed
1 of 2 tasks
rgbmrc opened this issue Sep 7, 2024 · 2 comments · Fixed by #16016
Closed
1 of 2 tasks

shift + enter to execute code in the REPL broken #16010

rgbmrc opened this issue Sep 7, 2024 · 2 comments · Fixed by #16016
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release triage-needed Issue needs to be triaged

Comments

@rgbmrc
Copy link

rgbmrc commented Sep 7, 2024

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

Since the last update of vscode and the jupter extension, shift+enter keyboard bindings do no longer work as expected.
When an interactive window is launched by executing some cells of some script_with_cells.py (on the side), pressing shift+enter (*) to execute a command directly from the input box of the interactive window does not work.

source

The Keyboard Shortcuts Troubleshooting suggests (logs below) this is due to ms-toolsai.jupyter.runcurrentcelladvance taking precedence over vscode's interactive.execute.

workaround

A workaround seem to be adding activeEditor != 'workbench.editor.interactive' to the "when" conditions of runcurrentcelladvance.

setup

(*) I have "interactiveWindow.executeWithShiftEnter" set to true in vscode. All my shift+enter keybindings are set to the default and managed by (source) either: system, the python extension, or the jupyter/jupyter keymap extensions.

VS Code Version

Version: 1.93.0 (user setup) Commit: 4849ca9bdf9666755eb463db297b69e5385090e3 Date: 2024-09-04T13:02:38.431Z Electron: 30.4.0 ElectronBuildId: 10073054 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631

Jupyter Extension Version

v2024.8.0

Jupyter logs

no output from "Jupyter Show Output" but I think the issue is still relevant to the jupyter extension since it relates to its settings

here is the output from vscode's "Window" after turning on "Developer: Toggle Keyboard Shortcuts Troubleshooting"



>>> with script_with_cells.py open on the side (cursor focus on interactive editor's input box)

2024-09-07 16:46:56.104 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-09-07 16:46:56.104 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-09-07 16:46:56.104 [info] [KeybindingService]: / Received  keydown event - modifiers: [shift], code: ShiftRight, keyCode: 16, key: Shift
2024-09-07 16:46:56.104 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: ShiftRight, keyCode: 4 ('Shift')
2024-09-07 16:46:56.104 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-09-07 16:46:56.351 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-09-07 16:46:56.352 [info] [KeybindingService]: | Resolving shift+Enter
2024-09-07 16:46:56.352 [info] [KeybindingService]: \ From 16 keybinding entries, matched jupyter.runcurrentcelladvance, when: editorTextFocus && isWorkspaceTrusted && jupyter.hascodecells && !editorHasSelection && !notebookEditorFocused, source: user extension ms-toolsai.jupyter.
2024-09-07 16:46:56.352 [info] [KeybindingService]: / Received  keydown event - modifiers: [shift], code: Enter, keyCode: 13, key: Enter
2024-09-07 16:46:56.352 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: Enter, keyCode: 3 ('Enter')
2024-09-07 16:46:56.352 [info] [KeybindingService]: | Resolving shift+Enter

2024-09-07 16:46:56.352 [info] [KeybindingService]: \ From 16 keybinding entries, matched jupyter.runcurrentcelladvance, when: editorTextFocus && isWorkspaceTrusted && jupyter.hascodecells && !editorHasSelection && !notebookEditorFocused, source: user extension ms-toolsai.jupyter.
2024-09-07 16:46:56.352 [info] [KeybindingService]: + Invoking command jupyter.runcurrentcelladvance.
2024-09-07 16:46:56.439 [info] [KeybindingService]: + Ignoring single modifier shift due to it being pressed together with other keys.



>>> with another tab on the side panel (script_with_cells.py open but not visible, focus as above)

2024-09-07 16:44:43.435 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-09-07 16:44:43.436 [info] [KeybindingService]: \ Keyboard event cannot be dispatched
2024-09-07 16:44:43.437 [info] [KeybindingService]: / Received  keydown event - modifiers: [shift], code: ShiftRight, keyCode: 16, key: Shift
2024-09-07 16:44:43.437 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: ShiftRight, keyCode: 4 ('Shift')
2024-09-07 16:44:43.438 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase.
2024-09-07 16:44:43.480 [info] [KeybindingService]: / Soft dispatching keyboard event
2024-09-07 16:44:43.481 [info] [KeybindingService]: | Resolving shift+Enter
2024-09-07 16:44:43.481 [info] [KeybindingService]: \ From 16 keybinding entries, matched interactive.execute, when: config.interactiveWindow.executeWithShiftEnter && activeEditor == 'workbench.editor.interactive', source: built-in.
2024-09-07 16:44:43.481 [info] [KeybindingService]: / Received  keydown event - modifiers: [shift], code: Enter, keyCode: 13, key: Enter
2024-09-07 16:44:43.481 [info] [KeybindingService]: | Converted keydown event - modifiers: [shift], code: Enter, keyCode: 3 ('Enter')
2024-09-07 16:44:43.481 [info] [KeybindingService]: | Resolving shift+Enter

2024-09-07 16:44:43.481 [info] [KeybindingService]: \ From 16 keybinding entries, matched interactive.execute, when: config.interactiveWindow.executeWithShiftEnter && activeEditor == 'workbench.editor.interactive', source: built-in.
2024-09-07 16:44:43.481 [info] [KeybindingService]: + Invoking command interactive.execute.
2024-09-07 16:44:43.552 [info] [KeybindingService]: + Ignoring single modifier shift due to it being pressed together with other keys.

Coding Language and Runtime Version

Python 3.11.9

Language Extension Version (if applicable)

v2024.14.0

Anaconda Version (if applicable)

conda 23.7.4

Running Jupyter locally or remotely?

Remote

@rgbmrc rgbmrc added the bug Issue identified by VS Code Team member as probable bug label Sep 7, 2024
@vs-code-engineering vs-code-engineering bot added the triage-needed Issue needs to be triaged label Sep 7, 2024
@amunger amunger reopened this Sep 9, 2024
@amunger amunger added the candidate Issue identified as probable candidate for fixing in the next release label Sep 9, 2024
@amunger
Copy link
Contributor

amunger commented Sep 9, 2024

regression from 1515b12

@amunger
Copy link
Contributor

amunger commented Sep 10, 2024

this should now be fixed in release.

@amunger amunger closed this as completed Sep 10, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug candidate Issue identified as probable candidate for fixing in the next release triage-needed Issue needs to be triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants