我在其他平台(例如 Android 上的 Termux)或通过 ssh 连接时遇到过此问题,但从未在使用 nano 的 Ubuntu 上遇到过此问题。
- 我正在使用 Ubuntu 20.04 和 GNU nano 版本 4.8。
- 使用对话框菜单或CTRL++和++进行粘贴SHIFTCCTRLSHIFTV
- 我需要立即查看整行文本,因此如果该行对于终端来说太长,我总是使用 nano 设置进行换行。
但是现在,当我复制换行的行时,nano 会在每个换行都存在的地方粘贴一个额外的换行符,而不是粘贴为单行。无论它在屏幕上绕行多少次,它都应该作为单行复制并粘贴为单行,没有换行符。
我很茫然,因为我没有改变任何东西,而且我不记得过去在 Ubuntu 上有过 nano 的这个问题。
下面是一个带有字母 j 的长行的示例:
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
正如您所看到的,粘贴了三行而不是一行。
但是,如果我echo
或cat
同一行,然后从终端复制包装的输出,它将粘贴为单行。
jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
在 xfce4-terminal 和 guake 上都尝试过。同样的问题。另外,我尝试过softwrap
使用和不使用以下选项:
nowrap
atblanks
hardwrap
- 甚至
nonewlines
为了更好的措施
我检查了/etc/nanorc
、~/.nanorc
、 和/usr/share/nano/*.nanorc
是否有任何冲突的配置。
nano
不支持复制到剪贴板,因此如果要将所选文本复制到剪贴板以便将其粘贴到另一个应用程序,则必须使用终端的复制快捷键Ctrl+ Shitf+ C。但是,由于此快捷方式用于复制终端中显示的内容,并且终端将文本视为多行(不是换行),因此文本将被复制为多行。另一方面,如果您只想复制换行文本以在 内使用它
nano
,那么您可以使用nano
的快捷方式来复制和粘贴所选文本,因为这些“理解”换行。内部复制的快捷键nano
是Alt+ 6,粘贴的快捷键是Ctrl+ U。有关的:
man nano