     term.focus()
     @applyStyle()
     @attachEvents()
-    @resizeToPane
+    @resizeToPane_
 
   resize: (cols, rows) ->
     return unless @term

    ) + "px"

  attachEvents: ->
    @resizeToPane = @resizeToPane.bind this
    @on 'focus', @focus
    $(window).on 'resize', => @resizeToPane()
    @disposable = atom.workspace.getActivePane().observeFlexScale => setTimeout (=> @resizeToPane()), 300
    atom.commands.add "atom-workspace", "term2:paste", => @paste()
    atom.commands.add "atom-workspace", "term2:copy", => @copy()


    @input atom.clipboard.read()

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

  focusTerm: ->
    @term.focus()

  resizeToPane_: ->
    return unless @ptyProcess
    {cols, rows} = @getDimensions_()
    @resize cols, rows

