junegunn / junegunn/vim-plug

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

Open
#1,311 1 comment 0 reactions 0 assignees View on GitHub
shell:powershell windows
Dominant language
Vim Script
Stars
35.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Here is a raw display of the error:
![Image](https://github.com/user-attachments/assets/60e41313-4670-45f4-9199-c7ab30272458)

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.