mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
parent
e181e1eb8d
commit
f5d48ee38a
1 changed files with 4 additions and 0 deletions
|
|
@ -2,12 +2,14 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import {Terminal} from 'xterm';
|
import {Terminal} from 'xterm';
|
||||||
import * as fit from 'xterm/lib/addons/fit/fit';
|
import * as fit from 'xterm/lib/addons/fit/fit';
|
||||||
|
import * as webLinks from 'xterm/lib/addons/webLinks/webLinks';
|
||||||
import {clipboard} from 'electron';
|
import {clipboard} from 'electron';
|
||||||
import * as Color from 'color';
|
import * as Color from 'color';
|
||||||
import terms from '../terms';
|
import terms from '../terms';
|
||||||
import processClipboard from '../utils/paste';
|
import processClipboard from '../utils/paste';
|
||||||
|
|
||||||
Terminal.applyAddon(fit);
|
Terminal.applyAddon(fit);
|
||||||
|
Terminal.applyAddon(webLinks);
|
||||||
|
|
||||||
// map old hterm constants to xterm.js
|
// map old hterm constants to xterm.js
|
||||||
const CURSOR_STYLES = {
|
const CURSOR_STYLES = {
|
||||||
|
|
@ -79,6 +81,8 @@ export default class Term extends React.PureComponent {
|
||||||
this.term = props.term || new Terminal(this.termOptions);
|
this.term = props.term || new Terminal(this.termOptions);
|
||||||
this.term.attachCustomKeyEventHandler(this.keyboardHandler);
|
this.term.attachCustomKeyEventHandler(this.keyboardHandler);
|
||||||
this.term.open(this.termRef);
|
this.term.open(this.termRef);
|
||||||
|
this.term.webLinksInit();
|
||||||
|
|
||||||
if (props.term) {
|
if (props.term) {
|
||||||
//We need to set options again after reattaching an existing 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]));
|
Object.keys(this.termOptions).forEach(option => this.term.setOption(option, this.termOptions[option]));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue