Files
hermes-agent/ui-opentui/src/logic/defer.ts
T
alt-glitch a38152cd91 feat(tui): run on Node 26 (one runtime), finalize copy UX, rename to ui-opentui
Ports the engine off the second JS runtime onto Node 26.3 (node:ffi) so the
repo ships a single JavaScript runtime: child_process for the gateway, vitest
for tests, an esbuild + Solid build step. Mouse selection copies the rendered
text you highlight, and the clipboard path is crash-proofed (a broken copy
pipe no longer quits the UI). Renames the engine dir ui-tui-opentui-v2/ ->
ui-opentui/ and updates the launcher/installer/Docker references.
2026-06-09 16:16:48 +00:00

13 lines
520 B
TypeScript

/**
* deferClose — defer an overlay/prompt close by one tick.
*
* Overlays REPLACE the composer (a `<Switch>`), so when one closes the composer
* remounts + refocuses. Running the close on the NEXT tick lets the current
* key/close event (Esc/q/Enter/y/select) finish dispatching first, so the
* keystroke that triggered the close can't leak into the freshly-focused
* composer (e.g. `/clear`→y once left a stray "y" in the input).
*/
export function deferClose(fn: () => void): void {
setTimeout(fn, 0)
}