randy3k / Terminus

Bring a real terminal to Sublime Text
https://packagecontrol.io/packages/Terminus
MIT License
1.37k stars 83 forks source link

Can't restore tab with pre/post window hooks (possible recency manager issue)? #358

Open Q3C273 opened 2 years ago

Q3C273 commented 2 years ago

I have been using the Origami/Terminus side-by-side build for a very long time now (see this) for details. Sometime in the recent past, something appears to be going wrong with the hooks, because instead of restoring the most recently used tab, the one to the right of it seems to gain focus (and if there is nothing to the right, it seems to go to a different pane altogether).

I see the following error in the console, although I am not sure if it is related:

Traceback (most recent call last):
  File "/Applications/Sublime Text 4.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 944, in on_activated_async
    run_view_callbacks('on_activated_async', view_id)
  File "/Applications/Sublime Text 4.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 708, in run_view_callbacks
    callback(v, *args)
  File "/Applications/Sublime Text 4.app/Contents/MacOS/Lib/python33/sublime_plugin.py", line 190, in exception_handler
    return event_handler(*args)
  File "/Users/username/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/event_listeners.py", line 18, in on_activated_async
    recency_manager = RecencyManager.from_view(view)
  File "/Users/username/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/recency.py", line 26, in from_view
    return cls.from_window(window)
  File "/Users/username/Library/Application Support/Sublime Text 3/Installed Packages/Terminus.sublime-package/terminus/recency.py", line 15, in from_window
    if window.id() in cls._instances:
AttributeError: 'NoneType' object has no attribute 'id'

OS: M1 macOS Big Sur 11.2.3

randy3k commented 2 years ago

Just release v0.3.27, see if it fixes your issue.