diff --git a/lib/components/term.js b/lib/components/term.js index efde66be..e5077528 100644 --- a/lib/components/term.js +++ b/lib/components/term.js @@ -2,12 +2,14 @@ import React from 'react'; import {Terminal} from 'xterm'; import * as fit from 'xterm/lib/addons/fit/fit'; +import * as webLinks from 'xterm/lib/addons/webLinks/webLinks'; import {clipboard} from 'electron'; import * as Color from 'color'; import terms from '../terms'; import processClipboard from '../utils/paste'; Terminal.applyAddon(fit); +Terminal.applyAddon(webLinks); // map old hterm constants to xterm.js const CURSOR_STYLES = { @@ -79,6 +81,8 @@ export default class Term extends React.PureComponent { this.term = props.term || new Terminal(this.termOptions); this.term.attachCustomKeyEventHandler(this.keyboardHandler); this.term.open(this.termRef); + this.term.webLinksInit(); + if (props.term) { //We need to set options again after reattaching an existing term Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option]));