diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/ansi-escapes | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) | |
download | wallet-core-bbff7403fbf46f9ad92240ac213df8d30ef31b64.tar.xz |
update packages
Diffstat (limited to 'node_modules/ansi-escapes')
-rw-r--r-- | node_modules/ansi-escapes/index.js | 28 | ||||
-rw-r--r-- | node_modules/ansi-escapes/package.json | 2 | ||||
-rw-r--r-- | node_modules/ansi-escapes/readme.md | 6 |
3 files changed, 31 insertions, 5 deletions
diff --git a/node_modules/ansi-escapes/index.js b/node_modules/ansi-escapes/index.js index 4d47b1098..1122cbfb6 100644 --- a/node_modules/ansi-escapes/index.js +++ b/node_modules/ansi-escapes/index.js @@ -1,6 +1,9 @@ 'use strict'; const x = module.exports; const ESC = '\u001B['; +const OSC = '\u001B]'; +const BEL = '\u0007'; +const SEP = ';'; const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal'; x.cursorTo = (x, y) => { @@ -75,12 +78,29 @@ x.scrollUp = ESC + 'S'; x.scrollDown = ESC + 'T'; x.clearScreen = '\u001Bc'; -x.beep = '\u0007'; +x.beep = BEL; + +x.link = (text, url) => { + return [ + OSC, + '8', + SEP, + SEP, + url, + BEL, + text, + OSC, + '8', + SEP, + SEP, + BEL + ].join(''); +}; x.image = (buf, opts) => { opts = opts || {}; - let ret = '\u001B]1337;File=inline=1'; + let ret = OSC + '1337;File=inline=1'; if (opts.width) { ret += `;width=${opts.width}`; @@ -94,9 +114,9 @@ x.image = (buf, opts) => { ret += ';preserveAspectRatio=0'; } - return ret + ':' + buf.toString('base64') + '\u0007'; + return ret + ':' + buf.toString('base64') + BEL; }; x.iTerm = {}; -x.iTerm.setCwd = cwd => '\u001B]50;CurrentDir=' + (cwd || process.cwd()) + '\u0007'; +x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL; diff --git a/node_modules/ansi-escapes/package.json b/node_modules/ansi-escapes/package.json index 24cb2f213..f1605efb7 100644 --- a/node_modules/ansi-escapes/package.json +++ b/node_modules/ansi-escapes/package.json @@ -1,6 +1,6 @@ { "name": "ansi-escapes", - "version": "3.0.0", + "version": "3.1.0", "description": "ANSI escape codes for manipulating the terminal", "license": "MIT", "repository": "sindresorhus/ansi-escapes", diff --git a/node_modules/ansi-escapes/readme.md b/node_modules/ansi-escapes/readme.md index 45490e9ec..38b459fc4 100644 --- a/node_modules/ansi-escapes/readme.md +++ b/node_modules/ansi-escapes/readme.md @@ -123,6 +123,12 @@ Clear the terminal screen. Output a beeping sound. +### link(text, url) + +Create a clickable link. + +[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support. + ### image(input, [options]) Display an image. |