-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
windows: Set CREATE_NO_WINDOW
for commands
#18447
windows: Set CREATE_NO_WINDOW
for commands
#18447
Conversation
I think the best method should be introduce an file name |
That's my next move. The idea of this draft PR is that making a quick demo to see if it could fix the issue. If so, then I'm gonna refactor the codes. |
e427d83
to
6a46c28
Compare
Is it really the only way we can enable window-less command invocations in Windows? |
I think this is only way |
This is very very odd, but then I think #19018 is not that bad if it's a documented single entry for all such plugin invocations. I'll leave the review (and the choice) to the person who knows things better than me though. |
I'm afraid this is indeed the case. cvt(c::CreateProcessW(
program.as_ptr(),
cmd_str.as_mut_ptr(),
ptr::null_mut(),
ptr::null_mut(),
c::TRUE,
flags,
envp,
dirp,
si_ptr,
&mut pi,
)) According to Microsoft's documentation, if you don't want the window to appear, you can set Moreover, in Windows programming, whether a window is displayed by default when calling |
ca2910a
to
c44a5d8
Compare
I referenced VSCode's code here to introduce Additionally, since VSCode's code is under the MIT license and the crate |
crates/util/src/command.rs
Outdated
use std::ffi::OsStr; | ||
|
||
#[cfg(target_os = "windows")] | ||
const CREATE_NO_WINDOW: u32 = 134217728u32; |
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.
const CREATE_NO_WINDOW: u32 = 134217728u32; | |
const CREATE_NO_WINDOW: u32 = 0x08000000; |
Small nitpick, but I believe this to be the more readable and understandable representation for the 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.
Thx!
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.
No worries, thank you for all your awesome contributions for the community!
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
Just let them do their work, seems like they are too busy at ssh remote dev and no time for other issues. JunkuiZhang seems to be the only Windows dev that they have which is currently active and he's human too, and there's still a lot of issues for him to fix. |
@teknalb You can cherry-pick this PR and build it by yourself if you're really concerned |
@eternalphane Yep, that's exactly what I ended up doing. |
d021474
to
3edff29
Compare
It looks like we need |
I'll to continue with this PR once the Zed team has decided on which approach to take. |
for anyone who want to use this branch's work, check out https://github.com/shenjackyuanjie/zed-win-build/releases |
This comment has been minimized.
This comment has been minimized.
3edff29
to
a10373d
Compare
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.
Seems cool. There doesn't seems to be any malicious code hidden (I think) :P
Thank you! |
- Closes: zed-industries#18371 Release Notes: - N/A
…e-conflicts resolution (zed-industries#20991) After zed-industries#18447 was merged, I reviewed the PR code as usual. During this review, I realized that some code was unintentionally removed when I was resolving merge conflicts in zed-industries#18447. Sorry! Release Notes: - N/A
Release Notes: