function setup
setup(session: WatchSession): void

Binds watch-mode keyboard shortcuts to the session's verbs: qq aborts, qa runs all, qf re-runs the last failures, ql repeats the last run.

Nothing but the binding lives here. What each shortcut means is a method on WatchSession, so the JS API and a future TUI get the same four behaviours without reimplementing them — and a rerun asked for by a keystroke now goes through the same serializer as the file watcher's, which is what the session's one-run-at-a-time guarantee assumed all along.

import * as KeyboardEvents from './keyboard-events.ts';
import type { WatchSession } from '../commands/test.ts';

// Defined, not invoked: attaches stdin key listeners.
function enableShortcuts(session: WatchSession) {
  KeyboardEvents.setup(session); // qq abort · qa run all · qf last failed · ql last run
}

Parameters

Return Type

void

Usage

import { setup } from "lib/setup/keyboard-events.ts";