def stop(self):
if self.enabled:<EOL><INDENT>term = self.term<EOL>stream = self.stream<EOL>positions = self.counters.values()<EOL>if not self.no_resize and RESIZE_SUPPORTED:<EOL><INDENT>signal.signal(signal.SIGWINCH, self.sigwinch_orig)<EOL><DEDENT>try:<EOL><INDENT>for num in range(self.scroll_offset - <NUM_LIT:1>, <NUM_LIT:0>, -<NUM_LIT:1>):<EOL><INDENT>if num not in positions:<EOL><INDENT>term.move_to(<NUM_LIT:0>, term.height - num)<EOL>stream.write(term.clear_eol)<EOL><DEDENT><DEDENT>stream.flush()<EOL><DEDENT>finally:<EOL><INDENT>if self.set_scroll:<EOL><INDENT>self.term.reset()<EOL>if self.companion_term:<EOL><INDENT>self.companion_term.reset()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>term.move_to(<NUM_LIT:0>, term.height)<EOL><DEDENT>self.process_exit = False<EOL>self.enabled = False<EOL>for cter in self.counters:<EOL><INDENT>cter.enabled = False<EOL><DEDENT><DEDENT>if <NUM_LIT:1> in positions:<EOL><INDENT>term.feed()<EOL><DEDENT><DEDENT>
Clean up and reset terminal

This method should be called when the manager and counters will no longer be needed.

Any progress bars that have ``leave`` set to :py:data:`True` or have not been closed
will remain on the console. All others will be cleared.

Manager and all counters will be disabled.