简体   繁体   English

通过WSL从源代码启动VSCode

[英]Launch VSCode from source through WSL

I would like to build/launch the VSCode source code in the native Bash for Windows client. 我想在Windows版本机Bash客户端中构建/启动VSCode源代码。 I have followed the steps outlined in the VSCode wiki on how to contribute, and everything is working as expected (All commands have been run on the WSL terminal following the Linux instructions) 我已按照VSCode Wiki中概述的步骤进行操作 ,并且一切按预期进行(所有命令均已按照Linux指令在WSL终端上运行)

After running yarn run watch , I try to launch VSCode by running DISPLAY=:0 ./scripts/code.sh from the source code directory, but nothing happens. 运行yarn run watch ,我尝试通过从源代码目录运行DISPLAY=:0 ./scripts/code.sh来启动VSCode,但是什么也没有发生。 I get two duplicate warnings: 我收到两个重复的警告:

[21496:1128/120229.392130:WARNING:audio_manager.cc(295)] Multiple instances of AudioManager detected

but I'm not sure if this is causing the problem. 但我不确定这是否是导致问题的原因。 I have an X Server client running, and have used to to successfully launch native Windows applications through WSL (terminator, emacs, etc.) 我有一个正在运行的X Server客户端,并且曾经通过WSL(终止符,emacs等)成功启动本机Windows应用程序。

Is what I'm trying to do possible? 我想做的事可能吗? If so, how can I make it work? 如果是这样,我该如何运作?

Amazing that you asked this! 你问这个太神奇了! I was attempting to do the exact same thing at (it seems) the exact same time . 我试图在相同的时间完全相同的事情 Here's my process. 这是我的过程。

  1. Install XMing 安装XMing
  2. Install the xfree apps 安装xfree应用
  3. Set DISPLAY=:0 设置DISPLAY =:0
  4. Run xeyes ==> Awesome googly eyes! 运行xeyes ==>超棒的眼睛!
  5. Attempt to build vscode from source. 尝试从源代码构建vscode。 The build docs seem to be incomplete b/c I had to install a ton of libraries beyond those listed eg 构建文档似乎是不完整的b / c我不得不安装除所列以外的大量库,例如

yarn gulp gulp-cli pkg-config libx11-dev libxkbfile-dev libsecret-1-dev libgtk2.0-dev libxss-dev gnome-dev libgconf2-dev libnss3-dev libasound2-dev

Eventually get the yarn tasks to finish such that I could run code.sh 最终完成了yarn任务,以便我可以运行code.sh

./scripts/code.sh [20474:1128/153959.035267:ERROR:bus.cc(427)] Failed to connect to the bus: F ailed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory [20474:1128/153959.081986:WARNING:audio_manager.cc(295)] Multiple instances of AudioManager detected [20474:1128/153959.082101:WARNING:audio_manager.cc(254)] Multiple instances of AudioManager detected

Looking at ps I see that the process was running. 看着ps我看到进程正在运行。

Conjectures 猜想

It seems that building from source from WSL is not yet supported. 似乎尚不支持从WSL进行源构建。 Or maybe you can build the artifact, but you can't connect to the Windows display to show it. 或者,也许您可​​以构建工件,但无法连接到Windows显示屏以显示它。 Based on the quality of the xeyes session, it looks like a very, very, very primitive experience eg still using WinXP-style minimize / maximize / close icons. 基于xeyes会话的质量,它看起来像是一种非常非常非常原始的体验,例如仍然使用WinXP风格的最小/最大化/关闭图标。

I was literally writing an Issue on their github page when I thought I'd do one last search and found this post. 当我以为我会做最后一次搜索并找到这篇文章时,我确实在他们的github页面上写了一个Issue。 Much of vscode treats WSL as a second-class environment on Windows. vscode的大部分内容都将WSL视为Windows上的第二类环境。 Recent work seems to suggest that things are going to get better as driving to integration between Windows' two internal environments continues to improve (eg https://github.com/Microsoft/vscode/issues/39144 ) 最近的工作似乎表明,随着Windows两个内部环境之间集成的驱动不断改善,情况将会越来越好(例如https://github.com/Microsoft/vscode/issues/39144

Update 2017-11-30 更新2017-11-30

Based on some pursuit via Github, it seems that this issue has been reported to the WSL team: https://github.com/Microsoft/WSL/issues/2293 . 根据通过Github进行的一些调查,似乎已向WSL团队报告了此问题: https : //github.com/Microsoft/WSL/issues/2293 It appears to be under active consideration by the WSL team. WSL团队似乎正在积极考虑。 I've added some commentary about my use case there. 我在那里添加了一些有关我的用例的评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM