Closed timfjord closed 2 years ago
It seems to be an issue of a tagged panel. I have pushed a fix 97f1208. Removing the tag
arg should also fix your issue.
If you launch the command from a different window, the tagged panel of the first window will be reused. Depends on what you want to do, it may not be necessary to tag a panel, or you'll need window specific tags.
v0.3.23 is out
Awesome, thanks @randy3k for the super quick fix 👍🏻
tag
is important because I want some custom shortcuts so I am glad that I can remove my workaround
Please note that tags are shared globally. So you will need to have window specific tags to allow users to create panels on multiple windows. But doing so may defect that reason of using tags for the purpose of key bindings.
Thanks for letting me know, it is quite important for my use-case
So just to confirm, if I run terminus in one window with a tag, and then run another terminus command in another window using the same tag, the latter command will jump to the previous window and be executed there?
Now I understand what you meant that the tags are shared globally. Basically when I tried to create a panel with a specific tag and it was already visible in a different window then my command was run in that window rather than in my current window.
So I am wondering is it on purpose? I mean are there technical limitations to making that window scoped? I understand this is a breaking change I am more wondered whether it is possible at all(given the way terminus is implemented)
I think tags should be window specific, I mean why would we want tags to be shared globally? I don't see any use case unless there are some technical limitations.
@randy3k Could you please shed some light on this?
It seems more sensible to make tags window specific. It just happened that we have only one dictionary to store the Terminal instances. Let me think what I could do to addres this.
I have just pushed 6f300b9 and v0.3.24 is out.
Ai, the patch doesn't work for panel. Wait for another update.
v0.3.25 is out.
Thanks, @randy3k
I can confirm tags are now window scoped! :tada:
~~Just notice that there is another bug preventing this from working correctly. :(. Creating a new terminal might kill the process of an existing terminal with the same tag. WIll fix it soon.~~
Edit: I was wrong again. It is fine.
Background
I am working on a sublime plugin where
terminus
acts as a runner. When I usedterminus_exec
everything was ok, but when I switched toterminus_open
for more advanced integration I started to get the following when run a command with a custom panel name on the second time after the previous panel was hidden(Esc) rather than closed(⌘ + W)When the panel isn't hidden and still in the view or is closed the command runs without problems
Solution
I was able to fix it by adding a workaround
So basically when the panel is hidden I simply closed it and run the command again
I believe something like this is already present in the
terminus_exec
handler(I just couldn't find it) because there are no issues when doing the same(obviously without thepanel_name
option) withterminus_exec
It looks like it has to do with that fact that
window()
returnsNone
when the panel is not in the view that's why my workaround is workingJust in case here is the implementation https://github.com/timfjord/AnyTest/blob/main/plugin/outputs/terminus.py