[vlc-devel] commit: --list: do not use colors if stdout is not a TTY ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed Dec 23 20:20:44 CET 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Dec 23 21:20:15 2009 +0200| [633a5efc47a2748fcf87cf51e93036a9a8eb8bef] | committer: Rémi Denis-Courmont 

--list: do not use colors if stdout is not a TTY

This is consistent with --help behaviour.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=633a5efc47a2748fcf87cf51e93036a9a8eb8bef
---

 src/libvlc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 53b7747..96dae5c 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1921,6 +1921,9 @@ static void ListModules( libvlc_int_t *p_this, bool b_verbose )
 #ifdef WIN32
     ShowConsole( true );
     b_color = false; // don't put color control codes in a .txt file
+#else
+    if( !isatty( 1 ) )
+        b_color = false;
 #endif
 
     /* List all modules */




More information about the vlc-devel mailing list