Skip to content

No commandline output on Windows #242

Closed
5263 opened this Issue Jan 16, 2013 · 12 comments

5 participants

@5263
5263 commented Jan 16, 2013

When running openscad-2011.12 (win32) or 2013.01.08 (win32) on Windows 7 (64bit) there is no output on the commandline.
As a result I cant get the version informaiton i needed to choose whether to enable the workaround for #128 .
This means as well that there is no error reporting in case of syntax errors or no root element.
5263/FreeCAD-yorik#36

@5263
5263 commented Jan 16, 2013

i can extract the version information using pythons subprocess.Popen(). But get no response on the windows command line (cmd.exe)

@nophead
nophead commented Jan 16, 2013

On Windows an exe has a flag to say if it has a GUI. If that is set the shell does not connect the stdio pipes to anything. To make it work you need another copy of the executable with the flag cleared, or a wrapper program: https://github.com/nophead/Openscad_cl. I don't use that program any more. Instead I call it from python instead of the shell: see https://github.com/nophead/Mendel90/blob/master/openscad.py

@5263
5263 commented Jan 16, 2013

since i'm using python subprocess anyway. this issue is solved for me.
i think this deservers proper documentation at every place where the command line mode is mentioned.
thank you

@donbright
openscad member

i have a proposed patch for this here

master...windows_console

it uses the 'devenv' workaround method - it has two binaries, openscad.com and openscad.exe, .com is a Console App and .exe is a GUI App.

When you type "openscad" in the shell or from a script, Windows prioritizes the .com version, which is
a wrapper around the .exe version that grabs it's stdoutput and feeds it to the console.

When you run 'openscad.exe' from a shortcut or start menu, it just starts up as a normal GUI app.

Also i wasn't able to get openscad_cl to work (i only have 'wine' here to test Windows programs) so i rewrote it using popen()

If people think this is a Useful Idea i will try to do a pull request....

@kintel
openscad member
kintel commented Jan 22, 2013

Looks nice - feel free to merge when you're ready!

@donbright
openscad member

leaving this open until it is tested by someone other than myself.

@MichaelAtOz

5263, you can use

echo(version());
@donbright donbright referenced this issue Apr 6, 2013
Merged

Issue11 2 #288

@kintel
openscad member
kintel commented Apr 10, 2013

Has anyone apart from Don tested this yet?

@MichaelAtOz

I just downloaded 2013 03 09
In cmd 'openscad -?' outputs unrecognised option & the syntax list.
Doing the same with 2013 01 09 shows nothing and opens a GUI.
I think that's what it is meant to do.

I just created test.scad with one line

echo(version());

doing

openscad test.scad -o test.stl

produced

C:\Program Files (x86)\OpenSCAD>openscad test.scad -o test.stl
ECHO: [2013, 3, 9]
ECHO: [2013, 3, 9]
Current top level object is not a 3D object.

Don't know why there are two echos output.

I added

cube(10);

and it produced this and a test.stl file with a cube

C:\Program Files (x86)\OpenSCAD>openscad test.scad -o test.stl
ECHO: [2013, 3, 9]
ECHO: [2013, 3, 9]

C:\Program Files (x86)\OpenSCAD>

added another echo and a call to undefined module (syntax)

C:\Program Files (x86)\OpenSCAD>openscad test.scad -o test.stl
ECHO: [2013, 3, 9]
ECHO: "test"
WARNING: Ignoring unknown module 'syntax'.
ECHO: [2013, 3, 9]
ECHO: "test"
WARNING: Ignoring unknown module 'syntax'.

C:\Program Files (x86)\OpenSCAD>

So as long as two passes is expected (I don't normally use cmd line) it seems to work.

@donbright
openscad member

Awesome, thanks for testing...

the double-thing is that silly bug I introduced that Marius found ... its been patched.

it should be noted in 'known bugs' somewhere that cmdline windows still doesnt work with unicode arguments.

@MichaelAtOz

Oh, and doing 'openscad test.scad' opens a GUI with test.scad loaded, which I think is what's wanted.

@kintel
openscad member
kintel commented Apr 11, 2013

Perfect - I'm closing this - new Windows binaries will appear soon, with the double invokation fixed.

@kintel kintel closed this Apr 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.