 
       @disposables.add resultModel.onDidReplacePath ({filePath}) =>
         @saveAfterProjectReplace(filePath)
+
+    @disposables.add @package().onDidDeactivate =>
+      atom.workspace.updateWindowTitle = LocalStorage.getItem('workspace:updateTitle')
+      LocalStorage.removeItem('workspace:updateTitle')
+      @disposables.dispose()
+
+  replaceTitleUpdater: ->
+    if not LocalStorage.getItem('workspace:updateTitle')
+      LocalStorage.setItem('workspace:updateTitle', atom.workspace.updateWindowTitle)
+      atom.workspace.updateWindowTitle = @updateTitle
+
+  updateTitle: =>
+    itemPath = atom.workspace.getActivePaneItem()?.getPath?()
+
+    node =
+      if itemPath?
+        @virtualFileSystem.getNode(itemPath)
+      else
+        @virtualFileSystem.projectNode
+
+    title =
+      if node? and node.path?
+        "Learn IDE — #{node.path.replace(/^\//, '')}"
+      else
+        'Learn IDE'
+
+    document.title = title
+    atom.applicationDelegate.setRepresentedFilename(node.localPath())
 
   configPath: ->
     atom.configDirPath

fs = require 'graceful-fs'
CSON = require 'cson'
_path = require 'path'
{CompositeDisposable} = require 'atom'

convertEOL = (text) ->

    @clearProjects()
    atom.project.addPath(path)
    @treeView()?.updateRoots(directoryExpansionStates)
    @updateTitle()

  reloadTreeView: (path, pathToSelect) ->
    @treeView()?.entryForPath(path).reload()
