In my ~/.bashrc I detect running platform with OSTYPE (it can be cygwin for instance).
How should I detect WSL in Bash? Previously I used COMSPEC env var but it is missing inside WSL...
I prefer lightweight check without spawning external processes which are not cheap in WSL/Cygwin.