     id = model.id
     termView.id = id
 
-    termView.onExit () ->
+    subscriptions.add termView.onExit () ->
       Terminals.remove id
       disposable.dispose()
 
-    termView.onDidChangeTitle () ->
+    subscriptions.add termView.onDidChangeTitle () ->
       if forkPTY
         model.title = termView.getTitle()
       else

Terminals = require './lib/terminal-model'
{Emitter}  = require 'event-kit'
keypather  = do require 'keypather'


capitalize = (str)-> str[0].toUpperCase() + str[1..].toLowerCase()



    item = pane.addItem termView
    pane.activateItem item
    subscriptions.add pane.onWillRemoveItem (itemRemoved, index) ->
      if itemRemoved.item == item
        item.destroy()
        Terminals.remove id
        subscriptions.dispose()
    termView

  pipeTerm: (action) ->
