           removeClass @statusIcon, 'status-running'
           @program = null
           addClass @statusIcon, code == 0 and 'status-success' or 'status-error'
-          showCmd()
+          @showCmd()
         @program.on 'error', (err) =>
           @cliOutput.append err.message
-          showCmd()
+          @showCmd()
           addClass @statusIcon, 'status-error'
         @program.stdout.on 'data', () =>
           @flashIconClass 'status-info'

        @subview 'cmdEditor', new EditorView(mini: true, placeholderText: 'input your command here')

  initialize: ->
    atom.workspaceView.command "cli-status:toggle-output", =>
      @toggle()



      catch err
        @cliOutput.append err.message
        @showCmd()

  showCmd: ->
    @cmdEditor.show()
    @cmdEditor.getEditor().selectAll()
    @cmdEditor.focus()
    @scrollToBottom()

  scrollToBottom: ->
    @cliOutput.scrollTop 10000000
