Terminal links broken when terminal.integrated.wordSeparators contains "-" mid-string (unescaped in regex)

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

If terminal.integrated.wordSeparators contains a “-” anywhere except the start or end of the string, link detection stops working in every integrated terminal. URLs are never underlined, and Cmd+click does nothing.
Running “Terminal: Open Detected Link…” fails with:
terminal links are not ready, cannot generate link quick pick
Cursor’s error log shows the cause:
SyntaxError: Invalid regular expression: /[ ()[]{}',"`<>;:./\|=-+*%^&!]/g: Range out of order in character class
at new RegExp
at _refreshSeparatorCodes
…

The separator string is put into a regex character class with most special characters escaped, but “-” is not escaped. So “=-+” is read as the range “=” to “+”, which is out of order and throws. That exception seems to stop link handling from being attached to the terminal.

Steps to Reproduce

  1. Add to settings.json:
    “terminal.integrated.wordSeparators”: " (){}',"`<>;:./\|=-+*%^&!"
  2. Reload the window and open a new terminal.
  3. Run: echo https://cursor.com
  4. Hold Cmd and hover over the URL. It does not underline, and Cmd+click does nothing.
  5. Run “Terminal: Open Detected Link…” from the Command Palette. It errors with “terminal links are not ready”.

Expected Behavior

Every character in wordSeparators is treated literally (“-” should be escaped like the other special characters). An invalid separator string should not disable terminal link detection.

Operating System

MacOS

Version Information

Version: 3.23.23 (Universal)
VS Code Extension API: 1.128.0
Commit: 2dac2428994fe34f12658d9ecad1541b98db2c00
Date: 2026-10-05T01:43:43.807Z
Layout: IDE
Build Type: Stable
Release Track: Default
Electron: 42.10.0
Chromium: 148.0.7778.280
Node.js: 24.18.1
V8: 14.8.178.38-electron.0
xterm.js: 6.1.0-beta.291
OS: Darwin arm64 25.6.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey @CSer, thanks for the detailed report and for tracking down the cause!

I was able to reproduce this on my end, and it’s not something you misconfigured. We’ve let the team know.

In the meantime, moving the - to the very start of the string works around it:

"terminal.integrated.wordSeparators": "- ()[]{}',\"`<>;:./\\|=+*%^&!"

Then reload the window and open a new terminal. I’d avoid putting it at the end: that won’t throw an error, but word links quietly stop matching. I’ll post here with any relevant updates.

My workaround was similar, I can confirm that it’s only an issue mid-string (which makes sense, the range operator itself is inert at the ends of the string in pcre).