markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.19k stars 60 forks source link

Console window is blinking on app startup on Windows 10. #89

Open ababo opened 4 years ago

ababo commented 4 years ago

When I add pkger to my project I notice a console window opening and closing fast for 2-3 times on app startup.

kvnxiao commented 4 years ago

Is this issue not going to be addressed? How can this be fixed?

George-lewis commented 4 years ago

The issue is still present :(

kvnxiao commented 4 years ago

@George-lewis I recommend just moving to vfsgen.

pieceofsoul commented 3 years ago

Without digging deeper into the background of the implementation, the console window blinking is triggered by the pkger/here package which uses github.com/gobuffalo/here.

https://github.com/markbates/pkger/blob/0273362499c78b8d8ac7047eadd4f38454bc609a/pkger.go#L18 https://github.com/gobuffalo/here/blob/eef370dfc10ce5b1d0c4513dcb14ecfb2135b83f/here.go#L30 https://github.com/gobuffalo/here/blob/eef370dfc10ce5b1d0c4513dcb14ecfb2135b83f/current.go#L11

In the end this calls

c := exec.Command(n, args...)

which is the reason for the blinking console window.

ababo commented 3 years ago

So it should be easy to hide the console windows doing c.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} on Windows.