Arch Linux平台VSCode
如 在Linux上运行Visual Studio Code 所汇总信息,对于arch linux提供了不同版本:
Code: MIT社区开源版本,使用Electron framework构建
Code-OSS: Arch Linux官方开源版本,采用 https://github.com/microsoft/vscode 构建
Visual Studio Code: 采用 https://code.visualstuio.com 版本构建,是唯一能够直接使用Microsoft's marketplace以及微软私有扩展的版本,需要使用 Arch Linux AUR 安装
VSCodium: 社区驱动开源版本
安装
为了方便使用,安装微软Visual Studio Code
yay -S visual-studio-code-bin
现在的实践: 安装 Code-OSS: Arch Linux官方开源版本
pacman -S code
在 wayland显示服务器协议 环境运行code
Visual Studio Code 使用 Electron,所以参考 Wayland#Electron 在 sway - 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中文输入。