【发布时间】:2019-03-12 12:12:46
【问题描述】:
我正在尝试从 WSL bash 终端在(任何)浏览器中打开 http://localhost。
到目前为止我已经尝试过:
- How can I open Google Chrome from the terminal with the URL "localhost:3000"?
- "Couldn't find a file descriptor referring to the console" on Ubuntu bash on Windows
- How to mention C:\Program Files in batchfile
为 xdg-open 设置 BROWSER 变量时运气不佳,它以 /usr/bin/xdg-open: 851: /usr/bin/xdg-open: /c/"Program: not found 响应 xdg-open http://localhost。
我尝试使用\ 和^ 进行转义。使用 %ProgramFiles(x86)% 和 ofcorse "Program Files (x86)"。每次或多或少都是相同的答案...任何想法如何设置在 WSL 中打开浏览器的工作流程?
到目前为止,我已经结束了:
/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe localhost
但我正在寻找更优雅的解决方案。
【问题讨论】:
-
这并不能完全回答您的问题,但在 MacOS 中,您可以通过 Bash 终端打开以下代码
open http://localhost:3000对不起,但这是我目前可以测试的唯一设置。 -
Linux 二进制文件无法扩展 windows 环境变量。
标签: windows bash ubuntu browser windows-subsystem-for-linux