Sublime Forum

How to open multiple tabs for terminus in panel?

#1

Hi, is there a way to open multiple tabs of terminus in the panel?

0 Likes

#2

It’s currently not possible to do that but you can definitely open multiple tabs in a given group.

1 Like

#3

The panel doesn’t support tabs, but you can open multiple Terminus panels if you like, though it’s up to you to also create key bindings to swap to them, if you need them.

If you check the README on the package page, one of the arguments that the terminus_open command takes is panel_name, which gives a name to the panel that’s created. So in order to open multiple views you just need to provide different panel names for each one as you open them.

How you do that depends on the action you want to take. You could bind keys to open each one in turn, or you could add command palette entries to be able to do it, etc.

For example, if you were to open the Sublime console with Ctrl+`, you can enter the following two lines (a Terminus panel opens after each of them, so you need to return to the console to do it a second time):

window.run_command("toggle_terminus_panel", {"panel_name": "Panel One"})
window.run_command("toggle_terminus_panel", {"panel_name": "Panel Two"})

This will open whatever your defaults in Terminus are set to, since the only argument that we’re passing is the name of the panel to use.

You can use the panel switcher menu to swap between panels (or bind a key to open the appropriate panel, etc):

3 Likes

#4

thank you for this. i guess i’ll be using this workaround for the time being.

0 Likes

#5

Hi,

I am looking to do the same thing. I am trying to do this with a key binding so that I can just press ctrl+` and a few terminal windows would be available. This is what I have tried but it doesn’t work, any idea how to fix it?

[
	{ 
        "keys": ["alt+`"], "command": "toggle_terminus_panel", "panel_name": "Panel One",
        "command": "toggle_terminus_panel", "panel_name": "Panel Two",
        
    },

    { 
        "keys": ["ctrl+alt+t"], "command": "terminus_open", "args": {
            "cwd": "${file_path:${folder}}"
        }
    },

	{ 
    	"keys": ["ctrl+w"], "command": "terminus_close", "context": [{ "key": "terminus_view"}]
	}
]
0 Likes

#6

Your first key binding is not valid; you can only assign a single command to a key binding. If you want to bind multiple commands to the same key, you need something like Chain of Command or Multicommand to do it.

The documentation on the package control page should give you what you need to set up your binding, but if you need more assistance, this video contains examples as well:

0 Likes

#7

Thank you, worked perfectly

0 Likes

#8

@OdatNurd excuse me, may I ask you a question?

I try to use the two lines, but it does,t work.

window.run_command(“toggle_terminus_panel”, {“panel_name”: “Panel One”})
window.run_command(“toggle_terminus_panel”, {“panel_name”: “Panel Two”})

the console say

can you help me fix this problem?

0 Likes

#9

You can’t have two panels open at the same time, so I would guess that in doing this you only get to see Panel two?

The (None, None) is because run_command() doesn’t return a value.

0 Likes

#10

thx for your reply. I find the solution!!!

in the terminus package website have writen the terminal with split view !!

1 Like