本文整理匯總了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();
}