Turns this functionality I was asking for is already natively supported in vscode, as noted by @tshort in a related julia-vscode feature request.
So all that is needed is to retrieve the json id from the palette command above, and add it to ~/.config/Code/User/keybindings.json
:
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.runSelectedText",
"when": "editorTextFocus && editorLangId == 'juliamarkdown'"
},
{
"key": "ctrl+enter",
"command": "workbench.action.terminal.runSelectedText",
"when": "editorTextFocus && editorLangId == 'julia'"
}
I’ve just confirmed this works within a slurm interactive session on a compute node as in (2) above.