docs: def has_session(self, target_session, exact=True):
          """
          Return True if session exists. ``$ tmux has-session``.
  
          Parameters
          ----------
          target_session : str
              session name
          exact : bool
              match the session name exactly. tmux uses fnmatch by default.
              Internally prepends ``=`` to the session in ``$ tmux has-session``.
              tmux 2.1 and up only.
  
          Raises
          ------
          :exc:`exc.BadSessionName`
  
          Returns
          -------
          bool
          """
          session_check_name(target_session)
  
          if exact and has_gte_version('2.1'):
              target_session = '={}'.format(target_session)
  
          proc = self.cmd('has-session', '-t%s' % target_session)
  
          if not proc.returncode:
              return True
  
          return False