The following also works.
Disable WSL extension and reload window. Then enable WSL extension and reload window.
WSL
Now code . works fine.
code .