In this chapter, we went through some terminology, in order to understand why modern Terminal applications exist and how they evolved.Â
Then, we focused on how to implement a basic pseudo-terminal. The first step was to create a loop that handled input management, then it was necessary to create a command selector and finally an executor. The selector could choose between a series of functions defined in the package, and we created a special command to exit the application. With some refactoring, we went from functions to structs containing both the name and action.
We saw how to improve the application in various ways. First, we created a support for multiline input (using a custom split function for a scanner) that supported quoted strings, with new lines. Then, we created some tools to add colored output to our functions and used them in one of the commands...