Arch Linux平台VSCode

在Linux上运行Visual Studio Code 所汇总信息,对于arch linux提供了不同版本:

安装

为了方便使用,安装微软Visual Studio Code

yay -S visual-studio-code-bin
  • 现在的实践: 安装 Code-OSS: Arch Linux官方开源版本

安装arch linux仓库中的 Code - OSS
pacman -S code

wayland显示服务器协议 环境运行code

Visual Studio Code 使用 Electron,所以参考 Wayland#Electronsway - i3兼容Wayland compositor 中启动:

code --ozone-platform-hint=auto

要固定配置,则将参数配置到 ~/.config/electron-flags.conf

--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto

不过, visual-studio-code-bin 并没有似乎没有读取这个配置进行传递给 electron ,所以实际还是通过命令行参数传递: 在 sway - i3兼容Wayland compositor 配置中使用:

# VSCode
bindsym $mod+c exec code --enable-features=WaylandWindowDecorations --ozone-platform-hint=auto

另外,目前(2024年底)在 sway - i3兼容Wayland compositor 的 native wayland显示服务器协议 模式下运行 code 无法输入中文,需要启用 Xwayland 才能输入,尽管 fcitx官网:sway 提到应用和Compositor需要使用 text-input-v3 ,Qt程序需要使用 QT_IM_MODULE=fcitx ,但是 vscode 无法显示输入框,即使我使用了:

尝试使用 enable-wayland-ime 参数来运行code,但是依然无法在sway环境输入中文,卒
# If your compositor supports text-input-v1 protocol. Check the compositor section below.
code --enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime

目前看,还是需要通过 Xwayland 来支持vscode中文输入。

参考