       fallback()
 
 
-  routeToLastWorkspace = ->
-    KD.getSingleton('router').handleRoute '/IDE/my-workspace'
+  routeToLatestWorkspace = ->
+    localStorage    = KD.getSingleton("localStorageController").storage "IDE"
+    latestWorkspace = localStorage.getValue 'LatestWorkspace'
+
+    if latestWorkspace
+      {machineLabel, workspaceSlug} = latestWorkspace
+    else
+      machineLabel  = KD.userMachines.first?.label or ''
+      workspaceSlug = 'my-workspace'
+
+    KD.getSingleton('router').handleRoute "/IDE/#{machineLabel}/#{workspaceSlug}"
 
 
   KD.registerRoutes 'IDE',
 
-    '/:name?/IDE': -> routeToLastWorkspace()
+    '/:name?/IDE': -> routeToLatestWorkspace()
 
-    '/:name?/IDE/:workspaceSlug': (data) ->
-      loadWorkspace data.params.workspaceSlug
+    '/:name?/IDE/:machineLabel/:workspaceSlug': (data) ->
+
+      { machineLabel, workspaceSlug } = data.params
+
+      loadWorkspace machineLabel, workspaceSlug

do ->

  loadWorkspace = (slug) ->
    workspace = ws  for ws in KD.userWorkspaces when ws.slug is slug

    if workspace
      machine = getMachineByUId workspace.machineUId
      loadIDE { machine, workspace } # TODO: Be sure we are handling machine not found
    else
      if slug is 'my-workspace'
        machine   = KD.userMachines.first
        workspace = isDefault: yes, slug: 'my-workspace'

        loadIDE { machine, workspace }
      else
        routeToLastWorkspace()


  selectWorkspaceOnSidebar = (data) ->

      isSameMachine   = instance.mountedMachineUId is machineUId
      isSameWorkspace = instance.workspaceData is workspace

      if isSameMachine
        if isSameWorkspace then ideInstance = instance
        else if workspace.slug is 'my-workspace'
          if instance.workspaceData?.isDefault
            ideInstance = instance

    if ideInstance
      appManager.showInstance ideInstance
