       '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
 

      @history.getPrevious @prefix.text
    else
      @history.getNext @prefix.text
    editor.setText next.input
    @setMode @getInput(), next.mode
    editor.setCursorBufferPosition @prefix.pos or [0, 0]


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

  resetPrefix: ->
    @prefix?.listener?.dispose()
    delete @prefix

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