code: def progress_view(shell):
      
      while not ShellProgressView.done:
          _, col = get_window_dim()
          col = int(col)
          progress = get_progress_message()
          if '\n' in progress:
              prog_list = progress.split('\n')
              prog_val = len(prog_list[-1])
          else:
              prog_val = len(progress)
          buffer_size = col - prog_val - 4
  
          if ShellProgressView.progress_bar:
              doc = u'{}:{}'.format(progress, ShellProgressView.progress_bar)
              shell.spin_val = -1
              counter = 0
              ShellProgressView.heart_bar = ''
          else:
              if progress and not ShellProgressView.done:
                  heart_bar = ShellProgressView.heart_bar
                  if shell.spin_val >= 0:
                      beat = ShellProgressView.heart_beat_values[_get_heart_frequency()]
                      heart_bar += beat
                      heart_bar = heart_bar[len(beat):]
                      len_beat = len(heart_bar)
                      if len_beat > buffer_size:
                          heart_bar = heart_bar[len_beat - buffer_size:]
  
                      while len(heart_bar) < buffer_size:
                          beat = ShellProgressView.heart_beat_values[_get_heart_frequency()]
                          heart_bar += beat
  
                  else:
                      shell.spin_val = 0
                      counter = 0
                      while counter < buffer_size:
                          beat = ShellProgressView.heart_beat_values[_get_heart_frequency()]
                          heart_bar += beat
                          counter += len(beat)
                  ShellProgressView.heart_bar = heart_bar
              doc = u'{}:{}'.format(progress, ShellProgressView.heart_bar)
          shell.cli.buffers['progress'].reset(
              initial_document=Document(doc))
          shell.cli.request_redraw()
          sleep(shell.intermediate_sleep)
  
      ShellProgressView.done = False
      ShellProgressView.progress_bar = ''
      shell.spin_val = -1
      sleep(shell.final_sleep)
      return True
docs: updates the view