Skip to content

Commit

Permalink
fix(main): set WSLENV to pass NVIM_APPNAME into WSL (#1310)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackblackevo committed Jul 11, 2023
1 parent 9479c65 commit 2b27081
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main_controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ export class MainController implements vscode.Disposable {
);
if (settings.NVIM_APPNAME) {
process.env.NVIM_APPNAME = settings.NVIM_APPNAME;
if (settings.useWsl) {
/*
* `/u` flag indicates the value should only be included when invoking WSL from Win32.
* https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/#u
*/
process.env.WSLENV = "NVIM_APPNAME/u";
}
}
this.nvimProc = spawn(settings.useWsl ? "C:\\Windows\\system32\\wsl.exe" : settings.neovimPath, args, {});
this.nvimProc.on("close", (code) => {
Expand Down

0 comments on commit 2b27081

Please sign in to comment.