Skip to content

Commit

Permalink
avoid being reactivated for non auto closed panel
Browse files Browse the repository at this point in the history
cc #108
  • Loading branch information
randy3k committed Apr 17, 2019
1 parent 12d4297 commit 8998539
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions terminus/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ def on_activated(self, view):
if not settings.has("terminus_view.args") or settings.get("terminus_view.detached"):
return

if settings.has("terminus_view.closed"):
return

kwargs = settings.get("terminus_view.args")
if "cmd" not in kwargs:
return
Expand Down
4 changes: 4 additions & 0 deletions terminus/terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ def cleanup(self):
if self.process.exitstatus == 0 and self.auto_close:
self.view.run_command("terminus_close")

if not self.auto_close:
# to avoid being reactivated
self.view.settings().set("terminus_view.closed", True)

def handle_resize(self):
size = view_size(self.view)
logger.debug("handle resize {} {} -> {} {}".format(
Expand Down

0 comments on commit 8998539

Please sign in to comment.