From f49468a228f61414276b0621794af0d51c1cf445 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Fri, 1 Oct 2004 12:24:16 +0000 Subject: [PATCH] * src/libvlc.c, include/vlc_interface.h: don't open a win32 console when using a cygwin shell. --- include/vlc_interface.h | 3 +++ src/libvlc.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/include/vlc_interface.h b/include/vlc_interface.h index 9182e3a6b2..0032475020 100644 --- a/include/vlc_interface.h +++ b/include/vlc_interface.h @@ -118,10 +118,13 @@ VLC_EXPORT( void, intf_Destroy, ( intf_thread_t * ) ); *****************************************************************************/ #if defined( WIN32 ) && !defined( UNDER_CE ) # define CONSOLE_INTRO_MSG \ + if( !getenv( "PWD" ) || !getenv( "PS1" ) ) /* detect cygwin shell */ \ + { \ AllocConsole(); \ freopen( "CONOUT$", "w", stdout ); \ freopen( "CONOUT$", "w", stderr ); \ freopen( "CONIN$", "r", stdin ); \ + } \ msg_Info( p_intf, COPYRIGHT_MESSAGE ); \ msg_Info( p_intf, _("\nWarning: if you can't access the GUI " \ "anymore, open a dos command box, go to the " \ diff --git a/src/libvlc.c b/src/libvlc.c index 31390bf41c..8164fa2ef2 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -2168,11 +2168,15 @@ static void Version( void ) static void ShowConsole( void ) { # ifndef UNDER_CE + + if( getenv( "PWD" ) && getenv( "PS1" ) ) return; /* cygwin shell */ + AllocConsole(); freopen( "CONOUT$", "w", stdout ); freopen( "CONOUT$", "w", stderr ); freopen( "CONIN$", "r", stdin ); # endif + return; } #endif -- 2.39.2