Loading ...
Sorry, an error occurred while loading the content.

1447Re: Mac-VIM doesn't cooperate with Finder

Expand Messages
  • Eckehard Berns
    Feb 7, 2004
    • 0 Attachment
      > Aha. I suppose you could see the messages on /dev/console by opening
      > it. (never had the idea to look there though).

      Mac OS X comes with a utility called Console, which is some kind of log
      viewer. And every output to /dev/console goes into
      /Library/Logs/.../$LOGNAME/console.log (similar to .xsession-errors). I
      had Console running at some point and caught the output of Vim messages
      kind of by incidence :)

      > That looks like a good solution. To stay on the safe side I think we
      > should also use isatty(). And add a comment about why it's done this
      > way (in two years we will have forgotten all about it).

      Yes, checking isatty() also is important. I forgot about that. Someone
      might redirect stderr to /dev/null or something, which must be tested

      > Here is the patch with my additions, please check it out:

      Works fine for me. I tried a terminal Vim, GUI Vim started from
      Terminal, and GUI vim started from Finder (and by "open -a Vim"). The
      error dialog pops up only when there is no terminal to show the output.

      I thought about the redirection and additional isatty() check some
      more. I actually use a DropOutScript (wrapper around a shell script) to
      open every file with the extension .vimsession by calling Vim with some
      arguments. I redirect input and output as well as stderr to /dev/null.
      Since this isn't a tty, ttyname returns NULL (I assume) and the strcmp
      causes a SIGBUS. The line in main() therefor should read:

      if (gui.starting && (!isatty(2) || strcmp("/dev/console", ttyname(2))
      == 0))

      After this little change, starting the GUI with redirected output works
      again (and reports errors via a popup dialog.)

      Eckehard Berns
    • Show all 22 messages in this topic