-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow suppressing cmd.exe windows on launching applications #128
Comments
ping @jaimergp |
We have some logic for this, but it might be not working. Take a look at the windows module in the cep-devel branch. I am typing from the phone, sorry for the brevity! |
Hmm... I don't see anything in cep-devel. But upon closer review, the cmd.exe window is only visible for a brief flash, then disappears; also the shorcut "Target" is:
which has |
Yea, exactly, that's the part I was mentioning: menuinst/menuinst/platforms/win.py Lines 266 to 269 in b0199ae
Maybe the activation scripts are launching CMD on their own too, perhaps an oversight. Let's leave this open because I need to investigate further. |
We might need a different approach (VBScript?) since the flashing behaviour is a known issue: https://superuser.com/questions/62525/run-a-batch-file-in-a-completely-hidden-way |
This could work (see last comment on that answer). |
I added
Commenting out the entire contents of Something about |
I also get the same behavior bypassing PowerShell
|
This is strange because |
I am looking into this as part of #119 and one thing I noticed is that Powershell does indeed hide the CMD window. What we see is the powershell dialog starting CMD 😬 I checked with the bare It's getting more and more complicated with so many shell layers calling each other! |
Uh, turns out this way of launching the script produces an almost invisible flash 😂 command = [
f'"{system32 / "cmd.exe"}"', "/C", "START", "/MIN", '""',
f'"{system32 / "WindowsPowerShell" / "v1.0" / "powershell.exe"}"',
"-WindowStyle", "hidden",
f"\"start '{script}' {arg1}-WindowStyle hidden\"",
] |
Perhaps an infinite series of nested shells would converge to zero visibility 🤣 |
|
The CMD flash is a byproduct of us having to run some shell code before running the shortcut target, sadly. If the shortcut doesn't need activation or pre-launch logic, then we can call it directly. If it works for Spyder, then perfect! Less moving parts too. Activation is default in case some package in the dependency tree requires activation-time logic to work properly (e.g. let's say compilers) and it can be difficult for users to diagnose. |
Current approach doesn't "flash" but still creates a (short lived) console window that is minimized to task bar. Still hacky and not ideal but It Works (tm). |
Checklist
What is the idea?
When launching applications from shortcuts created by
menuinst
on Windows, a cmd.exe window opens. A key should be provided in themenu.json
file to specify whether the shortcut should suppress this behavior andmenuinst
should take the necessary steps to enforce this when creating the shortcut.Why is this needed?
Unwanted cmd.exe windows are not suppressed.
What should happen?
cmd.exe windows should be suppressed or not according to specification in the
menu.json
file.Additional Context
No response
The text was updated successfully, but these errors were encountered: