2023-10-27 16:02:54 -04:00
|
|
|
/**
|
|
|
|
* The main entrypoint when using Deno as the runtime
|
|
|
|
*/
|
2023-11-06 18:49:29 -05:00
|
|
|
import { getTermios } from "../common/mod.ts";
|
2023-11-01 15:05:31 -04:00
|
|
|
|
2023-11-06 15:36:41 -05:00
|
|
|
export * from './terminal_io.ts';
|
2023-10-27 16:02:54 -04:00
|
|
|
|
2023-11-06 15:36:41 -05:00
|
|
|
export async function init() {
|
|
|
|
const t = await getTermios();
|
2023-10-27 16:02:54 -04:00
|
|
|
|
2023-11-06 18:49:29 -05:00
|
|
|
t.enableRawMode();
|
|
|
|
|
2023-11-06 15:36:41 -05:00
|
|
|
globalThis.onbeforeunload = (): void => {
|
2023-11-06 18:49:29 -05:00
|
|
|
console.info('Disabling raw mode');
|
2023-11-06 15:36:41 -05:00
|
|
|
t.disableRawMode();
|
|
|
|
};
|
2023-11-01 15:27:31 -04:00
|
|
|
}
|