-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Summary
Implement enhanced PowerShell prompt customization inspired by Scott Hanselman's blog post "My Ultimate PowerShell prompt with Oh My Posh and the Windows Terminal" to provide a modern, informative, and visually appealing terminal experience in our containerized PowerShell environment.
Blog Post Reference
- Source: https://www.hanselman.com/blog/my-ultimate-powershell-prompt-with-oh-my-posh-and-the-windows-terminal
- Author: Scott Hanselman
- Date: August 31, 2021
Key Features to Implement
1. Oh My Posh Integration
- Install Oh My Posh prompt theme engine
- Configure with container-optimized theme
- Support for Git branch/status display
- Customizable segments for containerized environments
2. Enhanced Typography
- Install Nerd Fonts (CaskaydiaCove NF or similar)
- Support for special glyphs and icons in prompt
- Proper Unicode handling in container environment
3. Terminal-Icons Module
- Colorized directory listings
- File type icons in
ls/dircommands - Enhanced visual file system navigation
4. PSReadLine Enhancements
- Predictive IntelliSense
- Custom key bindings for common operations
- Improved command-line editing experience
5. Container-Specific Segments
- Display container information (if applicable)
- .NET Core version indicator
- PowerShell version display
- Current working directory with path shortening
- Git repository status (when in git repos)
Technical Considerations for Containerized Environment
Font Handling
- Fonts must be installed in container or provided by host terminal
- Fallback options for environments without Nerd Font support
- Testing across different terminal emulators
Performance
- Minimize startup time impact
- Efficient Git status checking
- Lazy loading of modules where possible
Configuration Management
- Default configuration that works out-of-the-box
- Easy customization through environment variables
- Profile persistence options
Cross-Platform Compatibility
- Ensure compatibility across ARM64 and x64 architectures
- Test on various host operating systems
- Graceful degradation when features unavailable
Implementation Approach
Phase 1: Basic Oh My Posh Setup
- Install Oh My Posh in container build
- Create basic PowerShell profile with Oh My Posh initialization
- Configure simple theme with essential information
- Test basic functionality
Phase 2: Enhanced Features
- Add Terminal-Icons module
- Install and configure Nerd Fonts
- Implement Git integration
- Add container-specific segments
Phase 3: Advanced Customization
- PSReadLine enhancements
- Custom key bindings
- Performance optimizations
- Configuration options
Acceptance Criteria
Functional Requirements
- Oh My Posh successfully initializes on container startup
- Prompt displays current directory, Git status (when applicable)
- Terminal-Icons provides colorized file listings
- No significant impact on container startup time (<2 seconds additional)
- Works across all supported architectures (x64, ARM64)
Visual Requirements
- Prompt includes appropriate glyphs and colors
- File listings show icons and colors
- Git branch and status clearly visible
- Consistent appearance across different terminals
Performance Requirements
- Prompt rendering time <100ms
- Container startup time increase <2 seconds
- Memory usage increase <50MB
Compatibility Requirements
- Works with default Ubuntu terminal
- Graceful fallback when Nerd Fonts unavailable
- Compatible with VS Code integrated terminal
- Works in Docker Desktop and command-line Docker
Testing Strategy
Unit Tests
- PowerShell profile loading
- Module import functionality
- Configuration validation
Integration Tests
- Full container build with prompt features
- Cross-architecture compatibility
- Terminal compatibility testing
User Experience Tests
- Startup time measurement
- Visual appearance verification
- Interactive functionality testing
Documentation Updates
- Update README with prompt features
- Add customization guide
- Include screenshots of enhanced prompt
- Document troubleshooting steps
Risks and Mitigation
Risk: Increased Container Size
- Mitigation: Use multi-stage builds, minimize font installations
Risk: Terminal Compatibility Issues
- Mitigation: Provide fallback configurations, extensive testing
Risk: Performance Impact
- Mitigation: Lazy loading, performance benchmarking, optimization
Risk: Font Rendering Issues
- Mitigation: Multiple font options, graceful degradation
Success Metrics
- Container download metrics remain stable or improve
- User feedback on enhanced experience
- No increase in reported issues
- Successful cross-platform functionality
This enhancement will significantly improve the user experience of our PowerShell container while maintaining the reliability and performance characteristics that users expect.