加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

使用xclip后,Tmux中的键盘快捷键已停用

发布时间:2020-12-14 02:09:47 所属栏目:Linux 来源:网络整理
导读:我在.tmux.conf中使用以下配置来从xclip复制文本 bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"bind C-v run "tmux set-buffer "$(xclip -o -sel clipboard)"; tmux paste-buffer" 如果我运行C-prefix C-c,例如,将文本粘贴到另一个应用程
我在.tmux.conf中使用以下配置来从xclip复制文本

bind C-c run "tmux save-buffer - | xclip -i -sel clipboard"
bind C-v run "tmux set-buffer "$(xclip -o -sel clipboard)"; tmux paste-buffer"

如果我运行C-prefix C-c,例如,将文本粘贴到另一个应用程序中,但之后tmux终端中没有任何一个tmux命令工作(例如C-prefix [进入复制模式等])

我的配置有什么问题?

解决方法

根据 https://wiki.archlinux.org/index.php/Tmux#X_clipboard_integration:

It seems xclip does not close STDOUT after it has read from tmux’s buffer. As such,tmux doesn’t know that the copy task has completed,and continues to /await xclip’s termination,thereby rendering the window manager unresponsive. To work around this,you can execute the command via run-shell -b instead of run,you can redirect STDOUT of xclip to /dev/null,or you can use an alternative command like xsel.

将PREFIX C-c绑定更新为以下内容为我修复了它:

bind C-c run "tmux save-buffer - | xclip -i -sel clipboard > /dev/null"

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读