CLI: restore terminal state on exit
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { clearActiveProgressLine } from "./terminal/progress-line.js";
|
||||
import { restoreTerminalState } from "./terminal/restore.js";
|
||||
|
||||
export type RuntimeEnv = {
|
||||
log: typeof console.log;
|
||||
@@ -16,6 +17,7 @@ export const defaultRuntime: RuntimeEnv = {
|
||||
console.error(...args);
|
||||
},
|
||||
exit: (code) => {
|
||||
restoreTerminalState("runtime exit");
|
||||
process.exit(code);
|
||||
throw new Error("unreachable"); // satisfies tests when mocked
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user