Skip to content

Commit 0c4c54d

Browse files
authored
fix: hanging readline (#80)
2 parents cc11917 + ec812b6 commit 0c4c54d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

.changeset/sour-lies-do.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@clack/core": patch
3+
---
4+
5+
fix `readline` hang on Windows

packages/core/src/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ export function block({
4040
return () => {
4141
input.off('keypress', clear);
4242
if (hideCursor) process.stdout.write(cursor.show);
43+
44+
// @ts-expect-error fix for https://github.com/nodejs/node/issues/31762#issuecomment-1441223907
45+
rl.terminal = false;
4346
rl.close();
4447
};
4548
}

0 commit comments

Comments
 (0)