Sublime Forum

Terminus - open panel at file location

#1

Does anyone know how to set Terminus so the panel will open at the currently active file location?
Is it doable?

By default “toggle_terminus_panel” opens at the last file location - so this seems to be wrong command.
Same goes for “terminus_open” - it opens a new tab and that’s not what I need.

I’ve experimented with Origami, but the solution I came up with is also flawed. When you have several tabs opened it messes which tab is in focus.
So for example I have tabs A, B, C. B is active (in view / opened). If I launch Terminus (terminus open) with post window hooks and carry to pane (bottom) it opens a pane on the bottom, but on the upper (main) one focus switches from B to C (in short - last tab).
Any ideas?

0 Likes

#2

The following binding opens the default Terminus panel on current file’s location.

	{
		"keys": ["ctrl+alt+`"],
		"command": "terminus_open",
		"args": {
			"config_name": "Default",
			"cwd": "${file_path:${folder}}",
			"panel_name": "Terminus"
		},
		"context": [
			{ "key": "terminus_view", "operator": "not_equal", "operand": true },
		]
	},
0 Likes

#3

Thank yoiu @deathaxe - that did the trick! Ideally it would be a toggle, but I’m happy with that :slight_smile: .

BTW - this made me thinking. Is there a workaround for the last issue among the solutions I’ve come up with? I’ve used that method (Origami , post window hooks) to set up an alternative Python3 build system that opens on the right pane. I don’t use it often thus it is only mildly annoying (usually I use terminus build system that opens as usual, on the bottom - thus no need for Origami), but if I could prevent switching focus on the opened tabs that would be pretty sweet.

0 Likes

#4

I don’t use Origami, but it sounds like a bug. The post_window_hook method itself is used in the Terminus examples, so I guess it is expected to work.

The way how view’s are focused when changing groups has changed in ST4. I don’t see a ST4 specific version of Origami, so it is likely one of the recent changes to fix ST4 compatibility might have broken some functionality with ST3.

0 Likes

#5

What sort of focus switching are you seeing? One of my videos has a simple plugin which includes a command you can include in the pre_window_hooks and post_window_hooks to save the currently focused tab before the build starts and restore it afterwards.

I indeed recall that needing to be slightly different depending on the version of Sublime in use, though at the time ST4 wasn’t publicly released so I haven’t seen to many people talk asking about it so far.

1 Like

#6

for some weird reason it works now (didn’t touch anything) :upside_down_face: .

BTW - thank you @OdatNurd for all the videos you’ve put on YT. Those basically encouraged me to try ST in the first place and there’s a wealth of info there. You’re a star!

1 Like