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

Win32 COMSPEC args don't reconfig on COMSPEC resest

Expand Messages
  • Linda W
    I changed my COMSPEC on win32 to C: bin bash.exe. In vi, when I use the ! to execute a command on Windows, like ls , it tried to execute it with:
    Message 1 of 5 , Oct 31, 2006
    • 0 Attachment
      I changed my COMSPEC on win32 to C:\bin\bash.exe.

      In vi, when I use the "!" to execute a command on Windows,
      like "ls", it tried to execute it with:

      C:\bin\bash /c ls
      where ^^--- is an argument to the DOS/Windows Shell, but doesn't
      work for for bash.

      Is there some other option to tell Vim not to use the DOS/Windows
      Shell options to non-DOS/Win shells? :-)

      I searched the VIM help: the section on COMSPEC didn't say
      anything relevant, and searching for "/C" ("\/C", "\ \C") didn't turn
      up anything productive.

      Thanks,
      linda
    • A.J.Mechelynck
      ... see ... Best regards, Tony.
      Message 2 of 5 , Nov 1, 2006
      • 0 Attachment
        Linda W wrote:
        > I changed my COMSPEC on win32 to C:\bin\bash.exe.
        >
        > In vi, when I use the "!" to execute a command on Windows,
        > like "ls", it tried to execute it with:
        >
        > C:\bin\bash /c ls
        > where ^^--- is an argument to the DOS/Windows Shell, but doesn't
        > work for for bash.
        > Is there some other option to tell Vim not to use the DOS/Windows
        > Shell options to non-DOS/Win shells? :-)
        >
        > I searched the VIM help: the section on COMSPEC didn't say
        > anything relevant, and searching for "/C" ("\/C", "\ \C") didn't turn
        > up anything productive.
        >
        > Thanks,
        > linda
        >
        >

        see
        :help 'shell'
        :help 'shellcmdflag'
        :help 'shellpipe'
        :help 'shellquote'
        :help 'shellredir'
        :help 'shellslash'
        :help 'shelltemp'
        :help 'shellxquote'
        :help dos-shell
        :help option-backslash


        Best regards,
        Tony.
      • Linda W
        ... Many thanks!
        Message 3 of 5 , Nov 1, 2006
        • 0 Attachment
          A.J.Mechelynck wrote:
          > Linda W wrote:
          >> Is there some other option to tell Vim not to use the DOS/Windows
          >> Shell options to non-DOS/Win shells? :-)
          >>
          >> I searched ...

          > see
          > :help 'shell'
          > :help 'shellcmdflag'
          > :help 'shellpipe'
          > :help 'shellquote'
          > :help 'shellredir'
          > :help 'shellslash'
          > :help 'shelltemp'
          > :help 'shellxquote'
          > :help dos-shell
          > :help option-backslash
          ---
          Many thanks!
        • Charles E Campbell Jr
          ... (snip) Hello! If I use Windows, I tend to use cygwin. I don t suppose you re using cygwin, as I don t think you d need to mess with COMSPEC for it.
          Message 4 of 5 , Nov 2, 2006
          • 0 Attachment
            Linda W wrote:

            > I changed my COMSPEC on win32 to C:\bin\bash.exe.

            (snip)

            Hello!

            If I use Windows, I tend to use cygwin. I don't suppose you're using
            cygwin, as I don't think
            you'd need to mess with COMSPEC for it. Anyway, I see Anthony M has
            given you some good
            clues. The following code snippet is what I use with cygwin's bash;
            perhaps it'll give you a start.

            set shell=bash
            set shq=
            set sxq=\"
            set ssl
            set shcf=-c
            set sp=>&

            To get help on these options, as an example: while in vim, :help 'shq' .

            Regards,
            Chip Campbell
          • Yongwei Wu
            ... FYI. In Windows there are a lot of gotchas when there are special symbols on the command line, esp. if the shell is not cmd.exe. When the shell is (ba)sh,
            Message 5 of 5 , Nov 2, 2006
            • 0 Attachment
              On 11/3/06, Charles E Campbell Jr <drchip@...> wrote:
              > Linda W wrote:
              >
              > > I changed my COMSPEC on win32 to C:\bin\bash.exe.
              >
              > (snip)
              >
              > Hello!
              >
              > If I use Windows, I tend to use cygwin. I don't suppose you're using
              > cygwin, as I don't think
              > you'd need to mess with COMSPEC for it. Anyway, I see Anthony M has
              > given you some good
              > clues. The following code snippet is what I use with cygwin's bash;
              > perhaps it'll give you a start.
              >
              > set shell=bash
              > set shq=
              > set sxq=\"
              > set ssl
              > set shcf=-c
              > set sp=>&

              FYI. In Windows there are a lot of gotchas when there are special
              symbols on the command line, esp. if the shell is not cmd.exe. When
              the shell is (ba)sh, try some commands like

              :echo system('echo "hel&lo"')

              and you know the pain.

              Cmd has problems too. With (ba)sh, it is even more painful, since
              there is no way to *escape*.

              Not a problem of sh itself, since it works perfectly under Cygwin or
              Linux. Calling sh in a Windows program is.

              Best regards,

              Yongwei
              --
              Wu Yongwei
              URL: http://wyw.dcweb.cn/
            Your message has been successfully submitted and would be delivered to recipients shortly.