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

Unexpected directory created on Windows host after installation on Windows host side #1578

Closed
xudyang1 opened this issue Jan 20, 2024 · 1 comment

Comments

@xudyang1
Copy link
Contributor

  • OS Version: Windwos 10 22H2
  • Browser Version: 120.0.6099.225
  • Browser Addon Version: 0.2.15
  • Neovim Plugin Version: 0.2.15

What I tried to do

Run :lua vim.fn["firenvim#install"](0) on Windows host system

What happened

A directory mnt/c/Users/myUserName/appdata/local/firenvim/ with file filenvim.bat created under C: drive, so the full path is C:\\mnt\\c\\Users\\....\\firenvim

xudyang1 added a commit to xudyang1/firenvim that referenced this issue Jan 20, 2024
Variable `s:is_wsl` indicates whether firenvim is running on the WSL
side or on the Windows host system. Currently, `s:is_wsl` checks three
environment variables `$WSLENV`, `WSL_DISTRO_NAME`, and `WSL_INTEROP`.
The following table lists the values of these env vars on the host
system and on the WSL2 system:

| ENV_VAR            | Windows Host                | WSL2                        |
|--------------------|-----------------------------|-----------------------------|
| `$WSLENV`          | `WT_SESSION:WT_PROFILE_ID:` | `WT_SESSION:WT_PROFILE_ID:` |
| `$WSL_DISTRO_NAME` | empty                       | `Ubuntu-22.04`              |
| `$WSL_INTEROP`     | empty                       | `/run/WSL/1133_interop`     |

The incorrect env var `$WSLENV` is used in

https://github.com/glacambre/firenvim/blob/8c6c00aae7e5762cbcb4cd0df5848e959c4a9572/autoload/firenvim.vim#L921

As a result, `s:is_wsl` is set to `1` even when firenvim is installed
from the host system, and thus directory
`mnt/c/users/myusername/appdata/local/firenvim` is created under the
`C:` drive.
glacambre pushed a commit that referenced this issue Jan 20, 2024
Variable `s:is_wsl` indicates whether firenvim is running on the WSL
side or on the Windows host system. Currently, `s:is_wsl` checks three
environment variables `$WSLENV`, `WSL_DISTRO_NAME`, and `WSL_INTEROP`.
The following table lists the values of these env vars on the host
system and on the WSL2 system:

| ENV_VAR            | Windows Host                | WSL2                        |
|--------------------|-----------------------------|-----------------------------|
| `$WSLENV`          | `WT_SESSION:WT_PROFILE_ID:` | `WT_SESSION:WT_PROFILE_ID:` |
| `$WSL_DISTRO_NAME` | empty                       | `Ubuntu-22.04`              |
| `$WSL_INTEROP`     | empty                       | `/run/WSL/1133_interop`     |

The incorrect env var `$WSLENV` is used in

https://github.com/glacambre/firenvim/blob/8c6c00aae7e5762cbcb4cd0df5848e959c4a9572/autoload/firenvim.vim#L921

As a result, `s:is_wsl` is set to `1` even when firenvim is installed
from the host system, and thus directory
`mnt/c/users/myusername/appdata/local/firenvim` is created under the
`C:` drive.
@glacambre
Copy link
Owner

Solved by @xudyang1 in #1579

glacambre added a commit that referenced this issue Apr 28, 2024
- Add firenvim#write() function enabling users to write arbitrary data (236ea75)
- Better messages for firenvim_config misconfiguration (cbbd7e8)
- Fix for firenvim being unusable with nightly neovim (79ca923 / #1603)
- Better WSL support (#1578) (7e2f12b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants