So this time I fully restructured the MS-DOS Prompt.
The old terminal implementation had slowly turned into a monolith, with the UI, I/O, and command logic all packed into a single file and handled through a massive switch statement. I refactored the entire system and moved to a Command Pattern architecture. The terminal now acts purely as a controller, while individual commands live in a separate modular registry, which makes future expansion much cleaner and easier to maintain.
During the refactor, I also fixed the flexbox layout so the input line consistently stays anchored at the bottom of the log, where it should be. In addition, I implemented a custom auto-scroll function synchronized with DOM updates, preventing visual glitches when rendering long outputs.
I added several quality-of-life improvements as well. Command history is now supported through the up and down arrow keys, and I implemented a smart Tab-completion system. When typing the first token, it searches both the command registry and the Virtual File System. When typing arguments, it restricts suggestions strictly to filesystem paths.
Log in to leave a comment