8000 Add support for Cursor by Drarig29 · Pull Request #4 · chalk/supports-hyperlinks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for Cursor #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to o 8000 ur terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 10, 2025
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
0