Search code examples
pythonsublimetext3sublimerepl

Re-use tab when running python code with SublimeREPL


In this question How to Run Python Code on SublimeREPL, an answer is given on how to use the usual Ctrl+b shortcut to run a python code using SublimeREPL within SublimeText.

The steps are simple:

1- Create a new empty file and paste into it the commands:

{
    "target": "run_existing_window_command", 
    "id": "repl_python_run",
    "file": "config/Python/Main.sublime-menu"
}

2- Save the file as:

/home/USER/.config/sublime-text-3/Packages/User/SublimeREPL-python.sublime-build

3- Go to your Python file tab and select:

Tools > Build System > SublimeREPL-python

After that the usual Ctrl+b shortcut will open a new tab where the code is executed.

The issue with this is that the tabs are not re-used. This means every time you hit Ctrl+b, a new tab opens up instead of the code running in the same tab that was opened before.

Is there a way to make SublimeREPL re-use the tab?


Solution

  • Unfortunatly you can't do that even on the latest version of SublimREPL. What you can do is open a ticket to the developper to ask for this implementation. But I'm not sure Sublime Text is able to do that.