randy3k / Terminus

Bring a real terminal to Sublime Text

Home Page:https://packagecontrol.io/packages/Terminus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch terminal location on project switch

trych opened this issue · comments

commented

Hi there!

First of all, thanks again for this fantastic plugin that I have been using for a while now.

One thing that I run into recently more often is that, after using ST's Quick Switch Project ... command, the Terminus panel that is triggered via the toggle_terminus_panel command will stay at the original location.

So this is what happens: I work in Project A, close the Terminus panel, switch projects to Project B, toggle the Terminus panel back open and the terminal location is still at Project A. Which can be pretty misleading and has more than once led to me commiting some git stuff with wrong commit messages when I'm not being extra careful.

I see to options to go about this:

  • destroy the current Terminus panel on project switch, to entirely prevent myself from such a mistake.
  • detect when a project changes, and open a new Terminus panel in that project's location and associate the toggle command with it. If a panel for that project already exists, switch to it and have the toggle command associated with it. That way multiple terminal sessions of multiple projects could be kept alive.

Is there a way to solve this with the existing Terminus commands?
Thanks a lot!

Sorry for the late reply. I believe that sublime doesn't automatically close panels when switching panels. And there are use cases that a user may want to keep the panel around. My suggestion is to create a macro which run the commands
terminus_close_all then prompt_select_workspace (Quick Switch Project).

I think sublime macros only support text commands. A setting to close all terminals when switching projects would be great.