简体   繁体   English

打开文件/文件夹时,vscode 在 Arch linux 上崩溃

[英]vscode crashes on Arch linux when opening file/folder

Installation vscode安装 vscode

I'm running Arch Linux (Manjaro) and installed vscode with:我正在运行 Arch Linux (Manjaro) 并安装了 vscode:

sudo pacman -S code

but then a simple .NET core program resulted in但随后一个简单的 .NET 核心程序导致

--------------------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.
--------------------------------------------------------------------------------

It seems like the official Microsoft build should be obtained via the snap store:似乎应该通过 snap 商店获得 Microsoft 官方版本:

sudo snap install code --classic

And the program looks normal.而且程序看起来很正常。 I can install plug-ins, create a new file et cetera .我可以安装插件,创建一个新文件等等

Problem问题

However, I cannot open any files or projects.但是,我无法打开任何文件或项目。 Doing so results in vscode crashing.这样做会导致 vscode 崩溃。 I read that code --disable-gpu could solve this problem, but doesn't do so for me.我读到code --disable-gpu可以解决这个问题,但对我来说不是这样。 Any ideas有任何想法吗

  • what may cause this crash?什么可能导致这次崩溃?
  • or how to get the pacman vscode working?或者如何让pacman vscode工作?

Logs日志

$ code --verbose
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
Gtk-Message: 22:59:19.805: Failed to load module "canberra-gtk-module"
(code:33833): GdkPixbuf-WARNING **: 22:59:19.817: Cannot open pixbuf loader module file '/usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache': No such file or directory

This likely means that your installation is broken.
Try running the command
  gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache
to make things work again for the time being.
[33863:1104/225919.911481:ERROR:appcenter_api.cc(52)] expecting appcenter url prefix
[main 2020-11-04T21:59:19.960Z] Sending env to running instance...
[main 2020-11-04T21:59:20.041Z] Sent env to running instance. Terminating...
[main 2020-11-04T21:59:20.041Z] Lifecycle#kill()

where the recommended gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache results in bash: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache: No such file or directory其中推荐的gdk-pixbuf-query-loaders > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache导致bash: /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache: No such file or directory

I'm running Arch Linux (Manjaro) and installed vscode with:我正在运行 Arch Linux (Manjaro) 并安装了 vscode:

 sudo pacman -S code

but then a simple .NET core program resulted in但随后一个简单的 .NET 核心程序导致

-------------------------------------------------------------------------------- You may only use the Microsoft .NET Core Debugger (clrdbg) with Visual Studio Code, Visual Studio or Visual Studio for Mac software to help you develop and test your applications. --------------------------------------------------------------------------------

I had the same issue trying to get the debugger to work and I spent hours on finding the reason for this.我在尝试让调试器工作时遇到了同样的问题,我花了几个小时来寻找原因。 What I found out is that the debugger only works with officially signed Microsoft binaries of VSCode.我发现调试器只适用于正式签名的微软 VSCode 二进制文件。 So you have to make a distinction here:所以你必须在这里做出区分:

  • The package code contains the open source version of visual studio code, a build wich anyone can make using the provided sources by Microsoft.code包含 Visual Studio 代码的开源版本,任何人都可以使用 Microsoft 提供的源进行构建。 The program which you get here is therefore not signed by MS !因此,您在此处获得的程序未由 MS 签名
  • The package visual-studio-code-bin provided by the AUR contains a officially signed version by MS . AUR提供的visual-studio-code-bin包包含了微软官方签名的版本 If you use this package, the debugger works as expected.如果您使用此包,调试器将按预期工作。

I do not know wether snap - which I personally never used at all - provides this kind of package, so I can not tell anything about that, but using the said package from the user repository solved the problem for me reliably.我不知道snap - 我个人从来没有使用过 - 是否提供了这种包,所以我不能告诉任何关于它的信息,但是使用用户存储库中的所述包可靠地为我解决了这个问题。

Try this one (which I installed just yesterday under the recent manjaro distribution and it worked fine) and see if this solves your problem with opening files and folders.试试这个(我昨天刚刚在最近的 manjaro 发行版下安装了它,效果很好),看看这是否能解决你打开文件和文件夹的问题。

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

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