Skip to content

:PlugStatus, and I guess basically any command that use s:with_cd() internally, won't work when using powershell #1311

@Dougaak

Description

@Dougaak

Here is a raw display of the error:
Image

The log produced by vim itself shows that the actual command getting execute contains parentheses:

Calling shell to execute: "(cd 'd:\\Users\\t0261309\\DEV_COLLECTION\\vim\\vimfiles\\plugged\\vim-code-dark\\' ; & git rev-list --count --left-right HEAD...origin/master) 2>&1 | Out-File -Encoding UTF8 d:\Users\t0261309\AppData\Local\Temp\V7NC049.tmp"

Based on the source code implementation of s:with_cd() I can see that for powershell, ; is used to separate two commands. However, the subsequent vim built-in call system() will internally add parentheses around the command, and that breaks powershell as a ; in parentheses is not allowed.

I believe the last E282 error is irrelevant for it is simply because the command is not executed at all and thus no tmp file is created.

A simple fix that I can think of is wrapping the whole cmd with $(...), where ; can live in, and after the system() wrapping, ($(...;...)) works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    shell:powershellUser's shell set to powershell.exe (Windows) or pwsh (Unix)windows

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions