From 98b1205ac378d91510176f301b747392cf519776 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 7 Nov 2020 12:09:20 -0600 Subject: [PATCH] Remove print() --- tmuxp/cli.py | 27 --------------------------- tmuxp/util.py | 2 +- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/tmuxp/cli.py b/tmuxp/cli.py index 4fdf31449fd..94b987f5c3e 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -888,13 +888,6 @@ def command_shell( else: current_pane = util.get_current_pane(server=server) - try: - current_session = session = util.get_session( - server=server, current_pane=current_pane - ) - except Exception: - current_session = None - try: session = util.get_session( server=server, session_name=session_name, current_pane=current_pane @@ -909,26 +902,6 @@ def command_shell( else: return - if current_session is not None and current_session.id != session.id: - print("in") - if not detached and ( - answer_yes - or click.confirm( - "Switch / attach to %s and run shell from there?" - % click.style(session_name, fg="green"), - default=True, - ) - ): - if current_session.id != session.id: - session.attached_window.attached_pane.send_keys( - "tmuxp shell", enter=True - ) - if "TMUX" in os.environ: - session.switch_client() - else: - session.attach_session() - return - if current_pane["session_id"] != session.id: current_pane = None diff --git a/tmuxp/util.py b/tmuxp/util.py index a793d099522..a15dbb3783d 100644 --- a/tmuxp/util.py +++ b/tmuxp/util.py @@ -142,11 +142,11 @@ def get_window(session, window_name=None, current_pane=None): raise exc.TmuxpException("Window not found: %s" % window_name) elif current_pane is not None: print("get_window: current_pane") + window = session.find_where({"window_id": current_pane["window_id"]}) else: print("get_window: else") window = session.list_windows()[0] - print(f"get_window: {window}") return window