Interface Process

Interface for process functionality

interface Process {
    args: string[];
    code?: number;
    command: string;
    cwd: string;
    entry: (params: ProcessEntryParams) => Promise<undefined | number | void>;
    events: any;
    fd: FDTable;
    gid: number;
    kernel: Kernel;
    parent?: number;
    pid: number;
    shell: Shell;
    status: ProcessStatus;
    stderr: WritableStream<Uint8Array>;
    stdin: ReadableStream<Uint8Array>;
    stdinIsTTY?: boolean;
    stdout: WritableStream<Uint8Array>;
    stdoutIsTTY?: boolean;
    terminal: Terminal;
    uid: number;
    cleanup(): Promise<void>;
    close(handle: FileHandle): Promise<void>;
    exit(exitCode?: number): Promise<void>;
    keepAlive(): void;
    open(path: string, flags?: string): Promise<FileHandle>;
    pause(): void;
    restart(): void;
    resume(): void;
    start(): Promise<number>;
    stop(exitCode?: number): Promise<void>;
}

Properties

args: string[]

Get command line arguments

code?: number

Get exit code

command: string

Get command name

cwd: string

Get working directory

entry: (params: ProcessEntryParams) => Promise<undefined | number | void>

Get process entry point

events: any

Get event emitter

Get file descriptor table

gid: number

Get group ID

kernel: Kernel

Get kernel instance

parent?: number

Get/set parent process ID

pid: number

Get process ID

shell: Shell

Get shell instance

Get process status

Get standard error stream

Get standard input stream

stdinIsTTY?: boolean

Whether stdin is a TTY (interactive terminal) vs a pipe

Get standard output stream

stdoutIsTTY?: boolean

Whether stdout is a TTY (interactive terminal) vs a file/pipe

terminal: Terminal

Get terminal instance

uid: number

Get user ID

Methods

  • Marks the process to stay alive after the entry function returns. Useful for background/daemon processes that need to keep running.

    Returns void