Inkscape.org
Beyond the Basics Command-line stdout output is still lost on Windows (7)
  1. #1
    ronburk ronburk @ronburk

    Windows 7, 1.0beta1 (fe3e306, 2019-09-17)

    .\inkscape.exe --help

    exits with code 0, produces no output.

    .\inkscape.exe --help >foo.out

    sends help text to foo.out.

     

    This is an ancient bug, but since it still seems present in beta, maybe worth waving the flag about it again. Can't find it in new or old bug databases, which may just mean I'm not good at searching them. stderr is likely lost too, but most likely fixing one will fix the other, so seems no point in trying to repro that.

  2. #2
    Patrick Storz Patrick Storz @Ede_123

    This is a fundamental limitation in Windows and can not be "fixed" easily without causing other issues.

    For this specific reason we provide the executable wrapper "inkscape.com", which will produce output when used from command line. You can also just use "inkscape" as a command name if you have trouble remembering the "com".

  3. #3
    ronburk ronburk @ronburk

    Thanks. If that's the final hack, it needs to be featured prominently in the documentation about using the command-line. Otherwise, people just conclude inkscape is broken.

     

    But while you're on the line :-), any idea what's up with the funky double-dash/double-tab sprinkled in the --help output?

     

    Foo
  4. #4
    Patrick Storz Patrick Storz @Ede_123

    If you have suggestions, contributions to our documentation are always welcome! As we're a community-driven project and developers tend to assume things are self-explanatory, documentation is often neglected, especially for OS-specific details like this.

    As for the dash/box thing:
    That's an actual hack we use for creating empty lines in the --help output as the underlying library we use (glib) does not support it. The boxes are supposed to be backspaces, so in theory the dashes would be deleted and invisible in the output, at least if rendered to a console window. Is this a console window or did you redirect the output to a file (In the latter case it's expected behavior, as - again a Windows limitation - there's no reliable way to detect this redirection).

  5. #5
    ronburk ronburk @ronburk

    It's a console window, but probably not your favorite shell.

    > again a Windows limitation - there's no reliable way to detect this redirection

    Never hit that limitation in my years of Windows programming. The ancient documented API advice to use GetConsoleMode() is somehow problematic for Inkscape?

     

  6. #6
    Patrick Storz Patrick Storz @Ede_123

    On Windows we currently support cmd.exe / PowerShell and MinTTY (because that's what I use and/or have access to). The goal would be to support other shells as well if possible, but obviously I can't test every shell.

    Out of curiosity:
    What is the output of "echo -e "12\b3" (if you have access to GNU echo or compatible)?

     

    > The ancient documented API advice to use GetConsoleMode() is somehow problematic for Inkscape?

    That will only work if a console is attached to the process, which is never true for "inkscape.exe" (which is the previous limitation) and only true for "inkscape.com" if run through cmd.exe and possibly PowerShell, but not when run through other terminals like MinTTY (which redirect the output to a pipe).

    That said I won't rule out that options exist out there, so if you have ideas, feel free to get involved and look into the code. Be warned, though, that stuff get's quickly complex, as we do not target Widnows exclusively, but aim to write portable code.

     

     

Inkscape Inkscape.org Inkscape Forum Beyond the Basics Command-line stdout output is still lost on Windows (7)