- subscribe to terminal events in root route and dispatch terminal activity updates - add reducer support to maintain `runningTerminalIds` per thread/terminal - add unit tests for terminal event mapping and store activity state transitions
15 lines
354 B
TypeScript
15 lines
354 B
TypeScript
import type { TerminalEvent } from "@t3tools/contracts";
|
|
|
|
export function terminalRunningSubprocessFromEvent(event: TerminalEvent): boolean | null {
|
|
switch (event.type) {
|
|
case "activity":
|
|
return event.hasRunningSubprocess;
|
|
case "started":
|
|
case "restarted":
|
|
case "exited":
|
|
return false;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|