>>> Nico, I prepared a patch but I'd appreciate it if you'd look over it >>> before I merge. >> >> Did you attach the patch? I can't see it. > > Geez...I _was_ a bit tired when I posted that. Here we go again > (still tired, but lets hope I get it right).
Alright, I took a short look at this. First a few comments just from looking at the diffs: I'm not sure about this part: - -#ifdef MACOS_X - /* os x doesn't really support fork(), so we can't fork of a gui - * in an already running vim. see gui_start() for more details. - */ - gui.dofork = FALSE; -#endif iirc, this made sure -f is ignored if passed to `:gui` as documented a `:h :gui`. It should probably stay in. Ah, wait, you don't define MAY_FORK on OS X at all, so this _can_ probably stay out. Just take another look if that's true :-) +#ifdef MACOS_X + if (gui.dofork) + macosx_fork(); +#endif + Add a "/* does not return */" comment to the call to macosx_fork(). + * Kinda sucks to restart vim when doing :gui, so don't fork in that + * case (make sure gui.dofork is only set when interpreting argv, not + * when doing :gui. Currently, gui.dofork is set to false in ex_gui(). The "restart" part is no longer really true. And this part of the comment should perhaps be in gui.c, possibly in ex_gui(). Also, a closing paren is missing :-P + * Also doesn't work well if vim starts cscope (or some other + * subprocess I guess), because it's not transferred to the newly + * exec'd process, leaving an orphaned process (not a zombie process) + * behind. The Right Thing is to kill all our child processes before + * calling exec. This is no longer true too, because we now fork before cscope and friends are started. You can probably just delete this paragraph. Now some testing…hm, looks as if weird things happen if I start MacVim in terminal mode (`build/Release/MacVim.app/Contents/MacOS/Vim`). You probably need to check if gui mode should be started in main, like this: + if (gui.starting && gui.dofork) + macosx_fork(); That seems to fix this particular problem. I can't find other problems (at least not no new ones: If you start in terminal mode, then do `:gui`, then hit ctrl-z in terminal, followed by `bg`, and then close the terminal, you get a DEAD_PROCESS in console, but that does currently happen too, and is not really a problem anyway). I didn't try _very_ hard, but I guess the patch is good enough for wider testing. Nico --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_mac" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
