Mac VSCode 禁用GPU加速
Open the Command Palette (Ctrl+Shift+P
).
Run the Preferences: Configure Runtime Arguments
command. This command will open a argv.json file to configure runtime arguments.
You might see some default arguments there already.
Add
"disable-hardware-acceleration": true
Restart VS Code.
-----------------------------------------------分割線--下面的方法已經(jīng)過時了,現(xiàn)在vscode已經(jīng)可以通過配置禁用-----------------------------------------------
Mac VSCode 禁用GPU加速
某些老型號mac或者黑蘋果使用VSCode時非忱⒐担卡頓济蝉,有可能是GPU加速造成的。
原理用新的腳本替換vscode執(zhí)行程序
//1.cd到VSCode執(zhí)行程序所在目錄
cd /Applications/Visual\ Studio\ Code.app/Contents/MacOS/
//2.將Electron(VSCode可以行程序)重名了為Electron.real
mv Electron Electron.real
//3.在該目錄新建一個文件名為Electron文本文件(沒有后綴)矗积,并將下面的內(nèi)容粘貼到文件里
#!/bin/bash
cd "/Applications/Visual Studio Code.app/Contents/MacOS"
"/Applications/Visual Studio Code.app/Contents/MacOS/Electron.real" --disable-gpu
"$@"
//4.為Electron添加執(zhí)行權(quán)限
chmod -R a+x Electron
//5.大功告成,現(xiàn)在直接打開vscode已經(jīng)是禁用gpu了
//可已經(jīng)將自己創(chuàng)建的Electron文件備份到其他目錄
//vscode升級后只需要執(zhí)行第二部將Electron(VSCode可以行程序)重名了為Electron.real
//然后在把備份的Electron復(fù)制到該目錄即可