forked from jupyterlab/jupyterlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
47 lines (34 loc) · 997 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
import 'es6-promise/auto'; // polyfill Promise on IE
import {
DockPanel, Widget
} from '@phosphor/widgets';
import {
TerminalSession
} from '@jupyterlab/services';
import {
TerminalWidget
} from '@jupyterlab/terminal';
import '../index.css';
function main(): void {
let term1 = new TerminalWidget({
background: 'black',
color: 'white'
});
let term2 = new TerminalWidget({
background: 'white',
color: 'black'
});
TerminalSession.startNew().then(session => { term1.session = session; });
TerminalSession.startNew().then(session => { term2.session = session; });
term1.title.closable = true;
term2.title.closable = true;
let dock = new DockPanel();
dock.addWidget(term1);
dock.addWidget(term2, { mode: 'tab-before' });
Widget.attach(dock, document.body);
dock.id = 'main';
window.onresize = () => dock.fit();
}
window.onload = main;