Look at GNU's readline library. It can be configured for vertical or horizontal scrolling. GNU EMACS most likely has this built in. I use the readline library for making secure user interfaces and have found it's other features nice (history, name completion etc.).