dependant on the terminal software that you're using, quite a few have an option somewhere that you can change to show the number of lines of 'history'
PuTTY for example.
Alternatively, if you need to interactively run a program, you could always use 'typescript'
1) type "typescript" at the prompt, then run your program.
2) everything outputted to screen now goes to a file called 'typescript' including your key inputs.
3) ctrl-d at the end to stop typescript.
Hope that makes sense, I've not explained it that clearly.
