如何删除 ssh 终端中突出显示的文本?

发布于 2024-08-15 17:16:38 字数 51 浏览 5 评论 0原文

我知道我可以突出显示文本并自动复制它,但是有没有办法删除突出显示的文本?我正在使用纳米。

I know that I can highlight text and its automatically copied, but is there a way to delete the text that you highlight? I am using nano.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末 2024-08-22 17:16:38

假设您在 Windows 上使用 PuTTY,应用程序的堆叠方式如下:

You -> Windows -> PuTTY -> SSH protocol -> sshd -> Unix pty -> nano -> filesystem

PuTTY 与 Windows 通信,因此它知道您的鼠标。它可以执行与 Windows 剪贴板交互等操作。另一方面,nano甚至不在您的计算机上运行,​​而是在远程计算机上运行。因此它不知道有关您的鼠标或 Windows 剪贴板的任何信息。它只知道它可以通过 tty 设备(通常是 pty 或“伪终端”设备)与之通信。

当您在本地运行 nano 时(在 Unix 桌面上、xterm 或类似的环境中),nano 与 xterm 通信,并且可以从终端获取鼠标信息(如果在 nano 中启用了鼠标支持)。

要在 nano 中获得鼠标支持,请尝试使用 nano -m,或将“set mouse”放入 ~/.nanorc 中。您可能需要浏览nano 文档以获取更多信息。此外,如果您的 termcap 文件中没有 PuTTY,您可能需要在 shell 中执行 export TERM=xterm 或类似操作。

启用鼠标支持后,nano 将使用 xterm 兼容的终端扩展通过 SSH 与 PuTTY 进行通信。然后,您将能够在 nano 中剪切和粘贴(以及删除文本),但您将无法再使用 Windows 剪贴板剪切和粘贴文本。 (如果您希望恢复原来的行为,可以在选择时按住 Shift 键。请参阅 PuTTY 文档 了解详细信息。)

Assuming you're using PuTTY on Windows, here is the way the applications are stacked:

You -> Windows -> PuTTY -> SSH protocol -> sshd -> Unix pty -> nano -> filesystem

PuTTY talks to Windows, so it knows about your mouse. And it can do things like interact with the Windows clipboard. On the other hand, nano isn't even running on your computer, it's running on the remote computer. So it doesn't know anything about your mouse or your Windows clipboard. It only knows about what it can talk to through a tty device (usually a pty, or "pseudo-terminal" device).

When you're running nano locally (on a Unix desktop, in xterm or something similar), nano talks to xterm, and can get mouse information from the terminal (if mouse support is enabled in nano).

To get mouse support in nano, try using nano -m, or put "set mouse" in your ~/.nanorc. You may want to browse the nano documentation for more information. Additionally, you may need to do export TERM=xterm or similar in your shell if PuTTY isn't in your termcap file.

With mouse support on, nano will use xterm-compatible terminal extensions to talk through SSH to PuTTY. Then you will be able to cut and paste (and delete text) in nano, but you won't be able to cut and paste text with the Windows clipboard anymore. (If you want the old behavior back, you can hold down shift while you select. See the PuTTY documentation for details.)

感情旳空白 2024-08-22 17:16:38

通常情况下,不会。问题是终端不了解鼠标以及鼠标突出显示的内容 - 它的级别非常低。换句话说,鼠标位于比终端“更高的层”;终端不知道鼠标所做的任何事情。

Ususally, no. The issue is that the terminal doesn't have any knowledge of the mouse and what the mouse highlights - it's very low level. In other terms, the mouse sits on a "higher layer" than the terminal; nothing the mouse does is known to the terminal.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文