 
   destroy: ->
     @off 'focus', @focus
-    $(window).off 'resize', @resizeToPane
+    $(window).off 'resize', @resizeToPane_
     if @ptyProcess
       @ptyProcess.terminate()
       @ptyProcess = null

    @input atom.clipboard.read()

  focus: ->
    @resizeToPane()
    @focusTerm()

  focusTerm: ->
    @term.focus()

  resizeToPane: ->
    {cols, rows} = @getDimensions_()
    @resize cols, rows


    term.focus()
    @applyStyle()
    @attachEvents()
    @resizeToPane_

  resize: (cols, rows) ->
    return unless @term
