A long time I was working on a Linux setup that had a great utility to add a command line history buffer to any executable that read from stdin.
So if you have a Linux executable, for example a command line oriented C++ program, every time that executable read from stdin, you could use the up and down arrows to scroll aback and forth through your previous inputs just like you can do in a plain terminal window. In other words, the executable "inherited" a command line history buffer when it didn't have one before.
Does anyone know what utility I am talking about? You launched it at the command line and had it load the Linux executable you wanted "wrapped" as one of the command line arguments to the utility. I simply can't remember the name of that tool.