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

problem to detach gvim on mingw32

Expand Messages
  • Christian MICHON
    Hi vim developpers, I m trying to use gvim 6.4 on mingw32/xp. Compilation is fine, and I get a fine executable. Yet, each time I launch gvim inside a
    Message 1 of 11 , Dec 9, 2005
      Hi vim developpers,

      I'm trying to use gvim 6.4 on mingw32/xp. Compilation is fine,
      and I get a fine executable.

      Yet, each time I launch gvim inside a mingw/rxvt terminal,
      inside a mingw/sh shell, the terminal is unusable.
      Indeed, it seems the process gvim doesn't detach itself
      from the terminal, as I would expect.

      Is it a know problem ?
      Is it something that can be corrected by vimrc settings ?
      Is it something which could be solved by patch ?

      Thanks in advance for any hint on this one.

      --
      Christian
    • John Love-Jensen
      Hi Christian, How are you detaching* gvim from the mingw/sh shell when you launch it? --Eljay * attempting to
      Message 2 of 11 , Dec 9, 2005
        Hi Christian,

        How are you detaching* gvim from the mingw/sh shell when you launch it?

        --Eljay

        * attempting to
      • Christian MICHON
        I would like to detach it. Right now, I can t, unless I do a gvim & On linux/solaris, inside a rxvt, if I lauch gvim, the gvim process forks. Apparently, the
        Message 3 of 11 , Dec 9, 2005
          I would like to detach it. Right now, I can't, unless I do
          a "gvim &"

          On linux/solaris, inside a rxvt, if I lauch gvim, the gvim process
          forks. Apparently, the std behaviour on mingw is equivalent to
          --nofork, which is not the behaviour I would expect.

          If there's a way around without adding the & by patch, I'm
          interested. Apparently it doesn't seem to be a vimrc issue,
          but really a binary limitation :(

          Christian

          On 12/9/05, John Love-Jensen <eljay@...> wrote:
          > Hi Christian,
          >
          > How are you detaching* gvim from the mingw/sh shell when you launch it?
          >
          > --Eljay
          >
          > * attempting to
          >
          >
        • John Love-Jensen
          Hi Christian, ... Good, good, good. That s how you are supposed to tell the shell to detach the spawned application. ... Hmmm, well... you could create a gvim
          Message 4 of 11 , Dec 9, 2005
            Hi Christian,

            > I would like to detach it. Right now, I can't, unless I do
            > a "gvim &"

            Good, good, good. That's how you are supposed to tell the shell to detach
            the spawned application.

            > On linux/solaris, inside a rxvt, if I lauch gvim, the gvim process
            > forks. Apparently, the std behaviour on mingw is equivalent to
            > --nofork, which is not the behaviour I would expect.

            > If there's a way around without adding the & by patch, I'm
            > interested. Apparently it doesn't seem to be a vimrc issue,
            > but really a binary limitation :(

            Hmmm, well... you could create a gvim front end script that always detaches
            on the platform that you always want it to detach.

            That's what I'd do.

            Sincerely,
            --Eljay
          • Marvin Renich
            ... Eljay, I am not sure that you understand what Christian is saying. I don t use (g)vim on mingw32, but in Linux and from a Command Prompt in Windows, gvim
            Message 5 of 11 , Dec 9, 2005
              * John Love-Jensen <eljay@...> [051209 09:52]:
              > Hi Christian,
              >
              > > I would like to detach it. Right now, I can't, unless I do
              > > a "gvim &"
              >
              > Good, good, good. That's how you are supposed to tell the shell to detach
              > the spawned application.
              >
              > > On linux/solaris, inside a rxvt, if I lauch gvim, the gvim process
              > > forks. Apparently, the std behaviour on mingw is equivalent to
              > > --nofork, which is not the behaviour I would expect.
              >
              > Sincerely,
              > --Eljay
              >

              Eljay, I am not sure that you understand what Christian is saying. I
              don't use (g)vim on mingw32, but in Linux and from a Command Prompt in
              Windows, gvim is supposed to (and does) fork itself so the xterm,
              Command Prompt, or other console-based shell returns immediately,
              without waiting for gvim to exit. He is saying that this correct
              behavior does not happen under mingw32. Using "&" to background the
              process is not supposed to be necessary.

              ...Marvin
            • John Love-Jensen
              Hi Marvin, NOTEPAD.EXE in Windows under CMD.EXE detaches. NOTEPAD.EXE in Windows under Cygwin s bash.exe does not detach, unless & is appended. I think the
              Message 6 of 11 , Dec 9, 2005
                Hi Marvin,

                NOTEPAD.EXE in Windows under CMD.EXE detaches.

                NOTEPAD.EXE in Windows under Cygwin's bash.exe does not detach, unless & is
                appended.

                I think the behavior is shell-centric.

                Sincerely,
                --Eljay
              • Christian MICHON
                Thanks to Marvin for understanding what I meant. The shell in rxvt/mingw is bash 2.04. John s suggestion seems right. Inside a CMD.EXE, if I launch
                Message 7 of 11 , Dec 9, 2005
                  Thanks to Marvin for understanding what I meant.

                  The shell in rxvt/mingw is bash 2.04.

                  John's suggestion seems right. Inside a CMD.EXE, if
                  I launch mingw/sh.exe and then gvim.exe, it still
                  doesn't fork. So mingw/sh is the problem...

                  I would expect bash at least to behave similarly in
                  both mingw and linux :(


                  On 12/9/05, John Love-Jensen <eljay@...> wrote:
                  > Hi Marvin,
                  >
                  > NOTEPAD.EXE in Windows under CMD.EXE detaches.
                  >
                  > NOTEPAD.EXE in Windows under Cygwin's bash.exe does not detach, unless & is
                  > appended.
                  >
                  > I think the behavior is shell-centric.
                • hermitte@free.fr
                  ... As a matter of facts, this is a very nice and useful feature that permits us to launch win32-gvim from cygwin-mutt as --nofork has no effect on win32-vim
                  Message 8 of 11 , Dec 9, 2005
                    Selon Christian MICHON <christian.michon@...>:

                    > John's suggestion seems right. Inside a CMD.EXE, if
                    > I launch mingw/sh.exe and then gvim.exe, it still
                    > doesn't fork. So mingw/sh is the problem...
                    >
                    > I would expect bash at least to behave similarly in
                    > both mingw and linux :(

                    As a matter of facts, this is a very nice and useful feature that permits us to
                    launch win32-gvim from cygwin-mutt as --nofork has no effect on win32-vim -- as
                    least on vim 5.7, I haven't checked since then.

                    Use start or &, or any wrapper that could perform smart convertions of
                    parameters.
                    --
                    Luc Hermitte
                  • hermitte@free.fr
                    ... As a matter of facts, this is a very nice and useful feature that permits us to launch win32-gvim from cygwin-mutt as --nofork has no effect on win32-vim
                    Message 9 of 11 , Dec 9, 2005
                      Selon Christian MICHON <christian.michon@...>:

                      > John's suggestion seems right. Inside a CMD.EXE, if
                      > I launch mingw/sh.exe and then gvim.exe, it still
                      > doesn't fork. So mingw/sh is the problem...
                      >
                      > I would expect bash at least to behave similarly in
                      > both mingw and linux :(

                      As a matter of facts, this is a very nice and useful feature that permits us to
                      launch win32-gvim from cygwin-mutt as --nofork has no effect on win32-vim -- as
                      least on vim 5.7, I haven't checked since then.

                      Use start or &, or any wrapper that could perform smart convertions of
                      parameters.
                      --
                      Luc Hermitte
                    • Илья
                      ... Mingw is just a gcc port to Windows platform. It does have special libs and does not provide some nonstandart API to Win32, so there is no such thing as
                      Message 10 of 11 , Dec 9, 2005
                        Christian MICHON wrote:

                        >I would like to detach it. Right now, I can't, unless I do
                        >a "gvim &"
                        >
                        >On linux/solaris, inside a rxvt, if I lauch gvim, the gvim process
                        >forks. Apparently, the std behaviour on mingw is equivalent to
                        >--nofork, which is not the behaviour I would expect.
                        >
                        >
                        Mingw is just a gcc port to Windows platform. It does have special libs
                        and does not provide some nonstandart API to Win32, so there is no such
                        thing as fork for applications compiled with mingw. Win32 version of Vim
                        just ignores --nofork. On the other hand rxvt and sh are Unix
                        applications, so they try to bahave the same as they do on there native
                        platform - here you may use & to detach Vim from console.
                        I'm not sure, but you may try Cygwin Vim - there is fork call on Cygwin
                        platform and maybe Vim uses it. If so, than you would be able to tell
                        Vim to fork or not using command line arguments.

                        >If there's a way around without adding the & by patch, I'm
                        >interested. Apparently it doesn't seem to be a vimrc issue,
                        >but really a binary limitation :(
                        >
                        >Christian
                        >
                        >On 12/9/05, John Love-Jensen <eljay@...> wrote:
                        >
                        >
                        >
                        >
                        >
                      • Benji Fisher
                        ... There is a similar problem when launching gvim from a shell in Mac OS X. The shell script http://macvim.org/OSX/files/gvim is one work-around. If someone
                        Message 11 of 11 , Dec 10, 2005
                          On Sat, Dec 10, 2005 at 01:20:34AM +0200, Илья wrote:
                          > Christian MICHON wrote:
                          >
                          > >I would like to detach it. Right now, I can't, unless I do
                          > >a "gvim &"
                          > >
                          > >On linux/solaris, inside a rxvt, if I lauch gvim, the gvim process
                          > >forks. Apparently, the std behaviour on mingw is equivalent to
                          > >--nofork, which is not the behaviour I would expect.
                          > >
                          > >
                          > Mingw is just a gcc port to Windows platform. It does have special libs
                          > and does not provide some nonstandart API to Win32, so there is no such
                          > thing as fork for applications compiled with mingw. Win32 version of Vim
                          > just ignores --nofork. On the other hand rxvt and sh are Unix
                          > applications, so they try to bahave the same as they do on there native
                          > platform - here you may use & to detach Vim from console.
                          > I'm not sure, but you may try Cygwin Vim - there is fork call on Cygwin
                          > platform and maybe Vim uses it. If so, than you would be able to tell
                          > Vim to fork or not using command line arguments.

                          There is a similar problem when launching gvim from a shell in Mac
                          OS X. The shell script

                          http://macvim.org/OSX/files/gvim

                          is one work-around. If someone wants to make a shell script for mingw,
                          it might be easier to modify this than to start from scratch. You would
                          have to throw out the heuristics for finding the binary, but the
                          argument handling (including peeking at the name by which the script was
                          invoked) should be the same.

                          HTH --Benji Fisher
                        Your message has been successfully submitted and would be delivered to recipients shortly.