Reputation: 96294
Say I have long debugging session in Perl with perldb
on Emacs (M-x perldb). 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. 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?
Upvotes: 2
Views: 407
Reputation: 154996
Debugger input and output is buffer contents like any other — if you want to delete it, just do it. For example, C-x h C-w
(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.
Upvotes: 1
Reputation: 66069
You can run comint-truncate-buffer
. This will remove all but the last 1024 lines from the buffer. The size can be customized by changing comint-buffer-maximum-size
.
If you'd like to have the buffer truncated automatically, run this snippet of elisp:
(add-hook 'comint-output-filter-functions 'comint-truncate-buffer)
Upvotes: 3