       colors, cursorBlink, scrollback, cols, rows
     }
 
-    term.end = => @destroy()
-
     term.on "data", (data) => @input data
     term.open this.get(0)
 

    @fakeRow.remove()
    {cols, rows}

  destroy: ->
    @detachResizeEvents()
    if @ptyProcess
      @ptyProcess.terminate()
    @term.destroy()
    parentPane = atom.workspace.getActivePane()
    if parentPane.activeItem is this
      parentPane.removeItem parentPane.activeItem
    @detach()


module.exports = TermView

        @emitter.emit('data', data)
        @term.write data

      @ptyProcess.on 'exit', (data) =>
        @emitter.emit('exit', data)
        @exit()
    else
      term.end = => @exit()

    @input "#{runCommand}#{os.EOL}" if (runCommand)
    term.focus()
    @applyStyle()
    @attachEvents()
    @resizeToPane

  resize: (cols, rows) ->
    return if @term.rows is rows and @term.cols is cols
