You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Arch系统Hyprland环境下VSCode文字像素化问题求助

解决Hyprland下VSCode文字像素化问题

1. 确认VSCode真的跑在Wayland上

  • 先验证运行协议:打开VSCode,按Ctrl+Shift+P输入Developer: Toggle Developer Tools,在Console面板输入navigator.platform,同时查看navigator.userAgent里是否包含Wayland——只有同时满足才是真的启用了Wayland渲染。
  • 强制Wayland的正确操作:
    • 临时测试:终端执行code --enable-features=UseOzonePlatform --ozone-platform=wayland启动VSCode
    • 永久生效:创建或编辑~/.config/code-flags.conf,写入以下内容:
      --enable-features=UseOzonePlatform
      --ozone-platform=wayland
      
    • Hyprland配置里加启动参数:在~/.config/hypr/hyprland.conf中添加:
      windowrulev2 = exec code --enable-features=UseOzonePlatform --ozone-platform=wayland, class:^(code)$
      

2. 调整VSCode内部渲染设置

  • 打开VSCode设置(快捷键Ctrl+,),搜索Rendering:
    • 关闭Hardware Acceleration(Wayland环境下部分硬件加速会触发字体渲染bug)
    • 开启Use Canvas Based Renderer
    • 在Font Rendering区域,把Antialiasing Mode设为Subpixel或Grayscale,根据你的屏幕类型选合适的选项

3. 修复系统字体渲染配置

  • 安装必要的字体渲染库:
    sudo pacman -S freetype2 fontconfig cairo libxft
    
  • 重新生成字体缓存:
    fc-cache -fv
    
  • 在VSCode设置里指定清晰的等宽字体,比如把Editor: Font Family设为JetBrains Mono, Consolas, monospace,避免使用系统默认的模糊字体

4. 同步Hyprland与VSCode的缩放设置

  • 检查Hyprland的显示器缩放:打开hyprland.conf,确认monitor=配置里的scale参数正确,比如高分屏可能设为1.5或2:
    monitor=eDP-1,1920x1080@60,0x0,1.5
    
  • 调整VSCode的Window: Zoom Level,让它和系统缩放比例匹配;或者把Window: Title Bar Style设为Custom,避免系统缩放和VSCode自身缩放冲突

内容的提问来源于stack exchange,提问作者Noah Steiniger

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.07 15:47:43