123456789101112131415161718192021 |
- const supportsHyperlinks = require('supports-hyperlinks');
- const OSC = '\u001B]';
- const BEL = '\u0007';
- const SEP = ';';
- module.exports = function terminalLink(text, url) {
- if (supportsHyperlinks.stdout) {
- return [OSC, '8', SEP, SEP, url, BEL, text, OSC, '8', SEP, SEP, BEL].join('');
- }
- return text;
- };
|