Arch Linux下VSCode OSS的Ctrl+V粘贴功能突然失效求助
问题:Arch Linux下VSCode OSS的Ctrl+V粘贴功能失效
环境:Arch Linux系统,使用VSCode OSS整理C++项目文件时出现问题
症状:
- Ctrl+V粘贴完全失效,右键菜单的粘贴选项也无反应
- 其他快捷键(如复制、保存)正常工作,且在其他程序中可以正常粘贴
- Ctrl+Shift+V粘贴功能正常
已尝试的排查操作:
- 检查VSCode快捷键设置,未发现冲突项
- 禁用所有扩展并重启窗口
- 多次重启VSCode OSS,甚至重启系统
- 确认前一天系统升级未涉及VSCode相关包
以下是开启Developer: Toggle Keyboard Shortcuts Troubleshooting后捕获的日志:
// 按下Ctrl+V时的日志 2025-01-28 14:53:38.846 [info] [KeybindingService]: / Soft dispatching keyboard event 2025-01-28 14:53:38.847 [info] [KeybindingService]: \ Keyboard event cannot be dispatched 2025-01-28 14:53:38.847 [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control 2025-01-28 14:53:38.848 [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl') 2025-01-28 14:53:38.848 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase. 2025-01-28 14:53:38.980 [info] [KeybindingService]: / Soft dispatching keyboard event 2025-01-28 14:53:38.981 [info] [KeybindingService]: | Resolving ctrl+[KeyV] 2025-01-28 14:53:38.982 [info] [KeybindingService]: \ From 1 keybinding entries, matched editor.action.clipboardPasteAction, when: no when condition, source: built-in. 2025-01-28 14:53:38.982 [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: KeyV, keyCode: 86, key: v 2025-01-28 14:53:38.983 [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: KeyV, keyCode: 52 ('V') 2025-01-28 14:53:38.983 [info] [KeybindingService]: | Resolving ctrl+[KeyV] 2025-01-28 14:53:38.983 [info] [KeybindingService]: \ From 1 keybinding entries, matched editor.action.clipboardPasteAction, when: no when condition, source: built-in. 2025-01-28 14:53:38.983 [info] [KeybindingService]: + Invoking command editor.action.clipboardPasteAction. 2025-01-28 14:53:39.083 [info] [KeybindingService]: + Storing single modifier for possible chord ctrl. 2025-01-28 14:53:39.091 [info] [KeybindingService]: + Clearing single modifier due to other key up. // 按下Ctrl+Shift+V时的日志 2025-01-28 14:55:06.556 [info] [KeybindingService]: / Soft dispatching keyboard event 2025-01-28 14:55:06.591 [info] [KeybindingService]: \ Keyboard event cannot be dispatched 2025-01-28 14:55:06.591 [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 17, key: Control 2025-01-28 14:55:06.591 [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl], code: ControlLeft, keyCode: 5 ('Ctrl') 2025-01-28 14:55:06.591 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase. 2025-01-28 14:55:06.736 [info] [KeybindingService]: / Soft dispatching keyboard event 2025-01-28 14:55:06.737 [info] [KeybindingService]: \ Keyboard event cannot be dispatched 2025-01-28 14:55:06.738 [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl,shift], code: ShiftLeft, keyCode: 16, key: Shift 2025-01-28 14:55:06.738 [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl,shift], code: ShiftLeft, keyCode: 4 ('Shift') 2025-01-28 14:55:06.738 [info] [KeybindingService]: \ Keyboard event cannot be dispatched in keydown phase. 2025-01-28 14:55:06.930 [info] [KeybindingService]: / Soft dispatching keyboard event 2025-01-28 14:55:06.931 [info] [KeybindingService]: | Resolving ctrl+shift+[KeyV] 2025-01-28 14:55:06.932 [info] [KeybindingService]: \ From 4 keybinding entries, no when clauses matched the context. 2025-01-28 14:55:06.932 [info] [KeybindingService]: / Received keydown event - modifiers: [ctrl,shift], code: KeyV, keyCode: 86, key: V 2025-01-28 14:55:06.933 [info] [KeybindingService]: | Converted keydown event - modifiers: [ctrl,shift], code: KeyV, keyCode: 52 ('V') 2025-01-28 14:55:06.933 [info] [KeybindingService]: | Resolving ctrl+shift+[KeyV] 2025-01-28 14:55:06.934 [info] [KeybindingService]: \ From 4 keybinding entries, no when clauses matched the context. 2025-01-28 14:55:07.147 [info] [KeybindingService]: + Ignoring single modifier shift due to it being pressed together with other keys.
解决方法尝试
1. 重置VSCode用户配置
VSCode的配置文件损坏可能导致这类异常,先备份现有配置再重置:
mv ~/.config/Code\ OSS/ ~/.config/Code\ OSS.bak/
重启VSCode OSS后测试粘贴功能,如果恢复正常,可以逐步从备份的配置文件夹中迁移必要的设置,排查具体是哪个配置出了问题。
2. 验证系统剪贴板状态
用xclip工具测试系统剪贴板是否正常工作:
# 写入测试内容到剪贴板 echo "测试剪贴板" | xclip -selection clipboard # 读取剪贴板内容 xclip -selection clipboard -o
如果输出是测试剪贴板,说明系统剪贴板正常;如果没有输出,需要修复系统剪贴板服务(比如重启xorg或对应桌面环境的剪贴板服务)。
3. 重新安装VSCode OSS
如果配置重置无效,尝试彻底卸载后重新安装:
sudo pacman -Rns code-oss sudo pacman -S code-oss
操作前记得备份好自己的项目和必要的配置文件。
4. 排查第三方剪贴板管理器冲突
如果使用了clipman、parcellite这类第三方剪贴板管理器,暂时关闭它们,再测试VSCode的粘贴功能。部分剪贴板管理器会和VSCode的剪贴板处理逻辑冲突。
内容的提问来源于stack exchange,提问作者yees_7
相关产品推荐
相关产品推荐

