Vscode run file in repl terminal

Is there a way to run the current file in the current REPL terminal?
Something that does > include(“$currentfile”) in the REPL.
I am aware of the command Run File, but it reloads packages each time and becomes slow.
Doing ctrl+A ctrl+Enter does the job but in prints a lot of clutter in the terminal.

Thanks

The open terminals in VS Code are independent of the open files, since a terminal is opened with an associated directory, not file.

You can also use Alt+Enter instead of Ctrl+A / Ctrl+Enter. I don’t see any clutter with it, what do you mean by that?

I think he was referring to the difference of CTRL + Enter and ALT + Enter. Clutter being the lines which the terminal shows for the ctrl version.

What I personally would like to better understand is why CTRL + Enter tends to be very slow in Windows. I think tis may be related to the terminal which is used. I wonder why the default terminal is not able to print stuff “fast”.

ctrl+A ctrl+Enter prints each line of code before running so the program output get mixed with those lines.

I managed to run the whole file in the current REPL terminal by defining the following hotkey

{
        "command": "language-julia.executeCell",
        "key": "shift+enter",
        "when": "editorTextFocus"
},

It prints the whole file before running though.

Julia: Execute File is the command you want.
I have it mapped to alt+ctrl+enter.

2 Likes

I ended up with the following hotkey:

    {
        "key": "ctrl+enter",
        "command": "workbench.action.terminal.sendSequence",
        "args": {
          "text": "include(\"${file}\")\n"
        },
        "when": "editorTextFocus"
    },

but your solution is better.