简体   繁体   English

Emacs上的Perl调试器:清除屏幕(缓冲区)?

[英]Perl debugger on Emacs: Clear screen (buffer)?

Say I have long debugging session in Perl with perldb on Emacs (Mx perldb). 说我在Emacs上的perldb (Mx perldb)上在Perl中进行了长时间的调试。 The output piles up, and at some point it becomes difficult to navigate through it. 输出堆积,在某些时候变得很难导航。

I can restart the debugger with R , but that doesn't clear up the previous output. 我可以使用R重新启动调试器,但是不会清除先前的输出。 Is there a command to clear up the output of the buffer of the Perl debugger without having to kill the debugger and starting a new session? 是否有命令可以清除Perl调试器的缓冲区输出而不必终止调试器并开始新的会话?

You can run comint-truncate-buffer . 您可以运行comint-truncate-buffer This will remove all but the last 1024 lines from the buffer. 这将从缓冲区中删除除最后1024行之外的所有行。 The size can be customized by changing comint-buffer-maximum-size . 可以通过更改comint-buffer-maximum-size来定制comint-buffer-maximum-size

If you'd like to have the buffer truncated automatically, run this snippet of elisp: 如果您想自动截断缓冲区,请运行以下elisp片段:

(add-hook 'comint-output-filter-functions 'comint-truncate-buffer)

Debugger input and output is buffer contents like any other — if you want to delete it, just do it. 调试器的输入和输出是缓冲区内容,与其他任何缓冲区一样-如果要删除它,则只需执行它即可。 For example, Cx h Cw ( mark-whole-buffer followed by kill-region ) works in perldb buffers just fine, and is the closest equivalent to a "clear screen" command in a text terminal. 例如, Cx h Cwmark-whole-buffer后跟kill-region )在perldb缓冲区中可以正常工作,并且与文本终端中的“ clear screen”命令最接近。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM