I would like to use something like oh-my-bash in vscode using WSL2. However according to the docs:
When VS Code Remote is started in WSL, no shell startup scripts are run. This was done to avoid issues with startup scripts that are tuned for shells. If you want to run additional commands or modify the environment this can be done in a setup script
~/.vscode-server/server-env-setup(Insiders:~/.vscode-server-insiders/server-env-setup). If present, the script is processed before the server is started.
I have added a ~/.vscode-server/server-env-setup and according to the logs it is found and executed, but my linux skills are quite basic and i can't figure out how to get my profile installed. I have tried
bash ~/.profile
...but that doesn't seem to do anything. I have also tried
#!/bin/bash
source ~/.profile
which gives me an error /mnt/c/Users/cber/.vscode/extensions/ms-vscode-remote.remote-wsl-0.40.3/scripts/wslServer.sh: 3: /home/cber/.vscode-server/server-env-setup: source: not found
UPDATE
The question of how to source a profile is answered below, but my problem with getting powerline-go to work in vs-code on WSL2 persists, but i moved that to a new question in order to close this one.
bash ~/.profileis going to execute your.profilefile in a new subshell, then exit, effectively discarding the modification that were made. The keyword you are looking for issource ~/.profilesource ~./profilewhich gives me an error/mnt/c/Users/cber/.vscode/extensions/ms-vscode-remote.remote-wsl-0.40.3/scripts/wslServer.sh: 3: /home/cber/.vscode-server/server-env-setup: source: not found. Did some searching and found this, so i tried adding#!/bin/bashas line one but i still get the same error when using source./home/cber/.vscode-server/server-env-setupfile ? Could you tell us what happens when you putreadlink /proc/$$/exeat the 1st line ?bash #!/bin/bash source ~/.profile... if i change it tobash readlink /proc/$$/exe source ~/.profile... it outputs/bin/dash