Skip to content

Commit

Permalink
Fix a bug in bind shell: exception in listener_menu
Browse files Browse the repository at this point in the history
  • Loading branch information
brightio committed Oct 6, 2023
1 parent bb66d3d commit 81fd313
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions penelope.py
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,10 @@ def __init__(self, _socket, target, port, listener=None):
not self.listener and "Menu" in core.threads and menu.lastcmd.startswith('connect')
]

if hasattr(listener_menu, 'active'):
os.close(listener_menu.control_w)
listener_menu.finishing.wait()

# If no other session is attached
if core.attached_session is None:
# If auto-attach is enabled
Expand Down Expand Up @@ -1995,10 +1999,6 @@ def update_pty_size(self):
return True

def attach(self):
if listener_menu.active:
os.close(listener_menu.control_w)
listener_menu.finishing.wait()

if threading.current_thread().name != 'Core':
if self.new:
self.new = False
Expand Down

0 comments on commit 81fd313

Please sign in to comment.