     @resizeToPane()
     @focusTerm()
 
-  forkPtyProcess: (sh, args=[])->
-    processPath = require.resolve './pty'
-    path = atom.project.getPaths()[0] ? '~'
-    Task.once processPath, fs.absolute(path), sh, args
+  # forkPtyProcess: (sh, args=[])->
+  #   processPath = require.resolve './pty'
+  #   path = atom.project.getPaths()[0] ? '~'
+  #   Task.once processPath, fs.absolute(path), sh, args
 
   initialize: (@state)->
     {cols, rows, cwd, shell, shellArguments, shellOverride, runCommand, colors, cursorBlink, scrollback} = @opts
     args = shellArguments.split(/\s+/g).filter (arg) -> arg
-
-    if @opts.forkPTY
-
-
-      @ptyProcess = @forkPtyProcess shellOverride, args
-      @ptyProcess.on 'term2:data', (data) =>
-        console.log('tty', data)
-        @emitter.emit('data', data)
-        @term.write data
-      @ptyProcess.on 'term2:exit', (data) =>
-        @emitter.emit('exit', data)
-        @destroy()
 
     @term = term = new Terminal {
       useStyle: no

util       = require 'util'
path       = require 'path'
os         = require 'os'

    term.on "data", (data) => @input data
    term.open this.get(0)

    if @opts.forkPTY
      shell = shell or process.env.SHELL
      @ptyProcess = pty.spawn shell, args,
        name: 'xterm-256color'
        cols: cols
        rows: rows
        cwd: atom.project.getPaths()[0] || '~'
        env: process.env

      @ptyProcess.on 'data', (data) =>
        console.log('tty', data)
        @emitter.emit('data', data)
        @term.write data

      @ptyProcess.on 'exit', ->
        @emitter.emit('exit', data)
        @destroy()

    @input "#{runCommand}#{os.EOL}" if (runCommand)

    term.focus()

    @applyStyle()
    @attachEvents()
    process.nextTick =>
      @resize(130, 38)
      @resize(150, 38)
      @resize(130, 38)
      # @resizeToPane()
    window.TermView = this

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

      if @ptyProcess
        @ptyProcess.resize cols, rows
        # @ptyProcess.send {event: 'resize', rows, cols}

      if @term
        @term.resize cols, rows
