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?
You can run
comint-truncate-buffer. This will remove all but the last 1024 lines from the buffer. The size can be customized by changingcomint-buffer-maximum-size.If you’d like to have the buffer truncated automatically, run this snippet of elisp: