       [text, brush] = fragment
 
       if cursorX isnt undefined and rendered <= cursorX < rendered + text.length
-        cursorText = text[cursorX - rendered]
+        @cursorBrush = brush
+        @cursorText = text[cursorX - rendered]
+        @cursorX = cursorX
+        @cursorY = n
 
       @setBackgroundAttributes(brush)
       @ctx.fillRect left, top, text.length * @cellWidth, @cellHeight

      @ctx.font = font
      @prevFont = font

  showCursor: (show) ->
    # if show
    #   @$el.addClass "cursor-on"
    # else
    #   @$el.removeClass "cursor-on"

  blinkCursor: ->
    # cursor = @$el.find(".cursor")
    # if cursor.hasClass("visible")
    #   cursor.removeClass "visible"
    # else
    #   cursor.addClass "visible"

  resetCursorState: ->
    # cursor = @$el.find(".cursor")
    # cursor.addClass "visible"

      rendered += text.length

    if cursorX
      @renderCursor()

  setBackgroundAttributes: (brush) ->
    @ctx.fillStyle = AsciiIo.colors[brush.bgColor()]
