Skip to content

Commit

Permalink
replace readline capture with simple stdin listener
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Jun 8, 2020
1 parent 03f66d6 commit 546c94e
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/commands/paint.ts
Expand Up @@ -237,20 +237,17 @@ export function paint(
});

if (devMode) {
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
});
rl.on('line', (input) => {
readline.emitKeypressEvents(process.stdin);
process.stdin.on('keypress', (str, key) => {
if (key.name !== 'return' && key.name !== 'enter') {
return;
}
if (!missingWebModule) {
return;
}
devMode.addPackage(missingWebModule.pkgName);
repaint();
});
rl.on('close', function () {
process.exit(0);
});
}

repaint();
Expand Down

0 comments on commit 546c94e

Please sign in to comment.