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

69686gvim not using the shell option for ! commands

Expand Messages
  • Juan Lanus
    May 28, 2006
    • 0 Attachment
      Gerald Lai <laige <at> eecs.oregonstate.edu> writes:
      > One more thing you can try. Run Sysinternal's Filemon at
      > http://www.sysinternals.com/Utilities/Filemon.html

      The filemon program shows that:

      this program does this to this path ________________________ & this happens
      vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.com< PATH NOT FOUND
      vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.exe< PATH NOT FOUND
      vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.bat< PATH NOT FOUND
      vimrun.exe:816 QUERY INFO >C:\WINNT\system32\cmd.exe \e:8192.cmd< PATH NOT FOUND

      I imagine that vimrun triggered a system() command for to run
      "%SystemRoot%\system32\cmd.exe /e:8192" and that Windows is looking for a
      plausible extension for to add to the ending 8192.

      The string "C:\WINNT\system32\cmd.exe \e:8192" is my COMSPEC variable, with a /E
      option for to have more space for Environment variables.

      vimrun is treating the whole COMSPEC content as a path, while it can be a path
      with flags: SET ComSpec=%SystemRoot%\system32\cmd.exe /e:8192

      After this gvim looks for cmd.exe in several locations. None of them in the good
      one, that's set in _gvimrc:
      set shell=%SystemRoot%\system32\cmd.exe
      A :set shell returns this one, with %SystemRoot% replaced.

      The manual (os_dos.txt) says:
      The default for the 'sh' ('shell') option is ... "cmd.exe" on Windows NT. If
      SHELL is defined, Vim uses SHELL instead, and if SHELL is not defined but
      COMSPEC is, Vim uses COMSPEC. Vim starts external commands with "<shell> /c

      If I delete the /E:8192 option from the COMSPEC system variable then vimrun
      works OK. But all my COBOL software will fail ...

      IMO this is a bug, specially how gvim is failing to select the shell option
      before anything else. Now I'll be able to sleep.

      Thanks Gerald.
      Juan Lanus

      Test case, for Windows NT:
      gvim fails to use the shell option in ! commands
      1- Add a flag to the COMSPEC system variable, for example /E:8192
      2- Add a set shell=<same as COMSPEC but no flag> in _gvimrc
      3- Open a file in gvim
      4- !!path fails with a tempfile error
      5- :!path fails with a -1 status code in a DOS window
    • Show all 5 messages in this topic