EETOP 创芯网论坛

便捷登录,只需一步

找回密码

  登录   注册  

搜帖子
第三代半导体技术资料|下载奖励300信元
查看: 700|回复: 9

[求助] Linux 下鼠标中键无法复制粘贴

[复制链接]
发表于 2020-2-14 09:13:07 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?注册

x
如题, 楼主的linux terminal中, 以前可以,但现在突然无法使用鼠标中键进行复制粘贴了, 但在vim 中仍然可以复制粘贴

有谁知道这是什么原因, 怎么解决吗
发表于 2020-2-14 15:14:07 | 显示全部楼层
试一下命令:

xmodmap -e "pointer = 3 2 1 4 5 6 7 8"
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-2-17 10:33:27 | 显示全部楼层


   
amodaman 发表于 2020-2-14 15:14
试一下命令:

xmodmap -e "pointer = 3 2 1 4 5 6 7 8"


这个方法能改变鼠标中键的行为了, 但是改完并不是复制粘贴的动作
回复 支持 反对

使用道具 举报

发表于 2020-2-17 10:51:36 | 显示全部楼层


   
494693243 发表于 2020-2-17 10:33
这个方法能改变鼠标中键的行为了, 但是改完并不是复制粘贴的动作


那就有可能是$HOME/.Xdefaults里面的Xerm的设置改变掉了?试一下在.Xdefaults里面增加一行:
XTerm*selectToClipboard: true

根据X-Windows的Manual:


X applications have multiple copy buffers when selecting text, two of which are PRIMARY and CLIPBOARD. FastX reads the contents of the CLIPBOARD buffer only.
  • PRIMARY
    • The “PRIMARY” selection buffer receives data when the user highlights text with the mouse. The text in this buffer is pasted when the user presses the middle mouse button in an application’s text entry field. This cut-and-paste buffer is a legacy function which new users are generally not told about, in the interests of avoiding mass confusion. Most modern applications support this buffer. This is the only buffer used by xterm.
  • CLIPBOARD
    • The “CLIPBOARD” selection buffer is used for the cut-and-paste functions that most users are familiar with: Selecting the “cut”, “copy” or “paste” menu items from the application’s “Edit” menu, or using the corresponding CTRL-X, CTRL-C, or CTRL-V shortcut keys. This selection buffer is the standard means of performing cut-and-paste operations in most modern applications. However, this selection buffer is unfortunately not used at all by xterm in the default configuration.
Because of the use of multiple buffers, text highlighted in xterm cannot be pasted into a modern application with CTRL-V (or Edit->Paste). The PRIMARY buffer is often overwritten by inadvertent highlighting before the user is ready to paste.

回复 支持 反对

使用道具 举报

发表于 2020-2-17 10:54:07 | 显示全部楼层


   
494693243 发表于 2020-2-17 10:33
这个方法能改变鼠标中键的行为了, 但是改完并不是复制粘贴的动作





在$HOME/.Xdefaults里面增加一行:

XTerm*selectToClipboard: true

根据X-Window的Manual:
X applications have multiple copy buffers when selecting text, two of which are PRIMARY and CLIPBOARD. FastX reads the contents of the CLIPBOARD buffer only.
  • PRIMARY
    • The “PRIMARY” selection buffer receives data when the user highlights text with the mouse. The text in this buffer is pasted when the user presses the middle mouse button in an application’s text entry field. This cut-and-paste buffer is a legacy function which new users are generally not told about, in the interests of avoiding mass confusion. Most modern applications support this buffer. This is the only buffer used by xterm.
  • CLIPBOARD
    • The “CLIPBOARD” selection buffer is used for the cut-and-paste functions that most users are familiar with: Selecting the “cut”, “copy” or “paste” menu items from the application’s “Edit” menu, or using the corresponding CTRL-X, CTRL-C, or CTRL-V shortcut keys. This selection buffer is the standard means of performing cut-and-paste operations in most modern applications. However, this selection buffer is unfortunately not used at all by xterm in the default configuration.
Because of the use of multiple buffers, text highlighted in xterm cannot be pasted into a modern application with CTRL-V (or Edit->Paste). The PRIMARY buffer is often overwritten by inadvertent highlighting before the user is ready to paste.



回复 支持 反对

使用道具 举报

发表于 2020-2-17 11:05:48 | 显示全部楼层
遇到同样的问题,同求解决方案
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-2-17 14:43:02 | 显示全部楼层


   
amodaman 发表于 2020-2-17 10:54
在$HOME/.Xdefaults里面增加一行:

XTerm*selectToClipboard: true


我把我的vncserver 桌面kill 掉,重新建立一个就好了
回复 支持 反对

使用道具 举报

发表于 2020-2-18 16:20:23 | 显示全部楼层
不懂帮顶,我等小菜鸟只能围观并且学习
回复 支持 反对

使用道具 举报

 楼主| 发表于 2020-2-19 09:10:34 | 显示全部楼层


   
jianxuan38 发表于 2020-2-17 11:05
遇到同样的问题,同求解决方案


我把vncserver 的桌面kill 掉, 重新建立一个就好了
回复 支持 反对

使用道具 举报

发表于 2020-5-2 10:32:22 来自手机 | 显示全部楼层
关掉终端重启就ok了,反正很长时间不用那个终端就会有这样的问题,具体原因不知
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /2 下一条

小黑屋| 关于我们| 联系我们| 在线咨询 |  EETOP 创芯网 ( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2020-5-31 05:48 , Processed in 0.063721 second(s), 8 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表