       'core:move-down': (e) ->
         getConsole(this).keyDown e, this
       'core:move-left': (e) ->
-        delete getConsole(this).prefix
+        getConsole(this).resetPrefix()
       'core:move-right': (e) ->
-        delete getConsole(this).prefix
+        getConsole(this).resetPrefix()
       'core:backspace': (e) ->
         getConsole(this).cancelMode this
 

      input: editor.getText()
      mode: mode?.name

  moveHistory: (up) ->
    {editor} = @getInput()
    if (editor.getText() or not @prefix?) and @prefix?.pos?[0] isnt Infinity
      pos = editor.getCursorBufferPosition()
      text = editor.getTextInRange [[0,0], pos]
      pos = [Infinity, Infinity] if text is ''

  lastOutput: -> @items[@items.length - (if @getInput() then 2 else 1)]

  input: ->
    @resetPrefix()
    if not @getInput()
      item = type: 'input', input: true
      @push @setMode item
