如何清除屏幕命令中的回滚?

发布于 2024-07-05 09:44:44 字数 95 浏览 7 评论 0原文

我在 Linux 中使用 screen 命令进行命令行多任务处理,并将回滚缓冲区长度设置为一个非常大的值。 当我不想再保留某个选项卡时,是否有组合键可以清除该选项卡的缓冲区?

I use the screen command for command-line multitasking in Linux and I set my scrollback buffer length to a very large value. Is there a key combination to clear the buffer for a certain tab when I don't want it sitting there anymore?

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

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

发布评论

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

评论(7

蓝戈者 2024-07-12 09:44:44

此帖子有以下建议:

在要删除回滚的窗口中,将回滚设置为零,然后
将其恢复到正常值(在您的
例,15000)。

如果需要,您可以将其绑定到
关键:

绑定/评估“回滚0”“回滚15000”

在输入 Ca : 后,您也可以从会话中发出 scrollback 0 命令。
HTH。

This thread has the following suggestion:

In the window whose scrollback you want to delete, set the scrollback to zero, then
return it to its normal value (in your
case, 15000).

If you want, you can bind this to a
key:

bind / eval "scrollback 0" "scrollback 15000"

You can issue the scrollback 0 command from the session as well, after typing C-a :.
HTH.

相思故 2024-07-12 09:44:44
  • Ca C会清屏,包括提示
  • clear(命令,不是组合键)会清屏,留下提示

ETA:误读原题; 这些只会清除可见文本,但不会清除缓冲区!

  • C-a C will clear the screen, including the prompt
  • clear (command, not key combination) will clear the screen, leaving a prompt

ETA: misread the original question; these will just clear the visible text, but will not clear the buffer!

琉璃梦幻 2024-07-12 09:44:44

我还添加了命令“clear”来清理当前屏幕。 注意:您必须按 Enter 键才能重新获得提示。

bind '/' eval "clear" "scrollback 0" "scrollback 15000"

还将其添加到您的“.screenrc”以使其永久化。

注意,我在斜杠周围添加了单引号,以确保它不会干扰我的“.screenrc”。 可能没有必要。

I added the command "clear" as well to clean the current screen. N.B. You have to press enter to regain you prompt.

bind '/' eval "clear" "scrollback 0" "scrollback 15000"

Also add it to you ".screenrc" to make it permanent.

N.B. I added single quotes around the slash to be sure it didn't interfere in my ".screenrc". May not be necessary.

青春有你 2024-07-12 09:44:44

Command-K 似乎是 Mac 的最佳解决方案。
有关更多详细信息和说明,请参阅 此页面

Command-K seems to be best solution for Mac.
For more details and explanations, please refer to this page.

拧巴小姐 2024-07-12 09:44:44

alias cls='printf "\e[3J\033c"'

清除屏幕和回滚缓冲区。

alias cls='printf "\e[3J\033c"'

Clears the screen and scrollback buffer.

错々过的事 2024-07-12 09:44:44
^a : clear

在 Ubuntu 上为我工作。

^a : clear

worked for me on Ubuntu.

情徒 2024-07-12 09:44:44

从手册页:

C-a C       (clear)       Clear the screen.

From the man page:

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