Enable Clickable Directory Paths in Windows Terminal to Seamlessly Open in File Explorer - Just Like URLs #18391
Labels
Issue-Feature
Complex enough to require an in depth planning process and actual budgeted, scheduled work.
Needs-Tag-Fix
Doesn't match tag requirements
Needs-Triage
It's a new issue that the core contributor team needs to triage at the next triage meeting
Description of the new feature
Windows Terminal currently displays URLs in a clickable format, allowing users to quickly navigate to web pages directly from the terminal. However, directory paths, such as those displayed in commands like
winget --info
or during output logs, are not clickable. This feature request proposes making directory paths clickable, enabling users to open the corresponding folder in File Explorer with a single click.Feature-Use-Benefit Analysis:
Ease of Access and Workflow Optimization:
Clicking directory paths directly would save users the time and effort of manually copying the path, opening File Explorer, and pasting it in the address bar.
This would be especially beneficial for developers, system administrators, and power users who frequently work with file paths, logs, and configurations, as shown in the screenshot where paths to DiagOutputDir or settings.json are displayed.
Consistency with Existing Functionality:
Windows Terminal already supports clickable URLs, which enhance usability and workflow efficiency. Extending this functionality to directory paths would create a cohesive and intuitive user experience.
Improved Error Resolution and Debugging:
For users troubleshooting logs or debugging application issues, being able to instantly open a directory reduces the cognitive load and speeds up the process of locating files or folders referenced in the terminal.
Broader Use Cases and Adoption:
This feature aligns with the needs of diverse user groups, from beginner users navigating the file system to advanced users leveraging tools like winget, as shown in the screenshot.
Proposed technical implementation details
Implementation Timeline
Phase 1: Path Detection
Phase 2: Clickable Rendering
Phase 3: Event Handling
Phase 4: Optimization and Accessibility
Phase 5: Testing and Release
Proposed Technical Implementation
1. Directory Path Detection
Regex for Path Matching:
Create a robust regular expression to detect valid directory paths within terminal output. The regex must:
C:\Users\username\Documents
).\\server\share
)../subfolder
and../parentfolder
.Example Regex:
Integration into Output Rendering:
isClickable: true
).2. Rendering Clickable Paths
Tokenization and Styling:
Context Awareness:
3. Event Handling for Click Actions
Mouse Click Handling:
Execution of the
explorer
Command:explorer
command to open the directory in File Explorer:explorer "C:\path\to\directory"
Error Handling:
explorer
command fails, display an appropriate error message in the terminal.4. Configuration Options
Enable/Disable Clickable Paths:
Example setting in
settings.json
:Behavior on Click:
Example configuration:
5. Keyboard Accessibility
Keyboard Navigation:
Accessibility Considerations:
6. Performance Optimization
Efficient Path Matching:
Caching:
7. Testing and Validation
Unit Tests:
Integration Tests:
User Testing:
The text was updated successfully, but these errors were encountered: