code: def detach_client(self, app):
          
          connection = self.get_connection()
          if connection:
              connection.detach_and_close()
  
          # Redraw all clients -> Maybe their size has to change.
          self.invalidate()
docs: Detach the client that belongs to this CLI.