'Clear the session history, releasing all object references, and
optionally open a new session.'

def reset(self, new_session=True):

    self.output_hist.clear()
    self.dir_hist[:] = [os.getcwd()]
    if new_session:
        if self.session_number:
            self.end_session()
        self.input_hist_parsed[:] = ['']
        self.input_hist_raw[:] = ['']
        self.new_session()
