docs: def attach_session(self, target_session=None):
          """``$ tmux attach-session`` aka alias: ``$ tmux attach``.
  
          Parameters
          ----------
          target_session : str
              name of the session. fnmatch(3) works.
  
          Raises
          ------
          :exc:`exc.BadSessionName`
          """
          session_check_name(target_session)
  
          tmux_args = tuple()
          if target_session:
              tmux_args += ('-t%s' % target_session,)
  
          proc = self.cmd('attach-session', *tmux_args)
  
          if proc.stderr:
              raise exc.LibTmuxException(proc.stderr)