         console.log error
       else
         window.T = terminal
+        @sendCount = 0
         @terminal = terminal
         @welcomeUser terminal.isNew
         callback? terminal.totalSessions

    @dmp = new diff_match_patch()
    @lastScreen = ""
    @bufferedKeyStrokes = []
    
    shellView.registerListener KDEventTypes:'AdvancedSettingsFunction', listener:@, callback:(pubInst, {functionName})=>
      switch functionName

      console.log "terminal.resize error #{e}"
  
  sendThrottled : _.throttle ->
    @sendCount++
    @terminal.write @bufferedKeyStrokes,@sendCount
    console.log "#{@bufferedKeyStrokes.length} @bufferedKeyStrokes sent at - interval 500msec",new Date if @terminal.log
    @bufferedKeyStrokes = []
  ,500
