VS Code with WSL now opens the browser.sh file instead of launching the browser

孤街醉人 提交于 2021-02-05 06:32:26

问题


The problem: when running a React project (i.e. npm run start) with WSL from the terminal in VS Code, the file "browser.sh" is opened in a new window. The browser is no longer launched.

This is a new behavior with version 1.52. The release notes indicate that they now add the system variable "BROWSER" and use it to launch the browser. In my case it is set to /home/dan/.vscode-server/bin/ea3859d4ba2f3e577a159bc91e3074c5d85c0523/bin/helpers/browser.sh

The browser.sh file is a shell script created by VS Code. It exists and has executable permissions (-rwxr-xr-x).

The workaround: Type unset BROWSER every time a terminal is opened inside VS Code.

The desired solution: Convince VS Code to run the shell script or to launch the default browser directly.

来源:https://stackoverflow.com/questions/65774451/vs-code-with-wsl-now-opens-the-browser-sh-file-instead-of-launching-the-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!