     point = @editor.getCursorBufferPosition()
     if point.row == @editor.getLastBufferRow() and !@preventUserInput and @swank.connected
       input = @getUserInput()
+      # Push this command to the ring if applicable
+      if input != '' and @previousCommands[@previousCommands.length - 1] != input
+        @previousCommands.push input
+      @cycleIndex = @previousCommands.length
+
       @preventUserInput = true
+      @editor.moveToEndOfLine()
       @appendText("\n")
       promise = @swank.eval input, @pkg
       promise.then =>

  prompt: "> "
  preventUserInput: false
  inputFromUser: true

  constructor: (@swank) ->
    @prompt = @pkg + "> "

      if @inputFromUser and (@preventUserInput or point.column < @prompt.length or point.row < @editor.getLastBufferRow())
        event.cancel()

    # Set up up/down arrow previous command cycling
    @subs.add atom.commands.add @editorElement, 'core:move-up': (event) =>
      @cycleBack()
      event.stopImmediatePropagation()
    @subs.add atom.commands.add @editorElement, 'core:move-down': (event) =>
      @cycleForward()
      event.stopImmediatePropagation()


    @subs.add @editor.onDidDestroy =>
      @closeRepl()

