2023-10-27 16:02:54 -04:00
|
|
|
/**
|
|
|
|
* The main entrypoint when using Deno as the runtime
|
|
|
|
*/
|
2023-11-06 15:36:41 -05:00
|
|
|
import {getTermios} from "../common/termios.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 15:36:41 -05:00
|
|
|
globalThis.onbeforeunload = (): void => {
|
|
|
|
console.log('Disabling raw mode');
|
|
|
|
t.disableRawMode();
|
|
|
|
};
|
2023-11-01 15:27:31 -04:00
|
|
|
}
|