Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ function parseVersion(versionString = '') {
export function createSupportsHyperlinks(stream) {
const {
CI,
CURSOR_TRACE_ID,
FORCE_HYPERLINK,
NETLIFY,
TEAMCITY_VERSION,
Expand Down Expand Up @@ -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;
}
Expand Down
23 changes: 23 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down