title: SublimeREPL: How can I automatically close (or restart) the previous console when rebuilding?
body: <p>I recently switched to using Sublime Text as my Python IDE, and have since installed REPL. In order to re-use the same tab when running my code, I made a few edits <code>repl_python_run</code> command in my <code>SublimeREPL\config\Python\Main.sublime-menu</code> directory. (instructions here: <a href="https://github.com/wuub/SublimeREPL/issues/481" rel="nofollow noreferrer">Re-use tab ... SublimeREPL</a></p>
  
  <p>This works well, and when I re-build a script (<code>cmd + B</code>) the new output stays in the same tab; however, I would like to automatically close/restart the previous console after doing so. The reason is that I keep accumulating open python environments that must be closed manually.</p>
  
  <p><a href="https://i.stack.imgur.com/AZaJH.png" rel="nofollow noreferrer">Here is a picture of my taskbar after running the same code three times</a></p>
  
  <p><a href="https://i.stack.imgur.com/ydKea.png" rel="nofollow noreferrer">Here is a picture of the tab where REPL is running.</a></p>
  
  <p>As shown in the second picture, I can type in <code>exit()</code> before rebuilding, but it would be nice if this could be done automatically. My thinking is that I could somehow set the previous console to close after rebuilding, or I could "re-run" the code in the same console via one simple command.</p>