[Windows] Add function execute_shell_for_output()

Reporter: time-killer-games  |  Status: closed  |  Last Modified: June 22, 2019, 08:17:42 AM

@RobertBColton ready for review.

Please ping @JoshDreamland since he was the last one discussing this with you. I am working on other things at the moment. Do this as a general rule of thumb.

@RobertBColton josh told me to ping you for windows related stuff. The code doesn't work anyway i just tested it so im going to spend more time on it tmr and then ill ask josh

Codecov Report

Merging #1675 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1675   +/-   ##
  Coverage   18.82%   18.82%           
  Files         169      169           
  Lines       16782    16782           
  Hits         3159     3159           
  Misses      13623    13623

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb9d867...81c309c. Read the comment docs.


Ok, sounds good. Also, you don't have to actually tag people by name for every comment. It's only really useful if multiple people are talking or the person has not been subscribed to the issue. The first time you mention them or they reply to the issue/pull they are subscribed and will receive notifications for every reply.

@JoshDreamland I'm busy with freelance work right now but I'd love to get some assistance on this if I can't figure it out on my own, I've tried show_message(execute_shell_for_output("echo 1")) and it always shows some random foreign characters, I think because I am doing the wide char version of popen but not the other functions such as fread but I can't seem to find the wide char versions of the other functions, is the biggest issue. I really need this to be cross-platform for something I'm working on. I need UTF-8 support.

From the Microsoft docs:

_wpopen is a wide-character version of _popen; the path argument to _wpopen is a wide-character string. _wpopen and _popen behave identically otherwise.


Then that's really odd, I wonder why it isn't working then.

@JoshDreamland to clarify what isn't working, the command argument works and it executes stuff, but the output doesn't and it returns random crap characters. While stuff is executing and you try to click on or interact with the game window too much, the game will segfault.
Please sign in to post comments, or you can view this issue on GitHub.