Associate terminals with files

I created a repl in a file and now I’m trying to run some commands from a different file but it keeps opening a different terminal. How can I specify that these two files share the same terminal?

Can you post the code you’re trying to run, or some sort of minimum working example?

I don’t know how to reproduce the problem, just that it happens sometimes.

Is there a known way to associate certain files with certain terminals?

So you’re in VS Code and you are running some code from one file in an already-open REPL? And then you want to run code from a different file in the same REPL, but it opens a new REPL instead?


You can press ctrl+z in a terminal to put the current task in the background, and then spawn a new instance of Julia with julia. Then ctrl+z and fg will let you switch between them. I can’t imagine why you would want to do this, though.

My only advice is to open the “Keyboard Shortcuts” preferences pane (ctrl+k ctrl+s on Windows) in VS Code and search “julia repl”. You will see a range of possible Commands, and hopefully at least one will work for your use case.

How are you running your code?
All of these VSCode commands normally run in the current REPL and don’t open a new one, regardless of what file the code comes from:
(this menu is opened with ctrl+shift+p)

I tried ctrl+enter and alt+enter, which both exhibited the issue.