To: vim-dev@vim.org Subject: Patch 6.2.246 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.246 Problem: Mac: Starting Vim from Finder doesn't show error messages. Solution: Recognize that output is being displayed by stderr being "/dev/console". (Eckehard Berns) Files: src/main.c, src/message.c *** ../vim-6.2.245/src/main.c Sun Feb 8 14:41:05 2004 --- src/main.c Sat Feb 7 18:30:04 2004 *************** *** 1160,1165 **** --- 1160,1173 ---- want_full_screen = FALSE; #endif + #if defined(FEAT_GUI_MAC) && defined(MACOS_X_UNIX) + /* When the GUI is started from Finder, need to display messages in a + * message box. isatty(2) returns TRUE anyway, thus we need to check the + * name to know we're not started from a terminal. */ + if (gui.starting && (!isatty(2) || strcmp("/dev/console", ttyname(2)) == 0)) + want_full_screen = FALSE; + #endif + /* * mch_init() sets up the terminal (window) for use. This must be * done after resetting full_screen, otherwise it may move the cursor *** ../vim-6.2.245/src/message.c Mon Feb 2 12:53:51 2004 --- src/message.c Sat Feb 7 15:39:47 2004 *************** *** 2150,2159 **** #if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) /* On Unix use stderr if it's a tty. ! * When not going to start the GUI also use stderr. */ if ( # ifdef UNIX isatty(2) # ifdef FEAT_GUI || # endif --- 2150,2164 ---- #if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) /* On Unix use stderr if it's a tty. ! * When not going to start the GUI also use stderr. ! * On Mac, when started from Finder, stderr is the console. */ if ( # ifdef UNIX + # ifdef MACOS_X_UNIX + (isatty(2) && strcmp("/dev/console", ttyname(2)) != 0) + # else isatty(2) + # endif # ifdef FEAT_GUI || # endif *************** *** 2214,2223 **** #if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) /* On Unix use stdout if we have a tty. This allows "vim -h | more" and * uses mch_errmsg() when started from the desktop. ! * When not going to start the GUI also use stdout. */ if ( # ifdef UNIX isatty(2) # ifdef FEAT_GUI || # endif --- 2219,2233 ---- #if (defined(UNIX) || defined(FEAT_GUI)) && !defined(ALWAYS_USE_GUI) /* On Unix use stdout if we have a tty. This allows "vim -h | more" and * uses mch_errmsg() when started from the desktop. ! * When not going to start the GUI also use stdout. ! * On Mac, when started from Finder, stderr is the console. */ if ( # ifdef UNIX + # ifdef MACOS_X_UNIX + (isatty(2) && strcmp("/dev/console", ttyname(2)) != 0) + # else isatty(2) + # endif # ifdef FEAT_GUI || # endif *** ../vim-6.2.245/src/version.c Sun Feb 8 17:07:07 2004 --- src/version.c Sun Feb 8 17:08:14 2004 *************** *** 639,640 **** --- 639,642 ---- { /* Add new patch number below this line */ + /**/ + 246, /**/ -- hundred-and-one symptoms of being an internet addict: 86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///