View Issue Details

IDProjectCategoryView StatusLast Update
0003614OpenFOAMPatchpublic2021-01-14 17:47
Reporteralma Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformWindows subsystem LinuxOSUbuntuOS Version20.04
Summary0003614: Spaces are replaced with colons when transporting the environment variables into WSL because of using OpenFoam
DescriptionI am using windows-subsystem-for-Linux, and I choose Ubuntu. But I can't call the program installed on the Windows OS, so I check the environment variable list in WSL, it seems that the spaces are replaced with colons when transporting the environment variables into WSL.
Considering that in WSL, the environment variables list is a colon-delimited list. In Win32, it is a semicolon-delimited list.

I found that this is because I am using OpenFoam, and when the PATH env of OpenFoam takes effect, it rebuilds the PATH environment variable, the corresponding setting in ~/.bashrc file is:
source /opt/openfoam8/etc/bashrc

As shown in the following screenshot, OpenFoam would rebuild the $PATH environment variable, with colon and space as the delimiter.
Additional InformationAs more users are using WSL to learn and run OpenFoam, I suggest that we could use some other delimiters when rebuilding the environment variable($PATH) .
TagsNo tags attached.

Activities

alma

2021-01-14 16:01

reporter  

henry

2021-01-14 16:08

manager   ~0011815

Why do you have spaces in your environment variables?

alma

2021-01-14 16:13

reporter   ~0011816

Because in Windows, the default installation directory is "C:\Program Files\" and "C:\Program Files (x86)\", e.g, when I install Visual Studio Code, it is installed in "C:\Program Files\".

henry

2021-01-14 16:22

manager   ~0011817

Spaces in file name or environment variable are not supported in OpenFOAM.

alma

2021-01-14 16:30

reporter   ~0011818

WSL supports spaces in the environment variables, so I could use the VS code installed on Windows Host OS.
But OpenFoam would rebuild the environment variable(PATH), and cause damage to the corresponding PATH of VS code.

henry

2021-01-14 16:46

manager   ~0011819

Spaces in file name or environment variable are not supported in OpenFOAM, I don't know what more I can say.

If you want to change the OpenFOAM scripts to suit your purpose feel free to do so.

Issue History

Date Modified Username Field Change
2021-01-14 16:01 alma New Issue
2021-01-14 16:01 alma File Added: source code screenshot.jpg
2021-01-14 16:01 alma File Added: wrong format of Environment Variables in WSL.jpg
2021-01-14 16:08 henry Note Added: 0011815
2021-01-14 16:13 alma Note Added: 0011816
2021-01-14 16:22 henry Note Added: 0011817
2021-01-14 16:30 alma Note Added: 0011818
2021-01-14 16:46 henry Note Added: 0011819
2021-01-14 16:46 henry Assigned To => henry
2021-01-14 16:46 henry Status new => closed
2021-01-14 16:46 henry Resolution open => no change required