vscode-jupyter: `shift + enter` broken again

Issue Type: Bug

reference: https://github.com/microsoft/vscode-python/issues/3397 https://github.com/microsoft/vscode-python/issues/5621

Below is my current keyboard shortcuts json, which was working just fine prior to the most recent vscode update.

Before, when:

  1. the editor had focus,
  2. no text was selected in the editor,
  3. in a file with #%% code ‘cell’ markers,

the entire ‘cell’ would run in the Python Interactive Pane and the focus would advance to the next ‘cell’ in the editor.

Now after the most recent vscode update and given the same conditions, only the line that the cursor is currently on is run in the Python Interactive Pane.

[
    {
        "key": "ctrl+shift+alt+enter",
        "command": "python.execSelectionInTerminal",
        "when": "editorFocus && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "-python.execSelectionInTerminal",
        "when": "editorFocus && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "python.datascience.execSelectionInteractive",
        "when": "editorFocus && !python.datascience.hascodecells && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "python.datascience.execSelectionInteractive",
        "when": "editorFocus && python.datascience.hascodecells && !findInputFocussed && !python.datascience.ownsSelection && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "python.datascience.execSelectionInteractive",
        "when": "editorFocus && python.datascience.featureenabled && python.datascience.ownsSelection && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python'"
    },
    {
        "key": "shift+enter",
        "command": "python.datascience.runcurrentcelladvance",
        "when": "editorFocus && python.datascience.featureenabled && python.datascience.hascodecells && !editorHasSelection && editorLangId == 'python'"
    }
]

Extension version: 2019.6.24221 VS Code version: Code 1.36.1 (2213894ea0415ee8c85c5eea0d0ff81ecc191529, 2019-07-08T22:59:35.033Z) OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel® Core™ i5-6300U CPU @ 2.40GHz (4 x 2496)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.88GB (8.83GB free)
Process Argv
Screen Reader no
VM 0%

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 34 (16 by maintainers)

Most upvoted comments

Run current cell needs a ‘cell’. At least right now. We could probably redefine it if there are no cells, just use the current line or current selection. Seems like it would be nice to just shift+enter your way through a file.

@joolius it’s not a problem. I’d love to get to bottom of why shift+enter doesn’t work.

The short answer, no. There’s no way to say what a code cell in a python file is otherwise.

We support not using them though. On a file without #%%, shift+enter will behave like Hydrogen. If no selection, the current line is sent. If selection, the selection is sent. However you have to flip the following setting (otherwise shift+enter sends to the normal terminal) image