rxvt-unicode(urxvt)粘贴含控制字符文本时冻结问题求助
rxvt-unicode 粘贴含控制字符文本时冻结(Arch Linux,版本9.31-1)
问题描述
在Arch GNU/Linux系统中,通过yay安装的rxvt-unicode(版本9.31-1),尝试从其他X11应用粘贴包含控制字符的文本时会发生冻结。无论使用C-M-v快捷键还是鼠标中键操作,问题都会出现。
当前配置
我的~/.Xresources配置:
! urxvt ! URxvt.background: White ! URxvt.foreground: Black URxvt.font: xft:Cica:size=10 URxvt.background: Black URxvt.foreground: White URxvt.title: rxvt URxvt.scrollTtyOutput: false URxvt.scrollWithBuffer: true URxvt.scrollTtyKeypress: true URxvt.secondaryScreen: 1 URxvt.secondaryScroll: 0 ! URxvt.perl-ext-common: clipboard ! URxvt.clipboard.autocopy: true ! URxvt.keysym.M-c: perl:clipboard:copy ! URxvt.keysym.M-v: perl:clipboard:paste
执行xrdb -query查看已加载的X资源:
URxvt.background: Black URxvt.font: xft:Cica:size=10 URxvt.foreground: White URxvt.scrollTtyKeypress: true URxvt.scrollTtyOutput: false URxvt.scrollWithBuffer: true URxvt.secondaryScreen: 1 URxvt.secondaryScroll: 0 URxvt.title: rxvt
调试信息
使用gdb调试,执行r和bt full命令。当urxvt显示黄底提示文本(Pasting 1 control characters, continue? (y/n/p)和海の中のイラスト(背景素材)\n)卡住时,只能在原终端执行^C终止:
$ gdb urxvt GNU gdb (GDB) 13.1 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-pc-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://www.gnu.org/software/gdb/bugs/>. Find the GDB manual and other documentation resources online at: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from urxvt... This GDB supports auto-downloading debuginfo from the following URLs: <https://debuginfod.archlinux.org> Enable debuginfod for this session? (y or [n]) Debuginfod has been disabled. To make this setting permanent, add 'set debuginfod enabled off' to .gdbinit. (No debugging symbols found in urxvt) (gdb) r Starting program: /usr/bin/urxvt [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". urxvt: unable to create fontset for input method, try "-pt Root". Continuing. [Detaching after fork from child process 29953] ^C Program received signal SIGINT, Interrupt. 0x00007ffff7721177 in epoll_wait () from /usr/lib/libc.so.6 (gdb) bt full #0 0x00007ffff7721177 in epoll_wait () from /usr/lib/libc.so.6 No symbol table info available. #1 0x000055555559b1f7 in ?? () No symbol table info available. #2 0x000055555559f109 in ev_run () No symbol table info available. #3 0x000055555557e6f0 in main () No symbol table info available. (gdb)
已尝试的解决方法
启用clipboard扩展,但问题未解决:
URxvt.perl-ext-common: clipboard URxvt.clipboard.autocopy: true URxvt.keysym.M-c: perl:clipboard:copy URxvt.keysym.M-v: perl:clipboard:paste
解决方案
方法1:禁用控制字符粘贴提示
rxvt-unicode默认会在粘贴含控制字符的文本时弹出确认提示,若提示窗口无法正常响应就会导致冻结。添加以下配置到~/.Xresources可禁用该提示:
URxvt.pasteurify: true
该配置会自动过滤粘贴文本中的控制字符,直接完成粘贴操作,不会弹出确认提示。添加后执行xrdb -merge ~/.Xresources应用配置。
方法2:安装带调试符号的包定位问题
当前gdb调试缺少符号信息,无法定位具体问题。安装rxvt-unicode的调试包:
sudo pacman -S rxvt-unicode-debug
之后重新用gdb启动urxvt,触发冻结后执行bt full,就能得到更详细的调用栈信息,帮助定位问题根源。
方法3:切换剪贴板扩展方案
如果内置clipboard扩展无效,可尝试urxvt-perls包中的selection扩展:
sudo pacman -S urxvt-perls
修改~/.Xresources配置:
URxvt.perl-ext-common: selection URxvt.keysym.M-c: perl:selection:copy URxvt.keysym.M-v: perl:selection:paste URxvt.selection.autocopy: true
执行xrdb -merge ~/.Xresources应用配置。
内容的提问来源于stack exchange,提问作者wjzkfl
相关产品推荐
相关产品推荐

