import { drainAndStopTuiSafely } from "./tui-lifecycle.js";
//#region src/tui/tui-suspend.ts
/**
* Pause the TUI (drain stdin + stop), run async work with a normal terminal, then restart.
* Caller should refocus the editor after `start()` if needed.
*/
async function withTuiSuspended(tui, work) {
	await drainAndStopTuiSafely(tui);
	try {
		return await work();
	} finally {
		tui.start();
	}
}
//#endregion
export { withTuiSuspended };

//# sourceMappingURL=tui-suspend.js.map