浏览代码

Fixes jupyterlab/jupyterlab#1384

akosyakov 8 年之前
父节点
当前提交
94780c39c9
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      src/console/plugin.ts
  2. 1 1
      src/terminal/plugin.ts

+ 2 - 2
src/console/plugin.ts

@@ -351,8 +351,6 @@ function activateConsole(app: JupyterLab, services: IServiceManager, rendermime:
     panel.title.caption = Private.caption(captionOptions);
     panel.title.icon = `${LANDSCAPE_ICON_CLASS} ${CONSOLE_ICON_CLASS}`;
     panel.title.closable = true;
-    app.shell.addToMainArea(panel);
-    app.shell.activateMain(panel.id);
     // Update the caption of the tab with the last execution time.
     panel.content.executed.connect((sender, executed) => {
       captionOptions.executed = executed;
@@ -371,6 +369,8 @@ function activateConsole(app: JupyterLab, services: IServiceManager, rendermime:
     inspector.source = panel.content.inspectionHandler;
     // Add the console panel to the tracker.
     tracker.add(panel);
+    app.shell.addToMainArea(panel);
+    app.shell.activateMain(panel.id);
   }
 
   command = 'console:switch-kernel';

+ 1 - 1
src/terminal/plugin.ts

@@ -121,9 +121,9 @@ function activateTerminal(app: JupyterLab, services: IServiceManager, mainMenu:
           term.session = session;
           term.title.closable = true;
           term.title.icon = `${LANDSCAPE_ICON_CLASS} ${TERMINAL_ICON_CLASS}`;
+          tracker.add(term);
           app.shell.addToMainArea(term);
           app.shell.activateMain(term.id);
-          tracker.add(term);
         });
       });
     }