comint-buffer-maximum-size

comint-buffer-maximum-size is a variable defined in `comint.el'.
Its value is
1024


Documentation:
The maximum size in lines for Comint buffers.
Comint buffers are truncated from the top to be no greater than this number, if
the function `comint-truncate-buffer' is on `comint-output-filter-functions'.

You can customize this variable.