docs: def __dump_stack(self):
          """Dump the shell stack in a human friendly way.
  
          An example output is:
                  0    PlayBoy
                  1    └── foo-prompt: foo@[]
                  2        └── karPROMPT: kar@[]
                  3            └── DEBUG: debug@['shell']
          """
          maxdepth = len(self._mode_stack)
          maxdepth_strlen = len(str(maxdepth))
          index_width = 4 - (-maxdepth_strlen) % 4 + 4
          index_str = lambda i: '{:<{}d}'.format(i, index_width)
  
          self.stdout.write(index_str(0) + self.root_prompt)
          self.stdout.write('\n')
  
          tree_prefix = '└── '
          for i in range(maxdepth):
              index_prefix = index_str(i + 1)
              whitespace_prefix = ' ' * len(tree_prefix) * i
              mode = self._mode_stack[i]
              line = index_prefix + whitespace_prefix + \
                      tree_prefix + mode.prompt + \
                      ': {}@{}'.format(mode.cmd, mode.args)
              self.stdout.write(line)
              self.stdout.write('\n')