Actually fix crash on macOS...somehow
This commit is contained in:
parent
9711202c3b
commit
e9ce780c1d
@ -3,18 +3,19 @@ import { getTermios } from './termios.ts';
|
||||
import Editor from './editor.ts';
|
||||
|
||||
export async function main() {
|
||||
const { term, file, onExit, onEvent } = await getRuntime();
|
||||
const rt = await getRuntime();
|
||||
const { file, term } = rt;
|
||||
|
||||
// Setup raw mode, and tear down on error or normal exit
|
||||
const t = await getTermios();
|
||||
t.enableRawMode();
|
||||
onExit(() => {
|
||||
rt.onExit(() => {
|
||||
t.disableRawMode();
|
||||
t.cleanup();
|
||||
});
|
||||
|
||||
// Setup error handler to log to file
|
||||
onEvent('error', (error) => {
|
||||
rt.onEvent('error', (error) => {
|
||||
t.disableRawMode();
|
||||
file.appendFileSync('./scroll.err', JSON.stringify(error, null, 2));
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user