当前位置: 首页>>代码示例>>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;未经允许,请勿转载。