Skip to main content
WezTerm supports both implicit and explicit hyperlinks, allowing you to click URLs and create custom clickable patterns that integrate with your workflow. 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:// and https:// URLs
  • file:// URLs
  • mailto: links
Simply click any detected URL to open it in your default browser. Create clickable patterns for your specific workflow:
Task Numbers
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 match
  • format - 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
This matches patterns like library/nginx:latest and creates a link to Docker Hub. WezTerm supports the Hyperlinks in Terminal Emulators specification, which allows programs to emit hyperlinks without showing the URL. From the command line:
Output Hyperlink
This displays “This is a link” as clickable text that opens 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

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

1

Start with defaults

Always begin with wezterm.default_hyperlink_rules() to preserve standard URL matching.
2

Test your patterns

Use a regex testing tool to verify your patterns match correctly before adding them.
3

Order matters

Rules are evaluated in order. Place more specific rules before general ones.
4

Avoid conflicts

Ensure your custom patterns don’t conflict with default URL patterns.

Troubleshooting

  1. Check that your pattern is correctly escaped (Lua string escaping)
  2. Verify the regex matches your expected text
  3. Ensure the rule is added to config.hyperlink_rules

Wrong URL Generated

  1. Verify capture groups are in the correct order
  2. Check that $1, $2 etc. reference the right groups
  3. 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