Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update xterm to v4 #3830

Merged
merged 32 commits into from
Oct 6, 2019
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
5438c7f
update xterm to 4
Stanzilla Sep 23, 2019
978ee1f
add back webGL addon
Stanzilla Sep 23, 2019
94a66c7
remove ligatures xterm addon, unused atm and does not work with webGL…
Stanzilla Sep 23, 2019
5ab5069
update node-pty
Stanzilla Sep 23, 2019
5cb06db
more work on trying to get xterm4 to work
Stanzilla Sep 24, 2019
ee48b03
update xterm to 4.0.2
Stanzilla Sep 24, 2019
37d7f26
move where xterm addon props are assigned
Stanzilla Sep 24, 2019
add0934
more updates
Stanzilla Sep 24, 2019
0686411
only load webgl addon if webgl is enabled
Stanzilla Sep 24, 2019
66060e5
fix search function
Stanzilla Sep 24, 2019
59bf928
remove rendererType setting, the xterm addon does this for us
Stanzilla Sep 24, 2019
917efab
use xcode 10.3 on circleci
Stanzilla Sep 24, 2019
ea45320
fix typo
Stanzilla Sep 24, 2019
4e3a01b
revert node-pty bump for now
Stanzilla Sep 24, 2019
bc6113b
use stable versions of the xterm plugins
Stanzilla Sep 24, 2019
99e3e82
fix focus listener
Stanzilla Sep 27, 2019
8f306e2
add windowsMode prop
Stanzilla Sep 27, 2019
7cebabb
move webGL check
Stanzilla Sep 27, 2019
8ed0fca
apply tweaks by @GitSquared
Stanzilla Sep 28, 2019
221fb06
Merge branch 'canary' into xterm4
Stanzilla Sep 28, 2019
fce3780
fix resizing issue
Stanzilla Sep 28, 2019
70f6272
Revert "fix resizing issue"
Stanzilla Sep 28, 2019
0df78d8
apply review suggestions
Stanzilla Sep 28, 2019
2e45fbe
change so all addons have separate instances for each terminal
Stanzilla Sep 30, 2019
0ab2c4c
update yarn-standalone to 1.19
Stanzilla Sep 30, 2019
8669086
Merge branch 'canary' into xterm4
Stanzilla Oct 3, 2019
05358b9
fix resize problem of split view
Stanzilla Oct 3, 2019
81377a4
apply review feedback
Stanzilla Oct 4, 2019
3955a1c
fix lint
Stanzilla Oct 4, 2019
6b9a9e7
add name and version to package.json
Stanzilla Oct 4, 2019
9b5f87e
address review feedback
Stanzilla Oct 4, 2019
0183835
more review feedback
Stanzilla Oct 4, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"lodash": "4.17.13",
"mkdirp": "0.5.1",
"ms": "2.1.1",
"node-pty": "0.8.1",
"node-pty": "0.9.0-beta26",
"os-locale": "3.1.0",
"parse-url": "3.0.2",
"queue": "4.4.2",
Expand Down
18 changes: 9 additions & 9 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,10 @@ ms@2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"

nan@2.12.1:
version "2.12.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.12.1.tgz#7b1aa193e9aa86057e3c7bbd0ac448e770925552"
integrity sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==
nan@^2.14.0:
version "2.14.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c"
integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==

nice-try@^1.0.4:
version "1.0.5"
Expand All @@ -394,12 +394,12 @@ node-fetch@^1.0.1:
encoding "^0.1.11"
is-stream "^1.0.1"

node-pty@0.8.1:
version "0.8.1"
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.8.1.tgz#94b457bec013e7a09b8d9141f63b0787fa25c23f"
integrity sha512-j+/g0Q5dR+vkELclpJpz32HcS3O/3EdPSGPvDXJZVJQLCvgG0toEbfmymxAEyQyZEpaoKHAcoL+PvKM+4N9nlw==
node-pty@0.9.0-beta26:
version "0.9.0-beta26"
resolved "https://registry.yarnpkg.com/node-pty/-/node-pty-0.9.0-beta26.tgz#7be9381d7510a51e6030764e5a13105850fac8a2"
integrity sha512-xf9JLOGPYPftY5g2sU7YaTXkjRp94uf9SRVBORhRVHfyIIM/C4A8VBQIrWl9a2hfayOsyr9qVOXQ7INAjU6ywg==
dependencies:
nan "2.12.1"
nan "^2.14.0"

normalize-url@^1.9.1:
version "1.9.1"
Expand Down
1 change: 0 additions & 1 deletion lib/components/term-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class TermGroup_ extends React.PureComponent {
onResize: this.bind(this.props.onResize, null, uid),
onTitle: this.bind(this.props.onTitle, null, uid),
onData: this.bind(this.props.onData, null, uid),
onURLAbort: this.bind(this.props.onURLAbort, null, uid),
toggleSearch: this.bind(this.props.toggleSearch, null, uid),
onContextMenu: this.bind(this.props.onContextMenu, null, uid),
borderColor: this.props.borderColor,
Expand Down
41 changes: 23 additions & 18 deletions lib/components/term.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* global Blob,URL,requestAnimationFrame,ResizeObserver */
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 * as search from 'xterm/lib/addons/search';
import * as winptyCompat from 'xterm/lib/addons/winptyCompat/winptyCompat';
import {FitAddon} from 'xterm-addon-fit';
import {WebLinksAddon} from 'xterm-addon-web-links';
import {SearchAddon} from 'xterm-addon-search';
import {WebglAddon} from 'xterm-addon-webgl';
import {clipboard} from 'electron';
import * as Color from 'color';
import terms from '../terms';
import processClipboard from '../utils/paste';
import SearchBox from './searchBox';

Terminal.applyAddon(fit);
Terminal.applyAddon(webLinks);
Terminal.applyAddon(winptyCompat);
Terminal.applyAddon(search);
const fitAddon = new FitAddon();
const webLinksAddon = new WebLinksAddon();
const searchAddon = new SearchAddon();
const webGlAddon = new WebglAddon();

// map old hterm constants to xterm.js
const CURSOR_STYLES = {
Expand Down Expand Up @@ -144,38 +144,43 @@ export default class Term extends React.PureComponent {

if (!props.term) {
this.term.attachCustomKeyEventHandler(this.keyboardHandler);
this.term.loadAddon(fitAddon);
this.term.loadAddon(searchAddon);
this.term.loadAddon(webLinksAddon);
this.term.open(this.termRef);
this.term.webLinksInit();
this.term.winptyCompatInit();
fitAddon.fit();
this.term.loadAddon(webGlAddon);
// this.term.webLinksInit();
// this.term.winptyCompatInit();
Stanzilla marked this conversation as resolved.
Show resolved Hide resolved
}

if (this.props.isTermActive) {
this.term.focus();
}

if (props.onTitle) {
this.disposableListeners.push(this.term.addDisposableListener('title', props.onTitle));
this.disposableListeners.push(this.term.onTitleChange(props.onTitle));
}

if (props.onActive) {
this.disposableListeners.push(this.term.addDisposableListener('focus', props.onActive));
}
// if (props.onActive) {
// this.disposableListeners.push(this.term.addDisposableListener('focus', props.onActive));
Stanzilla marked this conversation as resolved.
Show resolved Hide resolved
// }

if (props.onData) {
this.disposableListeners.push(this.term.addDisposableListener('data', props.onData));
this.disposableListeners.push(this.term.onData(props.onData));
}

if (props.onResize) {
this.disposableListeners.push(
this.term.addDisposableListener('resize', ({cols, rows}) => {
this.term.onResize(({cols, rows}) => {
props.onResize(cols, rows);
})
);
}

if (props.onCursorMove) {
this.disposableListeners.push(
this.term.addDisposableListener('cursormove', () => {
this.term.onCursorMove(() => {
const cursorFrame = {
x: this.term._core.buffer.x * this.term._core.renderer.dimensions.actualCellWidth,
y: this.term._core.buffer.y * this.term._core.renderer.dimensions.actualCellHeight,
Expand Down Expand Up @@ -278,7 +283,7 @@ export default class Term extends React.PureComponent {
if (!this.termWrapperRef) {
return;
}
this.term.fit();
fitAddon.fit();
}

keyboardHandler(e) {
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@
"stylis": "3.5.0",
"uuid": "3.1.0",
"webpack-cli": "3.3.7",
"xterm": "https://registry.npmjs.org/@zeit/xterm/-/xterm-3.12.0-1.tgz"
"xterm": "4.0.2",
"xterm-addon-fit": "^0.2.0",
Stanzilla marked this conversation as resolved.
Show resolved Hide resolved
"xterm-addon-search": "0.3.0-beta2",
"xterm-addon-webgl": "0.3.0-beta2",
"xterm-addon-web-links": "0.3.0-beta2"
},
"devDependencies": {
"@babel/cli": "7.5.5",
Expand Down
27 changes: 24 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8672,9 +8672,30 @@ xtend@~2.1.1:
dependencies:
object-keys "~0.4.0"

"xterm@https://registry.npmjs.org/@zeit/xterm/-/xterm-3.12.0-1.tgz":
version "3.12.0-1"
resolved "https://registry.npmjs.org/@zeit/xterm/-/xterm-3.12.0-1.tgz#df7bb98fe53d621c0bfd559d0ae87be401c8f246"
xterm-addon-fit@^0.2.0:
version "0.2.1"
resolved "https://registry.yarnpkg.com/xterm-addon-fit/-/xterm-addon-fit-0.2.1.tgz#353f43921eb78e3f9ad3f3afbb14e7ac183ca738"
integrity sha512-BlR57O3t1/bmVcnS81bn9ZnNf+GiGNbeXdNUKSBa9tKEwNUMcU3S+KFLIRv7rm1Ty0D5pMOu0vbz/RDorKRwKQ==

xterm-addon-search@0.3.0-beta2:
version "0.3.0-beta2"
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.3.0-beta2.tgz#d674a9f3d34c3bf2706f82040180e7c0c61ab830"
integrity sha512-2MCa/Tr7sgX7DnKqOxIz5w2I12cgH+r5/meRwCbsUQFpJBLqjUSjptUl4UDW7pIn7/p8MIrTnMp76tCYKCiJzQ==

xterm-addon-web-links@0.3.0-beta2:
version "0.3.0-beta2"
resolved "https://registry.yarnpkg.com/xterm-addon-web-links/-/xterm-addon-web-links-0.3.0-beta2.tgz#87fcf7638f1ee5d2b2e0d4ec06ac7f0d4165e8d6"
integrity sha512-Y9gyh8lNlglDMQgIIvD/P/vTzEatMWrr5Mxh3pLnTf+8o2vJPcxLrq58uKlQKI+PwTH1ClcIbX+GgS2jRkWDuw==

xterm-addon-webgl@0.3.0-beta2:
version "0.3.0-beta2"
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.3.0-beta2.tgz#287aedeb30de9f0a2709a3351c09d769b4a8ebbd"
integrity sha512-o1ZLGJquh0/Eoq+DF6VN5EqZM9Lm7Xq+DE3mSiYxsWSW+2G8SlSmBnSE5qWdLpj9RGV1orH0NIUzpvGCoICvSA==

xterm@4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/xterm/-/xterm-4.0.2.tgz#c6a1b9586c0786627625e2ee9e78ad519dbc8c99"
integrity sha512-NIr11b6C782TZznU8e6K/IMfmwlWMWRI6ba9GEDG9uX25SadkpjoMnzvxOS0Z/15sfrbn0rghPiarGDmmP0uhQ==

y18n@^3.2.1:
version "3.2.1"
Expand Down