-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Describe the bug
External commands in Windows do not run from current directory (instead running from /c/Program Files/VSCodium), and when using Remote WSL or Remote SSH do not run in correct environment (they still run in Windows CMD). Applies to both :r !cmd
and :'<,'> !cmd
.
To Reproduce
Steps to reproduce the behavior:
In local Windows environment:
- Open a folder in VSCodium
- Open a file in that folder
- Run
:r !dir
- Output printed to file indicates " Directory of C:\Program Files\VSCodium", and so the command was run from wrong directory.
In Remote WSL or SSH:
- Open a Remote WSL session, or a Remote SSH to a Linux device.
- Run
:r !ls
. Vim output in console reports error executing command and "ls is not recognized as an internal or external command", indicating command was run in Windows and not Linux.
Same behavior occurs if one highlights some text, goes into visual mode with V and then tries !dir
.
Expected behavior
Commands are run in the correct environment and same directory as current file, which is the behavior in Vim.
Screenshots
If applicable, add screenshots to help explain your problem.
If remapping-related, please attach log output: https://github.com/VSCodeVim/Vim#debugging-remappings.
Output of :r dir
when running in local Windows:
Error message from running in VSCode WSL:
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.30.1
- Open Remote SSH by Jeanp ver 0.049
- Open Remote WSL by Jeanp ver 0.0.5, using WSL version 2.5.10.0
- VSCode version: 1.87
- OS: Windows 11 Enterprise
Additional context
This is an extension of the long-standing issue reported here, which indicates that the read command doesn't use correct environment/directory for files either: #6678.