Skip to content

Commit 46e93d8

Browse files
authored
fix(demo): check if stdin isTTY prior to setRawMode. (#111)
1 parent 6a04c49 commit 46e93d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

demo/micropython-run.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ cdc.onSerialData = (value) => {
3030
process.stdout.write(value);
3131
};
3232

33-
process.stdin.setRawMode(true);
33+
if (process.stdin.isTTY) {
34+
process.stdin.setRawMode(true);
35+
}
3436
process.stdin.on('data', (chunk) => {
3537
// 24 is Ctrl+X
3638
if (chunk[0] === 24) {

0 commit comments

Comments
 (0)