Until now, we have created commands that don't have an internal state. But some commands can keep an internal state and change its behavior accordingly. The state could be limited to the session itself or it could be shared across multiple sessions. The more obvious example is the command history in the Terminal, where all commands executed are stored and retained between sessions.
Commands with status
Volatile status
The easiest thing to implement is a status that is not persistent and gets lost when the application exits. All we need to do is create a custom data structure that hosts the status and satisfies the command interface. The methods will belong to the pointer to the type, as otherwise they will not be able...