This is called "split screen scrolling"... I believe there are console libraries for that and you may have to do some serious Googling to find them.
Writing your own is an option but it will be a fair bit of work since you'll be essentially rewriting the text output subsystem used by the console.