IKHSAN
EN Read in EnglishID

homeio

Publik

Fork dari doctor-io/homeio

Branch
main
Commit terakhir
958d74616 Oktober 2026

availability.ts

Buka raw
/**
 * Whether the interactive (PTY) terminal is running in this process.
 *
 * server.ts loads the WebSocket terminal on its own and quietly skips it where
 * node-pty cannot load (the Alpine Docker image). Route handlers are bundled
 * separately from server.ts, so the flag lives on globalThis rather than in
 * module state.
 */
const FLAG = "__homeioInteractiveTerminalAvailable";

type FlagHolder = typeof globalThis & { [FLAG]?: boolean };

export function markInteractiveTerminalAvailable() {
  (globalThis as FlagHolder)[FLAG] = true;
}

export function isInteractiveTerminalAvailable() {
  return (globalThis as FlagHolder)[FLAG] === true;
}
byte
652
baris
20
Jenis
ts
Commit terakhir
16 Oktober 2026