當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript services.TerminalSession類代碼示例

本文整理匯總了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);
 });
開發者ID:afshin,項目名稱:jupyterlab,代碼行數:7,代碼來源:terminal.spec.ts

示例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();
  });
}
開發者ID:AlbertHilb,項目名稱:jupyterlab,代碼行數:26,代碼來源:index.ts

示例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();
}
開發者ID:cameronoelsen,項目名稱:jupyterlab,代碼行數:18,代碼來源:index.ts

示例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();
}
開發者ID:marami52,項目名稱:jupyterlab,代碼行數:24,代碼來源:index.ts


注:本文中的@jupyterlab/services.TerminalSession類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。