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
Run exe or shell command without cmd window popup #249
Comments
Hey @harg, Thank you for pointing this out, I'll investigate and let you know if I find something. Hopefully we can get this shipped in the next release! Cheers :) |
I do not know Rust but you can do it like that in Go : https://play.golang.org/p/2LAEm2LQc-X This is the win32 api : ShowWindow(... SW_HIDE) |
Thank you @harg, this is definitely very useful starting point to solve the problem |
I may have solved this by changing the default shell from CMD to Powershell on Windows (as CMD had also other problems). Would you have any problem with using Powershell? |
It's fine for me but I think some users might want to keep cmd... |
Fair point, the best solution then is to add another param to select the desired shell. |
Yep! So if you can do somehing like this : |
This is a wonderful idea! I use the WSL all the time but I never thought about integrating it with espanso. That could improve its capability a lot on Windows. After a bit of testing, I'd say the best way to integrate it with the current espanso implementation is something like:
In which |
I made a few tests, and unfortunately, the behavior still occurs. A possible solution would be to use the rust-subprocess library, hopefully there is an option to specify the required flag (I've opened an issue for that). |
As a note for myself, this could also be another solution: https://stackoverflow.com/questions/59692146/is-it-possible-to-use-the-standard-library-to-spawn-a-process-without-showing-th |
Happy to see this issue is still being worked on or at least an intention :) Was so happy to find a cross-platform solution but the powershell window is a pretty big deal-breaker at least for now |
I made some more experimentation and I might have found the correct approach, so I'll try to ship it in the next release. For reference: We first need to activate the
Then, when spawning the powershell/cmd command, use the
I already tried this flag before but it didn't work as expected. The answer is that without the first As a result though, the console output doesn't work anymore (which is useful when developing), so to solve that problem we have to attach to the parent console with:
|
wow damn, sounds like a lot of moving parts! Thanks for the update on this one :) |
Just wanted to say, this bug will be finally fixed in the upcoming release! |
Thank you for this great software!
On windows, is it possible to run an exe or a shell command without the flashing cmd window?
The text was updated successfully, but these errors were encountered: