Implicit Hyperlinks
Implicit hyperlinks are automatically generated by matching patterns in terminal output. WezTerm includes default rules for URLs and allows you to define custom patterns.Default URL Matching
By default, WezTerm automatically detects and makes URLs clickable:http://andhttps://URLsfile://URLsmailto:links
Custom Hyperlink Rules
Create clickable patterns for your specific workflow:Task Numbers
GitHub Repository Links
Automatically link GitHub repository references:GitHub Repos
JIRA Issues
JIRA Links
Pull Request Numbers
PR Numbers
Pattern Matching
Hyperlink rules use regular expressions with capture groups:regex- The pattern to matchformat- The URL template where$1,$2, etc. are replaced with captured groups
The first matched regex group is captured in
$1, the second in $2, and so on.Example: Multiple Capture Groups
Docker Image Tags
library/nginx:latest and creates a link to Docker Hub.
Explicit Hyperlinks
WezTerm supports the Hyperlinks in Terminal Emulators specification, which allows programs to emit hyperlinks without showing the URL.Using Explicit Hyperlinks
From the command line:Output Hyperlink
http://example.com.
Format Specification
The escape sequence format is:- First part:
\e]8;;{URL}\e\\- Starts the hyperlink - Middle:
{display text}- The visible text - Last part:
\e]8;;\e\\- Ends the hyperlink
Script Example
Bash Function
Advanced Configuration
Combining Rules
Hyperlink Actions
Opening Hyperlinks
By default, clicking a hyperlink opens it in your system’s default browser. You can customize this behavior:Custom Link Handler
Keyboard Navigation
Use Quick Select mode (Ctrl+Shift+Space) to quickly select and open visible hyperlinks without using the mouse.
Best Practices
Start with defaults
Always begin with
wezterm.default_hyperlink_rules() to preserve standard URL matching.Test your patterns
Use a regex testing tool to verify your patterns match correctly before adding them.
Troubleshooting
Links Not Clickable
- Check that your pattern is correctly escaped (Lua string escaping)
- Verify the regex matches your expected text
- Ensure the rule is added to
config.hyperlink_rules
Wrong URL Generated
- Verify capture groups are in the correct order
- Check that
$1,$2etc. reference the right groups - Test the format string with sample matches
Performance Issues
- Complex regex patterns can slow down rendering
- Limit the number of rules for better performance
- Use specific patterns rather than overly broad matches