How to increase terminal window buffer in IntelliJ

Command + Shift + A or Ctrl + Shift + A
Type registry, click "Registry..."

Increase the "terminal.buffer.max.lines.count" to 100000 or any number you want, the default is 1000.