-
-
Notifications
You must be signed in to change notification settings - Fork 559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set CREATE_NO_WINDOW
flag when executing Git hooks
#2371
base: master
Are you sure you want to change the base?
Conversation
I've tested this functionality using a dev build of GitButler with the |
Thanks for the contribution! Can you fix the ci issues? |
Sure thing! |
@extrawurst that should fix it, I had forgotten to ensure this was a noop when you're not on Windows |
@extrawurst out of curiosity, do you have an idea of when the next release will be? Also, I believe the CI workflow requires your approval again. |
/// On Windows, CLI applications that aren't the window's subsystem will | ||
/// create and show a console window that pops up next to the main | ||
/// application window when run. We disable this behavior by setting the | ||
/// `CREATE_NO_WINDOW` flag. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we add a link here to some place that documents this magic number? maybe even use a local constant that is named equally CREATE_NO_WINDOW
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and added the following to CommandExt
:
/// The process is a console application that is being run without a
/// console window. Therefore, the console handle for the application is
/// not set.
///
/// This flag is ignored if the application is not a console application,
/// or if it used with either `CREATE_NEW_CONSOLE` or `DETACHED_PROCESS`.
///
/// See: https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
This is just the documentation for CREATE_NO_WINDOW
from the linked Microsoft docs. Are you happy with this?
@icorbrey since this is a separate crate i can cut a release as soon as this is merged |
This Pull Request makes changes to accommodate GUI functionality in GitButler (see: gitbutlerapp/gitbutler#4982).
It changes the following:
CREATE_NO_WINDOW
flag when executing Git hooks on Windows.I followed the checklist:
make check
without errors