On 16/08/10 10:57, Nikola Knezevic wrote:
Hi,

there is a problem with MacVim when using zsh as default shell. The
problem occurs in VCSCommand plugin, when it spawns git process trying
to detect vcs-related info. These processes just hang, and wait. I
described it at [1]. Bjorn pointed me to the implementation of
macosx_fork in os_macosx.m, as the most likely culprit. After some
looking, I decided to implement double-fork trick, to completely
detach Vim from the terminal, which did the trick. However, I still
don't know what is the actual reason for sub-processes hanging.

My question is: what are the requirements for the fork()-ed instance
of Vim? Should it have access to the controlling terminal, or not? I'm
trying to understand if there are any problems with using double-fork
with vim.

[1] http://groups.google.com/group/vim_mac/browse_thread/thread/78b18ce8cc15557d

Thanks,
Nikola


Console Vim doesn't fork.

The Vim GUI normally forks, unless called with -f or --nofork. This fork releases the command prompt and (IIUC) also closes sysin, sysout and syserr while establishing an input-output connection with the graphical interface (i.e. with X11 in the case of an X11 GUI, I'm not sure with what in the case of MacVim).

Vim for Windows can be either a GUI or a command-line program, but not both with the same binary. Otherwise its startup is similar.

When invoked with -f or --nofork, Vim intentionally doesn't fork, so that a calling program (cron maybe, or a Firefox extension) can notice when Vim really terminates, and not mistake the fork with an exit.


Best regards,
Tony.
--
The years of peak mental activity are undoubtedly between the ages of
four and eighteen.  At four we know all the questions, at eighteen all
the answers.

--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui