code: func Flush() error {
  	update_size_maybe()
  	prepare_diff_messages()
  	for _, diff := range diffbuf {
  		r := small_rect{
  			left:   0,
  			top:    diff.pos,
  			right:  term_size.x - 1,
  			bottom: diff.pos + diff.lines - 1,
  		}
  		write_console_output(out, diff.chars, r)
  	}
  	if !is_cursor_hidden(cursor_x, cursor_y) {
  		move_cursor(cursor_x, cursor_y)
  	}
  	return nil
  }
docs: // Synchronizes the internal back buffer with the terminal.