Preparing to C++-ify the Terminal logic.