在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
芯片精品文章合集(500篇!) 创芯人才网--重磅上线啦!
查看: 14546|回复: 12

[求助] 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, 2024-12-22 09:04 , Processed in 0.022855 second(s), 6 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表