alacritty无法输入中文以及标题栏问题
Alacritty 在 Ubuntu wayland 下无法切换到中文输入法,标题题栏也显示异常。
可通过配置 env WINIT_UNIX_BACKEND=x11 环境变量解决。
Alacritty 依赖 Winit,Winit 是一个 rust 窗口处理库,默认使用 Wayland 后端,这么设置的意思是切换到 Xwayland,不影响其它软件。
如下所示,启动的时候添加环境变量。
 1➜  applications cat Alacritty.desktop
 2[Desktop Entry]
 3Type=Application
 4TryExec=alacritty
 5Exec=env WINIT_UNIX_BACKEND=x11 alacritty
 6Icon=org.gnome.Terminal
 7Terminal=false
 8Categories=System;TerminalEmulator;
 9
10Name=Alacritty
11GenericName=Terminal
12Comment=A fast, cross-platform, OpenGL terminal emulator
13StartupWMClass=Alacritty
14Actions=New;
15
16X-Desktop-File-Install-Version=0.26
17
18[Desktop Action New]
19Name=New Terminal
20Exec=env WINIT_UNIX_BACKEND=x11 alacritty
21➜  applications pwd
22/usr/share/applications
这个环境变量有 2 个合法值 x11 和 wayland,解释如下:
1/// - **Linux:** Backend type can be controlled using an environment variable
2///   `WINIT_UNIX_BACKEND`. Legal values are `x11` and `wayland`.
3///   If it is not set, winit will try to connect to a Wayland connection, and if that fails,
4///   will fall back on X11. If this variable is set with any other value, winit will panic.
有人可能会问,Wayland 下就不可以吗?抱歉,目前还真的不行,情况看这个issue,Gnome 的世界是复杂的。
更改后即可输入中文,标题栏也美观了些,效果如下图所示,标号 2 的标题栏的确非常原始:
    
2023-3-22 更新:
拉取最新 master 分支,编译安装最新版本,标题和中文输入的问题都已修复。
1➜  cargo build --release --no-default-features --features=wayland
2➜  alacritty -V
3alacritty 0.13.0-dev (4b91a1db)
有兴趣的可以直接使用这个版本。
       最后修改于: Thursday, March 7, 2024
    
  
  
  
版权申明:
- 未标注来源的内容全部为原创,未经授权请勿转载(因转载后排版往往错乱、内容不可控、无法持续更新等);
 - 非营利为目的,演绎本博客任何内容,请以'原文出处'或者'参考链接'等方式给出本站相关网页地址(方便读者)。
 
相关文章:
- alacritty 终端使用
 - Readline常用快捷键
 - Ubuntu连接AirPods耳机
 - Rime输入法引擎和四叶草输入方案
 - k8s的startupProbe探针中initialDelaySeconds是否有效
 - zfs快照功能测试
 - Linux和iPhone互传文件
 - Nginx webdav for Joplin
 - Ubuntu 安装LDAP客户端
 - lvs端部署