我在其他平台上遇到过这个问题,比如 Android 上的 Termux 或通过 ssh 连接时,但从未在 Ubuntu 使用 nano 上遇到过。
- 我正在使用 Ubuntu 20.04 和 GNU nano,版本 4.8。
- 使用对话框菜单或CTRL++SHIFT和C++粘贴CTRLSHIFTV
- 我需要一次看到整行文本,因此如果该行对于终端来说太长,我总是使用 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
是否存在任何冲突的配置。
答案1
nano
不支持复制到剪贴板,因此如果您想将选定的文本复制到剪贴板以便将其粘贴到另一个应用程序,则必须使用终端的复制快捷方式Ctrl+ Shitf+ C。但是,由于此快捷方式用于复制终端中显示的内容,并且终端将文本视为多行(不是换行),因此文本将被复制为多行。
另一方面,如果您只想复制换行文本以在 内使用nano
,则可以使用nano
的快捷键复制和粘贴所选文本,因为它们“理解”换行行。复制的快捷键nano
是Alt+ 6,粘贴的快捷键是Ctrl+ U。
有关的: