terminal.ts 529 B

123456789101112131415161718
  1. // Copyright (c) Jupyter Development Team.
  2. // Distributed under the terms of the Modified BSD License.
  3. import { Terminal, TerminalManager } from '@jupyterlab/services';
  4. import { log } from './log';
  5. export async function main() {
  6. log('Terminal');
  7. // See if terminals are available
  8. if (Terminal.isAvailable()) {
  9. const manager = new TerminalManager();
  10. // Create a named terminal session and send some data.
  11. const session = await manager.startNew();
  12. session.send({ type: 'stdin', content: ['foo'] });
  13. }
  14. }