Skip to content

Commit 0ba40c4

Browse files
authored
Merge pull request #129 from lzdyes/main
fix: print Chinese characters are garbled in Windows terminal
2 parents ee60a71 + 70a15f2 commit 0ba40c4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/watch.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,17 @@ 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+
// https://github.com/electron-vite/electron-vite-vue/pull/129
48+
electronProcess.stdout.on('data', (data) => {
49+
const str = data.toString().trim()
50+
str && console.log(str)
51+
})
52+
electronProcess.stderr.on('data', (data) => {
53+
const str = data.toString().trim()
54+
str && console.error(str)
55+
})
4756
},
4857
}
4958

0 commit comments

Comments
 (0)