Skip to content

Commit

Permalink
Use xterm webLinks addon (#2810)
Browse files Browse the repository at this point in the history
Fixes #2809
  • Loading branch information
chabou committed Apr 5, 2018
1 parent e181e1e commit f5d48ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/components/term.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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]));
Expand Down

0 comments on commit f5d48ee

Please sign in to comment.