本文整理汇总了TypeScript中@jupyterlab/services.TerminalSession类的典型用法代码示例。如果您正苦于以下问题:TypeScript TerminalSession类的具体用法?TypeScript TerminalSession怎么用?TypeScript TerminalSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TerminalSession类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should dispose of the resources used by the session', async () => {
session = await TerminalSession.startNew();
const name = session.name;
session.dispose();
expect(session.isDisposed).to.equal(true);
await TerminalSession.shutdown(name);
});
示例2: main
function main(): void {
let term1 = new Terminal({ theme: 'light' });
let term2 = new Terminal({ theme: 'dark' });
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' });
dock.id = 'main';
// Attach the widget to the dom.
Widget.attach(dock, document.body);
// Handle resize events.
window.addEventListener('resize', () => {
dock.fit();
});
}
示例3: main
function main(): void {
let term1 = new Terminal({ theme: 'light' });
let term2 = new Terminal({ theme: 'dark' });
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();
}
示例4: main
function main(): void {
let term1 = new TerminalWidget({
background: 'black',
color: 'white'
});
let term2 = new TerminalWidget({
background: 'white',
color: 'black'
});
TerminalSession.open().then(session => term1.session = session);
TerminalSession.open().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();
}