From 429710328a4861847dee99a5a31a9adcb8981ee0 Mon Sep 17 00:00:00 2001 From: CHaBou Date: Sun, 18 Mar 2018 00:24:26 +0100 Subject: [PATCH] Integrate xterm v3.2 (#2768) * Add xterm3.2 Fixes #2751 --- lib/components/split-pane.js | 2 +- lib/components/style-sheet.js | 33 ++++++++++++++++++++++ package.json | 52 ++++++++++------------------------- yarn.lock | 6 ++-- 4 files changed, 52 insertions(+), 41 deletions(-) diff --git a/lib/components/split-pane.js b/lib/components/split-pane.js index 706e1443..6f41fdc8 100644 --- a/lib/components/split-pane.js +++ b/lib/components/split-pane.js @@ -106,7 +106,7 @@ export default class SplitPane extends React.PureComponent { render() { const children = this.props.children; const {direction, borderColor} = this.props; - const sizeProperty = direction === 'horizontal' ? 'height' : 'flexBasis'; + const sizeProperty = direction === 'horizontal' ? 'height' : 'width'; let {sizes} = this.props; if (!sizes) { // workaround for the fact that if we don't specify diff --git a/lib/components/style-sheet.js b/lib/components/style-sheet.js index 0be6951a..ee97b53e 100644 --- a/lib/components/style-sheet.js +++ b/lib/components/style-sheet.js @@ -66,6 +66,16 @@ export default class StyleSheet extends React.PureComponent { /* On OS X this is required in order for the scroll bar to appear fully opaque */ background-color: ${backgroundColor}; overflow-y: scroll; + cursor: default; + position: absolute; + right: 0; + left: 0; + top: 0; + bottom: 0; + } + + .xterm .xterm-screen { + position: relative; } .xterm canvas { @@ -94,6 +104,29 @@ export default class StyleSheet extends React.PureComponent { cursor: text; } + .xterm .xterm-accessibility, + .xterm .xterm-message { + position: absolute; + left: 0; + top: 0; + bottom: 0; + right: 0; + z-index: 100; + color: transparent; + } + + .xterm .xterm-accessibility-tree:focus [id^='xterm-active-item-'] { + outline: 1px solid #f80; + } + + .xterm .live-region { + position: absolute; + left: -9999px; + width: 1px; + height: 1px; + overflow: hidden; + } + ::-webkit-scrollbar { width: 5px; } diff --git a/package.json b/package.json index 6588612a..379d2487 100644 --- a/package.json +++ b/package.json @@ -12,19 +12,14 @@ "prepush": "yarn test", "postinstall": "electron-builder install-app-deps && yarn run rebuild-node-pty && yarn --cwd node_modules/xterm", "rebuild-node-pty": "electron-rebuild -f -w app/node_modules/node-pty -m app", - "dist": "yarn run build && cross-env BABEL_ENV=production babel --out-file app/renderer/bundle.js --no-comments --minified app/renderer/bundle.js && build", - "clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer" + "dist": + "yarn run build && cross-env BABEL_ENV=production babel --out-file app/renderer/bundle.js --no-comments --minified app/renderer/bundle.js && build", + "clean": + "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer" }, "eslintConfig": { - "plugins": [ - "react", - "prettier" - ], - "extends": [ - "eslint:recommended", - "plugin:react/recommended", - "prettier" - ], + "plugins": ["react", "prettier"], + "extends": ["eslint:recommended", "plugin:react/recommended", "prettier"], "parserOptions": { "ecmaVersion": 8, "sourceType": "module", @@ -41,10 +36,7 @@ "node": true }, "rules": { - "func-names": [ - "error", - "as-needed" - ], + "func-names": ["error", "as-needed"], "no-shadow": "error", "no-extra-semi": 0, "react/prop-types": 0, @@ -90,9 +82,7 @@ ] }, "babel": { - "presets": [ - "react" - ], + "presets": ["react"], "plugins": [ [ "styled-jsx/babel", @@ -137,9 +127,7 @@ { "from": "./build/${os}/", "to": "./bin/", - "filter": [ - "hyper*" - ] + "filter": ["hyper*"] } ], "linux": { @@ -147,28 +135,20 @@ "target": [ { "target": "deb", - "arch": [ - "x64" - ] + "arch": ["x64"] }, { "target": "AppImage", - "arch": [ - "x64" - ] + "arch": ["x64"] }, { "target": "rpm", - "arch": [ - "x64" - ] + "arch": ["x64"] } ] }, "win": { - "target": [ - "squirrel" - ] + "target": ["squirrel"] }, "mac": { "category": "public.app-category.developer-tools", @@ -182,9 +162,7 @@ }, "protocols": { "name": "ssh URL", - "schemes": [ - "ssh" - ] + "schemes": ["ssh"] } }, "license": "MIT", @@ -221,7 +199,7 @@ "styled-jsx": "2.2.6", "stylis": "3.5.0", "uuid": "3.1.0", - "xterm": "chabou/xterm.js#b9dac85" + "xterm": "3.2.0" }, "devDependencies": { "ava": "0.25.0", diff --git a/yarn.lock b/yarn.lock index 38dd65d3..a2c23565 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6693,9 +6693,9 @@ xtend@~2.1.1: dependencies: object-keys "~0.4.0" -xterm@chabou/xterm.js#b9dac85: - version "3.0.0-hyper.2" - resolved "https://codeload.github.com/chabou/xterm.js/tar.gz/b9dac85cf33bdc19c31ac0ba223c5f2a3b11e6d2" +xterm@3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-3.2.0.tgz#da50f54a83d81463c0a2c9f2e0a5d14d3867df02" y18n@^3.2.1: version "3.2.1"