Look here for full transcript and source code: https://www.znibbl.es/video/repl-with-history
https://www.patreon.com/znibbles
Let's consider a nice little addition to our REPL. All modern shells that are in use today provide a means of accessing the history of commands issued to it by typing the up and down arrow keys. readline actually does this natively, but because we are dealing with an external environment here, we have to do a little extra setup.