diff --git a/index.js b/index.js index 3ff4ad5..a29dbd0 100644 --- a/index.js +++ b/index.js @@ -25,6 +25,7 @@ function parseVersion(versionString = '') { export function createSupportsHyperlinks(stream) { const { CI, + CURSOR_TRACE_ID, FORCE_HYPERLINK, NETLIFY, TEAMCITY_VERSION, @@ -94,6 +95,11 @@ export function createSupportsHyperlinks(stream) { } case 'vscode': { + // Cursor forked VS Code and supports hyperlinks in 0.x.x + if (CURSOR_TRACE_ID) { + return true; + } + // eslint-disable-next-line no-mixed-operators return version.major > 1 || version.major === 1 && version.minor >= 72; } diff --git a/test.js b/test.js index 7334b66..4e3dca9 100644 --- a/test.js +++ b/test.js @@ -219,6 +219,29 @@ test('supported vscode >= 1.72.0 tty stream', t => { })); }); +test('supported Cursor (vscode fork) no stream supplied', t => { + t.true(isSupported({ + env: { + CURSOR_TRACE_ID: 'some-trace-id', + TERM_PROGRAM: 'vscode', + TERM_PROGRAM_VERSION: '0.49.6', + }, + })); +}); + +test('supported Cursor (vscode fork) tty stream', t => { + t.true(isSupported({ + env: { + CURSOR_TRACE_ID: 'some-trace-id', + TERM_PROGRAM: 'vscode', + TERM_PROGRAM_VERSION: '0.49.6', + }, + stream: { + isTTY: true, + }, + })); +}); + test('supported ghostty no stream supplied', t => { t.true(isSupported({ env: {