diff --git a/tmuxp/cli.py b/tmuxp/cli.py index a31177fef3..a2f88cc12f 100644 --- a/tmuxp/cli.py +++ b/tmuxp/cli.py @@ -739,13 +739,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 @@ -760,26 +753,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 b3ce90818f..fb53a456e3 100644 --- a/tmuxp/util.py +++ b/tmuxp/util.py @@ -134,14 +134,10 @@ def get_window(session, window_name=None, current_pane=None): if not window: 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