vanBassum / Wakatime.Unity

A Wakatime plugin for Unity
MIT License
36 stars 7 forks source link

Fixes vanBassum#8, use another way to hide the window. #9

Closed buger404 closed 1 year ago

buger404 commented 1 year ago

I'm not sure why this is not worked for Windows Terminal,

startInfo.WindowStyle = ProcessWindowStyle.Hidden;

but using the following code, it works and returns proper branch name:

startInfo.CreateNoWindow = true;

I read docs from Microsoft:

// This code assumes the process you are starting will terminate itself.
// Given that it is started without a window so you cannot terminate it
// on the desktop, it must terminate itself or you can do it programmatically
// from this application using the Kill method.

So I also added this code after fetch the branch name to ensure it will be terminated:

process.Kill();