Send data to debug console instead of REPL in python vscode

08-08-2022

In debug mode we want to send data to the debug consol rather than the Python repl. Using the below snippet the following keys will be available:

  • ctrl+2 - maps to debug console
  • ctrl+enter - sends text to debug console when in debug mode
    {
        "key": "ctrl+alt+2",
        "command": "workbench.action.focusSecondEditorGroup"
    },
    {
        "key": "ctrl+2",
        "command": "-workbench.action.focusSecondEditorGroup"
    },
    {
        "key": "ctrl+2",
        "command": "workbench.debug.action.toggleRepl",
        "when": "workbench.panel.repl.view.active"
    },
    {
        "key": "ctrl+shift+y",
        "command": "-workbench.debug.action.toggleRepl",
        "when": "workbench.panel.repl.view.active"
    },
    {
        "key": "ctrl+enter",
        "command": "editor.debug.action.selectionToRepl",
        "when":"editorFocus && !findInputFocussed && !replaceInputFocussed && editorLangId == 'python' && inDebugMode"
    },