linux - 如何在 "Open With"上的 Visual Studio Code 中禁用 gpu

标签 linux visual-studio-code

我已经在我的 Ubuntu Linux 上安装了 Visual Studio Code 1.7.1。刚开始时出现黑屏,但在我添加 --disable-gpu 后它工作正常。现在,如果我在命令行中运行 code --disable-gpu 一切都很好。我还将 Exec 行更改为 Exec=/usr/share/code/code --disable-gpu %U 在/usr/share/applications/code.desktop 中,这样我也可以通过单击桌面上的图标来运行代码。

我遇到的唯一问题是,当我有一个文件(比方说 CSS)并且我想用 Visual Studio Code 打开它时,我右键单击它并尝试用 Code 打开它,但我又出现了空白屏幕。我怎样才能在那里添加 --disable-gpu 参数?

提前致谢!

最佳答案

您必须在 /usr/share/applications/code.desktop 文件的 Exec 之后插入 --disable-gpu代码 (在我的示例中,我有代码内部人员,它是开发人员预览版):

enter image description here

关于linux - 如何在 "Open With"上的 Visual Studio Code 中禁用 gpu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40766983/

相关文章:

c++ - VSCode C++编译错误: How to link an additional library (*.lib)?

unit-testing - 如何在 Visual Studio Code 中使用 Typescript 进行 TDD?

visual-studio-code - 如何使用 VS Code 的 "open with live server"更改默认浏览器?

linux - 如何在 Linux 上将正在运行的进程的标准输入从键盘更改为文件?

python - 以编程方式设置启动时执行的进程(运行级别 2)?

linux - 如何在不使用 yum 或 rpm 的情况下手动将程序安装到 CentOS 6?

typescript - 在 vue 组件的模板 html 中启用智能感知需要什么?

visual-studio-code - 在 VSCode 上安装 Prettier

android - 与 USB 连接时,ADB 无法识别三星 S21

php - 共享 php 脚本的别名、mod_rewrite 或其他名称?