Terminus icon indicating copy to clipboard operation
Terminus copied to clipboard

Switch terminal location on project switch

Open trych opened this issue 2 years ago • 2 comments

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!

trych avatar Aug 16 '22 14:08 trych

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).

randy3k avatar Jan 03 '23 19:01 randy3k

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

arturolinares avatar Mar 28 '24 23:03 arturolinares