diff options
| author | Patrick Storz <eduard.braun2@gmx.de> | 2019-07-02 19:52:57 +0000 |
|---|---|---|
| committer | Patrick Storz <eduard.braun2@gmx.de> | 2019-07-03 19:49:06 +0000 |
| commit | 08db5acc6befd72c40c3c0e2b0603e7d8a2d7ce8 (patch) | |
| tree | 3661e43783452d79fa87ed8be43b26b016ba9a33 /src/inkscape-application.cpp | |
| parent | Group command line options in --help output (diff) | |
| download | inkscape-08db5acc6befd72c40c3c0e2b0603e7d8a2d7ce8.tar.gz inkscape-08db5acc6befd72c40c3c0e2b0603e7d8a2d7ce8.zip | |
Avoid outputting control characters to non-tty destinations.
Diffstat (limited to 'src/inkscape-application.cpp')
| -rw-r--r-- | src/inkscape-application.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/inkscape-application.cpp b/src/inkscape-application.cpp index 23bdb4e57..272bdce6d 100644 --- a/src/inkscape-application.cpp +++ b/src/inkscape-application.cpp @@ -461,6 +461,17 @@ template<class T> void ConcreteInkscapeApplication<T>::_start_main_option_section(const Glib::ustring& section_name) { +#ifndef _WIN32 + // Avoid outputting control characters to non-tty destinations. + // + // However, isatty() is not useful on Windows + // - it doesn't recognize mintty and similar terminals + // - it doesn't work in cmd.exe either, where we have to use the inkscape.com wrapper, connecting stdout to a pipe + if (!isatty(fileno(stdout))) { + return; + } +#endif + this->add_main_option_entry(T::OPTION_TYPE_BOOL, Glib::ustring("\b\b \n") + section_name + ":"); } |
