diff --git a/package.json b/package.json index ea62c2f..a7b43ff 100644 --- a/package.json +++ b/package.json @@ -119,6 +119,7 @@ "winston": "^3.3.3", "xterm": "^4.8.1", "xterm-addon-fit": "^0.4.0", + "xterm-addon-web-links": "^0.4.0", "yargs": "^15.4.1" }, "devDependencies": { diff --git a/src/client/wetty/term.ts b/src/client/wetty/term.ts index 08cc418..4bdf4b5 100644 --- a/src/client/wetty/term.ts +++ b/src/client/wetty/term.ts @@ -1,5 +1,6 @@ import type { Socket } from 'socket.io-client'; import _ from 'lodash'; +import { WebLinksAddon } from 'xterm-addon-web-links'; import { FitAddon } from 'xterm-addon-fit'; import { Terminal } from 'xterm'; @@ -10,6 +11,8 @@ import { terminal as termElement } from '../shared/elements.js'; export function terminal(socket: typeof Socket): Term | undefined { const term = new Terminal() as Term; if (_.isNull(termElement)) return; + const webLinksAddon = new WebLinksAddon(); + term.loadAddon(webLinksAddon); const fitAddon = new FitAddon(); term.loadAddon(fitAddon); term.open(termElement);