Implement Enhanced CLI and Command History
Issue Description
The current command-line interface (CLI) for the interpreter is basic and lacks features that would improve user experience, particularly in interactive mode. Adding command history, line editing, and other modern CLI features would make the interpreter more usable.
Desired Features
- Command History: Allow navigating through previously entered commands using up/down arrows
- Line Editing: Enable editing the current line with left/right arrow keys, backspace, delete, etc.
- Auto-completion: Provide tab completion for BASIC keywords and variables
- Syntax Highlighting: Add basic colorization of code elements
- Multi-line Editing: Support for editing multi-line statements
- Save/Load History: Persist command history between sessions
Technical Approach
- Integrate a library like GNU Readline, libedit, or a cross-platform alternative
- Implement a history manager that saves and restores command history
- Add syntax highlighting using ANSI escape sequences
- Create an auto-completion engine for BASIC keywords and context-aware completion
Platform Considerations
- Ensure functionality works across Windows, macOS, and Linux
- Handle terminal differences appropriately
- Provide graceful fallback for environments that don't support all features
Implementation Steps
- Research available libraries for line editing (readline, libedit, etc.)
- Add the selected library as a dependency in CMake
- Create a CLI wrapper class to handle terminal interaction
- Implement history management with file storage
- Add syntax highlighting for BASIC keywords
- Implement auto-completion logic
Priority
Medium - This enhances usability but isn't critical for core functionality
Related Components
- src/main.cpp - Main interaction loop
- src/io/io_system.cpp - I/O handling
- src/platform/platform.cpp - Platform-specific terminal features
Implement Enhanced CLI and Command History
Issue Description
The current command-line interface (CLI) for the interpreter is basic and lacks features that would improve user experience, particularly in interactive mode. Adding command history, line editing, and other modern CLI features would make the interpreter more usable.
Desired Features
Technical Approach
Platform Considerations
Implementation Steps
Priority
Medium - This enhances usability but isn't critical for core functionality
Related Components