WSL: Is there a conditional to detect "Open Linux Shell Here" case?
I would change the ~/.bashrc
enhancement to something like this:
CurrDir="$(pwd)"
if [[ "$CurrDir" == "$SystemDir" ]]
then
cd /path/to/sensible-dir-name
Fi
Where $SystemDir
is your System32 directory. Always remember how \
and /
differ between Windows and Linux paths:
- Bash script to convert Windows path to Linux path
Suggests using:
sed -e 's#^J:##' -e 's#\\#/#g'
That said in your instance you could probably hard-code the path.