or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-9/

Persistent Terminal Client

Build a minimal client that manages server-backed shell sessions which stay alive after the UI disconnects. The client must open named sessions, reuse them without resetting shell state, and allow reconnecting later to keep running commands in the same environment. Closing a local handle should not kill the server session; only an explicit shutdown ends it.

Capabilities

Start or reuse a named session

  • Opening a session with name "workspace" twice returns the same session id and preserves changes (e.g., after cd /tmp, running pwd still returns /tmp) @test

Run commands and capture output

  • Sending echo ready into a session returns a result whose output contains ready and ends with a newline that reflects the shell output @test

Resume after disconnect

  • After closing a local connection via the session handle, resuming it by id still uses the existing server session; pwd reflects the directory set before disconnecting @test

List and shut down sessions

  • Listing sessions shows active ids; shutting one down removes it from the list and terminates the underlying shell @test

Implementation

@generates

API

export interface TerminalResult {
  output: string;
}

export interface TerminalSessionInfo {
  id: string;
  name: string;
}

export interface PersistentTerminal {
  readonly id: string;
  send(command: string): Promise<TerminalResult>;
  close(): Promise<void>;
}

export interface TerminalClient {
  open(name?: string): Promise<PersistentTerminal>;
  resume(id: string): Promise<PersistentTerminal>;
  list(): Promise<TerminalSessionInfo[]>;
  shutdown(id: string): Promise<void>;
}

export function createTerminalClient(): TerminalClient;

Dependencies { .dependencies }

jupyterlab { .dependency }

Provides persistent, server-backed terminals.