From: Shuanglei Tao Date: Sun, 16 Jun 2019 00:06:10 +0000 (+0800) Subject: html: add xterm weblinks addon X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=19c89ff2bbacd0a4d69cbe1c7018b878be3950f4;p=ttyd.git html: add xterm weblinks addon --- diff --git a/html/package.json b/html/package.json index 55ec364..a796e71 100644 --- a/html/package.json +++ b/html/package.json @@ -51,6 +51,7 @@ "decko": "^1.2.0", "preact": "^8.4.2", "xterm": "^3.14.2", - "xterm-addon-fit": "^0.1.0-beta1" + "xterm-addon-fit": "^0.1.0-beta1", + "xterm-addon-web-links": "^0.1.0-beta10" } } diff --git a/html/src/components/terminal/index.tsx b/html/src/components/terminal/index.tsx index 4f26257..39a174f 100644 --- a/html/src/components/terminal/index.tsx +++ b/html/src/components/terminal/index.tsx @@ -2,6 +2,7 @@ import { bind } from 'decko'; import { Component, h } from 'preact'; import { ITerminalOptions, Terminal } from 'xterm'; import { FitAddon } from 'xterm-addon-fit'; +import { WebLinksAddon } from 'xterm-addon-web-links'; import { OverlayAddon } from './overlay'; import 'xterm/dist/xterm.css'; @@ -93,6 +94,7 @@ export default class Xterm extends Component { terminal.loadAddon(this.fitAddon); terminal.loadAddon(this.overlayAddon); + terminal.loadAddon(new WebLinksAddon()); terminal.onTitleChange((data) => { if (data && data !== '') { diff --git a/html/yarn.lock b/html/yarn.lock index fe147ed..90d47b9 100644 --- a/html/yarn.lock +++ b/html/yarn.lock @@ -8363,6 +8363,11 @@ xterm-addon-fit@^0.1.0-beta1: resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.1.0-beta1.tgz#ec483fe4cad466de290be7e5539c8beed757b851" integrity sha512-4HVm1RVqvBiIxBUxjjN63KIumI/mZYJ5lXkoR/onO//mh2Z2e257DmX1UqgCd2gi99EmZTt5CtEUinUANAkbvg== +xterm-addon-web-links@^0.1.0-beta10: + version "0.1.0-beta10" + resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.1.0-beta10.tgz#610fa9773a2a5ccd41c1c83ba0e2dd2c9eb66a23" + integrity sha512-xfpjy0V6bB4BR44qIgZQPoCMVakxb65gMscPkHpO//QxvUxKzabV3dxOsIbeZRFkUGsWTFlvz2OoaBLoNtv5gg== + xterm@^3.14.2: version "3.14.2" resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.14.2.tgz#f1285288bdc7df7056ef4bde64311900748c3e5d" diff --git a/src/index.html b/src/index.html index b56c32f..ca6c78b 100644 --- a/src/index.html +++ b/src/index.html @@ -1 +1 @@ -ttyd - Terminal \ No newline at end of file +ttyd - Terminal \ No newline at end of file