fix eslint errors

This commit is contained in:
Ralf Vogler 2025-05-22 16:48:32 +02:00
parent 1dbbfaf3ad
commit 6d9a3ad140
7 changed files with 59 additions and 51 deletions

View file

@ -7,19 +7,19 @@ import { prompt, handleSIGINT } from '../src/util.js';
// });
handleSIGINT();
function onRawSIGINT(fn) {
const { stdin, stdout } = process;
stdin.setRawMode(true);
stdin.resume();
stdin.on('data', data => {
const key = data.toString('utf-8');
if (key === '\u0003') { // ctrl + c
fn();
} else {
stdout.write(key);
}
});
}
// function onRawSIGINT(fn) {
// const { stdin, stdout } = process;
// stdin.setRawMode(true);
// stdin.resume();
// stdin.on('data', data => {
// const key = data.toString('utf-8');
// if (key === '\u0003') { // ctrl + c
// fn();
// } else {
// stdout.write(key);
// }
// });
// }
// onRawSIGINT(() => {
// console.log('raw'); process.exit(1);
// });