code: def refresh_stack(self):
          
          self.stack, _ = self.compute_stack(self.fullstack)
          # find the current frame in the new stack
          for i, (frame, _) in enumerate(self.stack):
              if frame is self.curframe:
                  self.curindex = i
                  break
          else:
              self.curindex = len(self.stack)-1
              self.curframe = self.stack[-1][0]
              self.print_current_stack_entry()
docs: Recompute the stack after e.g. show_hidden_frames has been modified