Skip to content

Commit 75b5e37

Browse files
committed
fix: print Chinese characters are garbled in Windows terminal
1 parent ee60a71 commit 75b5e37

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/watch.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ function watchMain(server) {
4242
electronProcess = null
4343
}
4444

45-
electronProcess = spawn(electron, ['.'], { stdio: 'inherit', env })
45+
electronProcess = spawn(electron, ['.'], { env })
4646
electronProcess.on('exit', process.exit)
47+
electronProcess.stdout.on('data', (data) => {
48+
const str = data.toString().trim()
49+
str && console.log(str)
50+
})
51+
electronProcess.stderr.on('data', (data) => {
52+
const str = data.toString().trim()
53+
str && console.error(str)
54+
})
4755
},
4856
}
4957

0 commit comments

Comments
 (0)