Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ExecCommandWith for cmd.exe in Windows #1072

Closed
wants to merge 5 commits into from

Commits on Oct 2, 2017

  1. Fix ExecCommandWith for cmd.exe in Windows

    Close junegunn#1018
    
    Run the command as is in cmd.exe with no parsing and escaping.
    Explicity set cmd.SysProcAttr so execCommand does not escape the command.
    Technically, the command should be escaped with ^ for special characters, including ".
    This allows cmd.exe commands to be chained together.
    
    See neovim/neovim#7343 (comment)
    
    However, this requires a new shellescape function that is specific to one of the following:
    - interactive prompt
    - batchfile
    - command name
    fzf#shellescape in the Vim plugin can handle only the batchfile.
    janlazo committed Oct 2, 2017
    Configuration menu
    Copy the full SHA
    0d7234e View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2017

  1. Configuration menu
    Copy the full SHA
    8719d69 View commit details
    Browse the repository at this point in the history
  2. Use strings.Replace, not strconv.Quote, to escape

    quoteEntry uses strconv.Quote in Windows but this escapes more than \ and "
    Use strings.Replace to handle only \ and ".
        - double all backslashes
        - double-quote the entry, escaping all inner double quotes with backslash
    janlazo committed Oct 3, 2017
    Configuration menu
    Copy the full SHA
    0649864 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d30f4f8 View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2017

  1. Configuration menu
    Copy the full SHA
    7db7db9 View commit details
    Browse the repository at this point in the history