fix: print Chinese characters are garbled in Windows terminal

This commit is contained in:
lzdyes 2022-05-16 14:45:52 +08:00
parent ee60a719f6
commit 75b5e3754e
No known key found for this signature in database
GPG Key ID: 37AD81AA9446BB88

View File

@ -42,8 +42,16 @@ function watchMain(server) {
electronProcess = null
}
electronProcess = spawn(electron, ['.'], { stdio: 'inherit', env })
electronProcess = spawn(electron, ['.'], { env })
electronProcess.on('exit', process.exit)
electronProcess.stdout.on('data', (data) => {
const str = data.toString().trim()
str && console.log(str)
})
electronProcess.stderr.on('data', (data) => {
const str = data.toString().trim()
str && console.error(str)
})
},
}