Compare commits

...
655 Commits
Author SHA1 Message Date
Daniel Imms 3504e2ebd5 Merge pull request #3084 from Tyriar/release490
v4.9.0
2020-09-08 16:36:32 -07:00
Daniel Imms 6c22e3df6b v4.9.0 2020-09-08 09:35:05 -07:00
Daniel Imms 33bf765b80 Merge pull request #3067 from mmis1000/fix/addon-serialize-cjk-handling
Fix cjk handling in SerializeAddon
2020-09-08 06:25:40 -07:00
Daniel Imms d960793f0c Merge pull request #3062 from IllusionMH/numeric-fontWeight-3051
Add number type to fontWeight & fontWeightBold options
2020-09-08 06:21:38 -07:00
Daniel Imms 4975f389ff Use assert over expect 2020-09-08 06:18:37 -07:00
Daniel Imms 4649ad7e7b Merge pull request #3077 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-4.0.0
Bump @typescript-eslint/eslint-plugin from 3.10.1 to 4.0.0
2020-09-07 11:32:28 -07:00
dependabot-preview[bot] a425c325b7 Bump @typescript-eslint/eslint-plugin from 3.10.1 to 4.0.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 3.10.1 to 4.0.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v4.0.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-07 18:21:07 +00:00
Daniel Imms c77025b18c Merge pull request #3079 from xtermjs/dependabot/npm_and_yarn/eslint-7.8.1
Bump eslint from 7.7.0 to 7.8.1
2020-09-07 11:19:18 -07:00
Daniel Imms c6abc85810 Merge pull request #3081 from Tyriar/3069_multiline_selection
Fix rendering of multi-line selection when only top row is visible
2020-09-07 09:59:11 -07:00
Daniel Imms 710223ab27 Merge pull request #3082 from Tyriar/3080_selection_canvas
Fix last/first line of selection sometimes not drawing
2020-09-07 09:57:58 -07:00
Daniel Imms ca9df42a73 Fix last/first line of selection sometimes not drawing
The last ydisp wasn't being updated on early exits.

Fixes #3080
2020-09-07 09:46:43 -07:00
Daniel Imms 9f033cb1d2 Fix rendering of multi-line selection when only top row is visible
Fixes #3069
2020-09-07 09:40:02 -07:00
dependabot-preview[bot] 9613f36280 Bump eslint from 7.7.0 to 7.8.1
Bumps [eslint](https://github.com/eslint/eslint) from 7.7.0 to 7.8.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.7.0...v7.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-07 16:04:56 +00:00
Daniel Imms 41673f2c20 Merge pull request #3078 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.22
Bump @types/webpack from 4.41.21 to 4.41.22
2020-09-07 09:02:56 -07:00
dependabot-preview[bot] 6c98f82ffe Bump @types/webpack from 4.41.21 to 4.41.22
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.21 to 4.41.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-07 15:51:27 +00:00
Daniel Imms a90ef52bda Merge pull request #3076 from xtermjs/dependabot/npm_and_yarn/types/jsdom-16.2.4
Bump @types/jsdom from 16.2.3 to 16.2.4
2020-09-07 08:49:49 -07:00
dependabot-preview[bot] 86884d2d88 Bump @types/jsdom from 16.2.3 to 16.2.4
Bumps [@types/jsdom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsdom) from 16.2.3 to 16.2.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsdom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-07 15:32:12 +00:00
Daniel Imms 47c486e1be Merge pull request #3075 from Tyriar/clearTextureAtlas
Expose API to clear texture atlas
2020-09-06 15:16:51 -07:00
Daniel Imms e07b9684bb Expose API to clear texture atlas
Using canvases on Electron (and plain Chromium I believe), when resuming
from sleep the graphics card may release the texture which results in
the terminal display and char atlas being corrupt. This API allows the
consumer to clear the texture atlas right after resuming, atlas warm up
is not done to simplify this process because the fact that atlases are
shared between multiple terminals complicates this.

Related microsoft/vscode#69665
2020-09-06 14:50:09 -07:00
Daniel Imms 10fb48869e Merge pull request #3073 from Tyriar/tyriar/link_dispose
Support ILink.dispose
2020-09-04 22:11:49 -07:00
Daniel Imms 9f3746a3a1 Improve test case 2020-09-04 22:04:59 -07:00
Daniel Imms 50fc84f7d7 Support ILink.dispose
When displaying hovers/overlays using the link provider API currently
it's not possible to know when unused links are no longer cached in
xterm.js which can result in leaked event listeners.
2020-09-04 21:57:51 -07:00
IllusionMH 3e0f0331b3 Add tests for fontWeight normalization 2020-09-05 00:48:12 +03:00
IllusionMH b918f0d34a Use FontWeight as return type 2020-09-04 23:35:38 +03:00
IllusionMH f0e3159ece Add number type to fontWeight & fontWeightBold options 2020-09-04 23:08:34 +03:00
Daniel Imms ecfc7336c5 Merge pull request #3072 from Tyriar/deps2
Upgrade serialize-javascript
2020-09-04 12:53:34 -07:00
Daniel Imms aec8c68bf6 Upgrade serialize-javascript 2020-09-04 12:08:26 -07:00
mmis1000 0fb63561fb Fix cjk handling in SerializeAddon 2020-09-03 13:23:01 +08:00
Daniel Imms 106ea62b4c Merge pull request #3064 from IllusionMH/validate-constructor-options-3063
Validate constructor options
2020-09-02 08:36:04 -07:00
IllusionMH e73bf11849 Log error instead of throwing. Move test to service. 2020-09-01 22:20:37 +03:00
IllusionMH 8d9eda5d0a Add test 2020-09-01 02:37:25 +03:00
IllusionMH cf0b7ce2d0 Validate constructor options 2020-09-01 01:03:49 +03:00
Daniel Imms 60419a7cc6 Merge pull request #3061 from xtermjs/dependabot/npm_and_yarn/mocha-8.1.3
Bump mocha from 8.1.1 to 8.1.3
2020-08-31 12:46:29 -07:00
dependabot-preview[bot] 1b12b2d15d Bump mocha from 8.1.1 to 8.1.3
Bumps [mocha](https://github.com/mochajs/mocha) from 8.1.1 to 8.1.3.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.1.1...v8.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-31 16:20:40 +00:00
Daniel Imms b5844990c4 Merge pull request #3060 from xtermjs/dependabot/npm_and_yarn/source-map-loader-1.1.0
Bump source-map-loader from 1.0.2 to 1.1.0
2020-08-31 09:18:56 -07:00
dependabot-preview[bot] 2652768310 Bump source-map-loader from 1.0.2 to 1.1.0
Bumps [source-map-loader](https://github.com/webpack-contrib/source-map-loader) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/webpack-contrib/source-map-loader/releases)
- [Changelog](https://github.com/webpack-contrib/source-map-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/source-map-loader/compare/v1.0.2...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-31 16:12:37 +00:00
Daniel Imms 1f8a6bece4 Merge pull request #3059 from Tyriar/ts4
Upgrade to typescript 4
2020-08-29 09:39:53 -07:00
Daniel Imms 8817ddf020 Remove empty deps 2020-08-28 20:58:06 -07:00
Daniel Imms 5d61956aff Get rid of removed typescript-eslint rules 2020-08-28 20:41:50 -07:00
Daniel Imms 83ece031a7 typescript@4.0 2020-08-28 19:35:26 -07:00
Daniel Imms 566fad4108 Merge pull request #3043 from xtermjs/dependabot/npm_and_yarn/types/mocha-8.0.3
Bump @types/mocha from 8.0.2 to 8.0.3
2020-08-24 12:55:01 -07:00
Daniel Imms a4aa111eaa Merge pull request #3052 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.3
Bump ts-loader from 8.0.2 to 8.0.3
2020-08-24 12:54:45 -07:00
dependabot-preview[bot] f6ed184d49 Bump ts-loader from 8.0.2 to 8.0.3
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.2 to 8.0.3.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v8.0.2...v8.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-24 15:59:17 +00:00
Daniel Imms c1820501a8 Merge pull request #3046 from Intervue/patch-1
Update README.md to add intervue
2020-08-24 06:40:21 -07:00
dependabot-preview[bot] c7f50c5c28 Bump @types/mocha from 8.0.2 to 8.0.3
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.2 to 8.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-24 13:21:31 +00:00
Daniel Imms 371c96e1da Merge pull request #3048 from xtermjs/dependabot/npm_and_yarn/source-map-loader-1.0.2
Bump source-map-loader from 1.0.1 to 1.0.2
2020-08-24 06:19:46 -07:00
dependabot-preview[bot] 11bd8b7eb1 Bump source-map-loader from 1.0.1 to 1.0.2
Bumps [source-map-loader](https://github.com/webpack-contrib/source-map-loader) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/webpack-contrib/source-map-loader/releases)
- [Changelog](https://github.com/webpack-contrib/source-map-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/source-map-loader/compare/v1.0.1...v1.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-21 15:13:37 +00:00
Intervue cb418eb8d1 Update README.md 2020-08-20 18:18:48 +05:30
Daniel Imms f811fb937e Merge pull request #3040 from akshaykmr/patch-1
readme: adds TeleType cli-tool to Real-world uses section
2020-08-13 06:02:05 -07:00
Akshay Kumar 2a6ccb8009 adds TeleType cli-tool to Real-world uses section 2020-08-13 16:49:25 +05:30
Daniel Imms bf49f99810 Merge pull request #3039 from xtermjs/dependabot/npm_and_yarn/types/mocha-8.0.2
Bump @types/mocha from 8.0.1 to 8.0.2
2020-08-12 08:38:04 -07:00
dependabot-preview[bot] e027a5f97b Bump @types/mocha from 8.0.1 to 8.0.2
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-12 15:08:48 +00:00
Daniel Imms d1ecb571d8 Merge pull request #3033 from xtermjs/dependabot/npm_and_yarn/mocha-8.1.1
Bump mocha from 8.1.0 to 8.1.1
2020-08-10 13:37:03 -07:00
dependabot-preview[bot] 1e3937830f Bump mocha from 8.1.0 to 8.1.1
Bumps [mocha](https://github.com/mochajs/mocha) from 8.1.0 to 8.1.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.1.0...v8.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-10 14:13:23 +00:00
Daniel Imms 38b2fcb460 Merge pull request #3035 from xtermjs/dependabot/npm_and_yarn/jsdom-16.4.0
Bump jsdom from 16.3.0 to 16.4.0
2020-08-10 07:11:37 -07:00
dependabot-preview[bot] c7ed42226f Bump jsdom from 16.3.0 to 16.4.0
Bumps [jsdom](https://github.com/jsdom/jsdom) from 16.3.0 to 16.4.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/16.3.0...16.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-10 11:49:09 +00:00
Daniel Imms d0dfad4c92 Merge pull request #3031 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.2
Bump ts-loader from 8.0.1 to 8.0.2
2020-08-03 06:40:43 -07:00
dependabot-preview[bot] c66123b91f Bump ts-loader from 8.0.1 to 8.0.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v8.0.1...v8.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 13:31:14 +00:00
Daniel Imms 8d912e891e Merge pull request #3028 from xtermjs/dependabot/npm_and_yarn/types/mocha-8.0.1
Bump @types/mocha from 8.0.0 to 8.0.1
2020-07-31 19:28:13 -07:00
dependabot-preview[bot] 23fd6b8e60 Bump @types/mocha from 8.0.0 to 8.0.1
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-31 22:06:10 +00:00
Daniel Imms 0320e6e22a Merge pull request #3027 from xtermjs/dependabot/npm_and_yarn/mocha-8.1.0
Bump mocha from 8.0.1 to 8.1.0
2020-07-31 15:04:28 -07:00
dependabot-preview[bot] 9e70d8fc84 Bump mocha from 8.0.1 to 8.1.0
Bumps [mocha](https://github.com/mochajs/mocha) from 8.0.1 to 8.1.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.0.1...v8.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-31 21:26:19 +00:00
Daniel Imms 27e28eccac Merge pull request #3026 from Tyriar/docker
Remove docker from root
2020-07-31 06:31:58 -07:00
Daniel Imms 0cb0313fc9 Remove docker from root
We will keep the devcontainer as that is something we want to continue to
support.

Fixes #3000
2020-07-31 06:23:05 -07:00
Daniel Imms 94a34c3703 Merge pull request #3023 from xtermjs/dependabot/npm_and_yarn/elliptic-6.5.3
[Security] Bump elliptic from 6.5.2 to 6.5.3
2020-07-30 07:03:40 -07:00
dependabot-preview[bot] c04c836f12 [Security] Bump elliptic from 6.5.2 to 6.5.3
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3. **This update includes a security fix.**
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-30 13:52:44 +00:00
Daniel Imms c5a9d2c52d Merge pull request #3024 from xtermjs/dependabot/npm_and_yarn/webpack-4.44.1
Bump webpack from 4.44.0 to 4.44.1
2020-07-30 06:51:23 -07:00
dependabot-preview[bot] c0050672ab Bump webpack from 4.44.0 to 4.44.1
Bumps [webpack](https://github.com/webpack/webpack) from 4.44.0 to 4.44.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.44.0...v4.44.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-30 11:23:30 +00:00
Daniel Imms 705f94518f Merge pull request #3021 from sergeichestakov/add-replit
Add Repl.it to Real-world uses
2020-07-29 13:46:53 -07:00
Sergei Chestakov a096217526 Merge branch 'master' into add-replit 2020-07-29 13:11:49 -07:00
sergeichestakov 795768667e Add Repl.it to Real-world uses 2020-07-29 13:08:50 -07:00
Daniel Imms 5e9a8c6321 Merge pull request #3020 from Tyriar/vsc98918
Use document role instead of list
2020-07-29 05:34:06 -07:00
Daniel Imms 03df0565bd Use document role instead of list
See microsoft/vscode#98918
2020-07-29 05:29:30 -07:00
Daniel Imms 3ef6856b36 Merge pull request #3018 from xtermjs/dependabot/npm_and_yarn/webpack-4.44.0
Bump webpack from 4.43.0 to 4.44.0
2020-07-27 05:28:20 -07:00
dependabot-preview[bot] 48e9f33263 Bump webpack from 4.43.0 to 4.44.0
Bumps [webpack](https://github.com/webpack/webpack) from 4.43.0 to 4.44.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.43.0...v4.44.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-27 07:54:25 +00:00
Daniel Imms 9559dd47da Merge pull request #3017 from xtermjs/dependabot/npm_and_yarn/types/chai-4.2.12
Bump @types/chai from 4.2.11 to 4.2.12
2020-07-24 05:23:59 -07:00
dependabot-preview[bot] ad7f8c303c Bump @types/chai from 4.2.11 to 4.2.12
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.11 to 4.2.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-24 07:41:38 +00:00
Daniel Imms edb7a0edda Merge pull request #3015 from xtermjs/dependabot/npm_and_yarn/typescript-3.9.7
Bump typescript from 3.9.6 to 3.9.7
2020-07-17 06:22:42 -07:00
dependabot-preview[bot] aedcbba211 Bump typescript from 3.9.6 to 3.9.7
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.6 to 3.9.7.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.6...v3.9.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-17 07:43:13 +00:00
Daniel Imms ab63b51681 Merge pull request #3013 from xtermjs/dependabot/npm_and_yarn/lodash-4.17.19
[Security] Bump lodash from 4.17.15 to 4.17.19
2020-07-16 05:28:25 -07:00
dependabot-preview[bot] 63f5d0c266 [Security] Bump lodash from 4.17.15 to 4.17.19
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19. **This update includes a security fix.**
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-16 07:46:50 +00:00
Daniel Imms 349ebd3846 Merge pull request #3012 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.1
Bump ts-loader from 8.0.0 to 8.0.1
2020-07-15 05:06:55 -07:00
dependabot-preview[bot] ce496bc389 Bump ts-loader from 8.0.0 to 8.0.1
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-15 07:36:40 +00:00
Daniel Imms be1af82ee0 Merge pull request #3010 from Tyriar/mocha8
@types/mocha@8
2020-07-13 06:38:03 -07:00
Daniel Imms 11bfb03add @types/mocha@8 2020-07-13 06:21:25 -07:00
Daniel Imms b89d4b102e Merge pull request #3008 from andrew-schlackman/fix-renderer-pause2
fix renderer pause again with handling of undefined
2020-07-13 06:02:48 -07:00
Andrew Schlackman 0abd121653 fix renderer pause again with handling of undefined 2020-07-12 10:07:47 -04:00
Daniel Imms eeb095b095 Merge pull request #3007 from xtermjs/Tyriar-patch-1
v4.8.1
2020-07-10 12:22:21 -07:00
Daniel Imms 266a289520 Update package.json 2020-07-10 12:21:15 -07:00
Daniel Imms 3c1d6b575a Merge pull request #3005 from Tyriar/fix_passive
Indicate non-passive scroll events for viewport
2020-07-10 12:19:12 -07:00
Daniel Imms bd08862074 Merge pull request #3006 from Tyriar/revert
Revert "fix renderer pausing inadvertently in some cases"
2020-07-10 12:18:36 -07:00
Daniel Imms 70e0c0385a Revert "fix renderer pausing inadvertently in some cases"
This reverts commit 5738f4545f.
2020-07-10 12:14:59 -07:00
Daniel Imms 454cf1fb26 Indicate non-passive scroll events for viewport
Fixes #3004
2020-07-10 12:13:26 -07:00
Daniel Imms 6d1029b3c7 Merge pull request #3002 from xtermjs/Tyriar-patch-1
v4.8.0
2020-07-10 06:35:26 -07:00
Daniel Imms f13f8fb38a v4.8.0 2020-07-10 06:23:36 -07:00
Daniel Imms 2447064604 Merge pull request #2996 from jeanp413/fix-sync-textarea
Sync textarea with cursor
2020-07-10 06:19:18 -07:00
Daniel Imms 85a2589c0c Merge pull request #2999 from andrew-schlackman/fix-renderer-pause
fix renderer pausing inadvertently in some cases
2020-07-10 06:11:01 -07:00
Daniel Imms 2c821155ae Merge pull request #3001 from xtermjs/dependabot/npm_and_yarn/jsdom-16.3.0
Bump jsdom from 16.2.2 to 16.3.0
2020-07-10 05:18:20 -07:00
dependabot-preview[bot] c040be1ad2 Bump jsdom from 16.2.2 to 16.3.0
Bumps [jsdom](https://github.com/jsdom/jsdom) from 16.2.2 to 16.3.0.
- [Release notes](https://github.com/jsdom/jsdom/releases)
- [Changelog](https://github.com/jsdom/jsdom/blob/master/Changelog.md)
- [Commits](https://github.com/jsdom/jsdom/compare/16.2.2...16.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-10 07:44:47 +00:00
jeanp413 2b91bb83fa 💄 2020-07-09 20:35:01 -05:00
Andrew Schlackman 5738f4545f fix renderer pausing inadvertently in some cases 2020-07-09 16:20:37 -04:00
Daniel Imms 01432a31d6 Merge pull request #2997 from Tyriar/deps
Update vulnerable dev dependencies
2020-07-09 06:36:02 -07:00
Daniel Imms 798a7fd52e sinon@6.3.5
Fixes vulnerable just-extend
2020-07-09 06:22:47 -07:00
Daniel Imms cee121f414 mkdirp@0.5.5
Updates vulnerable minimist
2020-07-09 06:21:31 -07:00
Daniel Imms a4fe871865 Merge pull request #2995 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.0
Bump ts-loader from 7.0.5 to 8.0.0
2020-07-09 05:16:47 -07:00
jeanp413 d85c80df95 💄 2020-07-09 03:59:59 -05:00
jeanp413 95d01dec52 Sync textarea with cursor. Fixes #2598 2020-07-09 03:56:40 -05:00
dependabot-preview[bot] 1506097faa Bump ts-loader from 7.0.5 to 8.0.0
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.5 to 8.0.0.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.5...v8.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-09 07:38:24 +00:00
Daniel Imms dc541c2664 Merge pull request #2992 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.21
Bump @types/webpack from 4.41.20 to 4.41.21
2020-07-08 06:13:24 -07:00
dependabot-preview[bot] 694da35f99 Bump @types/webpack from 4.41.20 to 4.41.21
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.20 to 4.41.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-08 13:02:38 +00:00
Daniel Imms 3c7697420c Merge pull request #2993 from LabhanshAgrawal/ligatures
Bump font-ligatures to 1.3.3
2020-07-08 06:01:00 -07:00
Labhansh Agrawal 4a407dbe76 Bump font-ligatures to 1.3.3 2020-07-08 16:57:37 +05:30
Daniel Imms 2479660028 Merge pull request #2986 from xtermjs/dependabot/npm_and_yarn/typescript-3.9.6
Bump typescript from 3.9.5 to 3.9.6
2020-07-07 09:57:02 -07:00
dependabot-preview[bot] 612b922eeb Bump typescript from 3.9.5 to 3.9.6
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.5 to 3.9.6.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-07 13:19:44 +00:00
Daniel Imms ea2336b68e Merge pull request #2989 from xtermjs/dependabot/npm_and_yarn/ws-7.3.1
Bump ws from 7.3.0 to 7.3.1
2020-07-07 06:18:04 -07:00
dependabot-preview[bot] 0c953a88c3 Bump ws from 7.3.0 to 7.3.1
Bumps [ws](https://github.com/websockets/ws) from 7.3.0 to 7.3.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.3.0...7.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-07 13:01:07 +00:00
Daniel Imms a551c69e9e Merge pull request #2991 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.20
Bump @types/webpack from 4.41.18 to 4.41.20
2020-07-07 05:59:27 -07:00
Daniel Imms 7e7be15ab8 Merge pull request #2990 from xtermjs/dependabot/npm_and_yarn/types/glob-7.1.3
Bump @types/glob from 7.1.2 to 7.1.3
2020-07-07 05:59:14 -07:00
dependabot-preview[bot] cb0242782a Bump @types/webpack from 4.41.18 to 4.41.20
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.18 to 4.41.20.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-07 07:53:25 +00:00
dependabot-preview[bot] 04655b1db5 Bump @types/glob from 7.1.2 to 7.1.3
Bumps [@types/glob](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/glob) from 7.1.2 to 7.1.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/glob)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-07 07:52:51 +00:00
Daniel Imms 7ce47c474a Merge pull request #2985 from xtermjs/dependabot/npm_and_yarn/source-map-loader-1.0.1
Bump source-map-loader from 1.0.0 to 1.0.1
2020-07-01 05:30:37 -07:00
dependabot-preview[bot] b6259d3e7e Bump source-map-loader from 1.0.0 to 1.0.1
Bumps [source-map-loader](https://github.com/webpack-contrib/source-map-loader) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/webpack-contrib/source-map-loader/releases)
- [Changelog](https://github.com/webpack-contrib/source-map-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/source-map-loader/compare/v1.0.0...v1.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-07-01 07:48:02 +00:00
Daniel Imms 3e6bcc09b3 Merge pull request #2984 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.6
Bump @types/ws from 7.2.5 to 7.2.6
2020-06-30 05:20:23 -07:00
dependabot-preview[bot] fbc34b649c Bump @types/ws from 7.2.5 to 7.2.6
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.5 to 7.2.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-30 07:41:08 +00:00
Daniel Imms 4a0cb00450 Merge pull request #2982 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.18
Bump @types/webpack from 4.41.17 to 4.41.18
2020-06-26 08:25:54 -07:00
dependabot-preview[bot] 0cf32d9b4d Bump @types/webpack from 4.41.17 to 4.41.18
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.17 to 4.41.18.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-26 07:45:33 +00:00
Daniel Imms f6bf7dcd92 Merge pull request #2977 from xtermjs/dependabot/npm_and_yarn/webpack-cli-3.3.12
Bump webpack-cli from 3.3.11 to 3.3.12
2020-06-19 04:43:14 -07:00
dependabot-preview[bot] 4f59d1561a Bump webpack-cli from 3.3.11 to 3.3.12
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.11 to 3.3.12.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/v3.3.12/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.11...v3.3.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-19 07:45:20 +00:00
Daniel Imms 86af9aa59d Merge pull request #2974 from Tyriar/r470
v4.7.0
2020-06-11 09:46:59 -07:00
Daniel Imms 1cd4f79347 v4.7.0 2020-06-11 09:27:41 -07:00
Daniel Imms f928c7e156 Merge pull request #2973 from daniel-j-davis/fix_2617
Fix getSelection not working sometimes for single character selections
2020-06-11 06:29:20 -07:00
Daniel Davis 0e6611b528 onSelectionChange() not getting called for single character selection #2617 2020-06-11 14:12:42 +01:00
Daniel Imms afc39106c3 Merge pull request #2931 from DavidSichau/master
fixed warnings about non passive events
2020-06-11 05:23:16 -07:00
Daniel Imms 06c8de381b Merge pull request #2970 from xtermjs/dependabot/npm_and_yarn/mocha-8.0.1
Bump mocha from 7.2.0 to 8.0.1
2020-06-11 04:33:27 -07:00
Daniel Imms ac0e1aeb19 Merge pull request #2952 from Puneethnaik/#2737_fix
non-transparent selection covers text
2020-06-11 04:31:25 -07:00
Daniel Imms 1171a20262 Merge branch 'master' into dependabot/npm_and_yarn/mocha-8.0.1 2020-06-11 04:21:43 -07:00
Daniel Imms 8fa729a702 Merge branch 'master' into #2737_fix 2020-06-11 04:21:24 -07:00
Daniel Imms 53eb54e656 Merge pull request #2971 from Tyriar/font_fix
Fix ligatures addon breaking CI
2020-06-11 04:21:01 -07:00
Daniel Imms 3b9047be0f Fix fira code download 2020-06-11 04:14:38 -07:00
dependabot-preview[bot] 2562311606 Bump mocha from 7.2.0 to 8.0.1
Bumps [mocha](https://github.com/mochajs/mocha) from 7.2.0 to 8.0.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v7.2.0...v8.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-11 07:53:05 +00:00
Daniel Imms 98d0760898 Add tests, support #rrggbbaa in css.toColor 2020-06-10 18:37:13 -07:00
Daniel Imms 4c943ddb0d Space out exports 2020-06-10 12:39:11 -07:00
Puneethnaik 61432ab65d Made changes according as per Review Comments. 2020-06-09 23:34:53 +05:30
Puneethnaik 0ccdc8d1ca Merge branch 'master' of https://github.com/xtermjs/xterm.js into #2737_fix 2020-06-06 16:42:28 +05:30
Daniel Imms 8a3366b1eb Merge pull request #2967 from xtermjs/dependabot/npm_and_yarn/typescript-3.9.5
Bump typescript from 3.9.3 to 3.9.5
2020-06-05 12:58:10 -07:00
dependabot-preview[bot] c669cfbb23 Bump typescript from 3.9.3 to 3.9.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.3 to 3.9.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.3...v3.9.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-05 13:05:50 +00:00
Daniel Imms 45749f6017 Merge pull request #2968 from xtermjs/dependabot/npm_and_yarn/types/glob-7.1.2
Bump @types/glob from 7.1.1 to 7.1.2
2020-06-05 06:04:03 -07:00
dependabot-preview[bot] bc6bb417ac Bump @types/glob from 7.1.1 to 7.1.2
Bumps [@types/glob](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/glob) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/glob)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-05 07:50:19 +00:00
Daniel Imms 5342ba6b10 Merge pull request #2966 from xtermjs/remove_elements_helper
Add a helper to remove elements from their parent
2020-06-04 07:42:18 -07:00
Daniel Imms a1dc0d1936 Add tests for removeElementFromParent 2020-06-04 07:32:34 -07:00
Daniel Imms 15f1759580 Introduce removeElementFromParent helper 2020-06-04 07:20:59 -07:00
Daniel Imms fb25be3ecd Merge pull request #2962 from JoshuaKGoldberg/dom-renderer-dispose-children
Only removeChild valid children in DomRenderer dispose
2020-06-04 07:15:38 -07:00
Josh Goldberg fbb8c6273b Switched to parentElement optionals 2020-06-04 10:12:36 -04:00
Daniel Imms 289014b32e Merge pull request #2965 from JoshuaKGoldberg/patch-2
Bumped Dockerfile Node from 8 to 12
2020-06-04 07:11:10 -07:00
Josh Goldberg 9b91e3d5e2 Bumped Dockerfile Node from 8 to 12
This seemed to work for me, but I'm new here and don't particularly trust myself. 😄
2020-06-04 10:07:54 -04:00
Daniel Imms d57e099e6e Merge pull request #2964 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.5
Bump @types/ws from 7.2.4 to 7.2.5
2020-06-04 06:25:32 -07:00
dependabot-preview[bot] c5d30a9c63 Bump @types/ws from 7.2.4 to 7.2.5
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.4 to 7.2.5.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-04 08:17:01 +00:00
Josh Goldberg 8ee08a3be7 ESLint? What is that? Never heard of the thing. 2020-06-03 16:16:00 -04:00
Josh Goldberg 5af1554bbf Only removeChild valid children in DomRenderer dispose 2020-06-03 16:05:53 -04:00
Puneethnaik e226a111f9 Merge branch 'master' of https://github.com/xtermjs/xterm.js into #2737_fix 2020-06-03 19:48:39 +05:30
Puneethnaik d5bc65ec0e 1. Removed logic to blend selection with background with 0.3 opacity from ColorManager to a function in color namespace.
2. Changed the DomRenderer and CanvasRenderer where the function defined in color namespace is called.
2020-06-03 19:48:34 +05:30
Daniel Imms 106d74caa2 Merge pull request #2953 from coderaiser/lint/simplify
Using putout linter on xterm codebase
2020-06-02 05:35:45 -07:00
Daniel Imms 825784e0ec Merge pull request #2956 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.17
Bump @types/webpack from 4.41.16 to 4.41.17
2020-06-02 04:21:21 -07:00
dependabot-preview[bot] 80c6c7f399 Bump @types/webpack from 4.41.16 to 4.41.17
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.16 to 4.41.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-02 07:58:26 +00:00
David Sichau 156563e832 Merge branch 'master' into master 2020-06-02 08:49:55 +02:00
coderaiser b92260870a Merge branch 'master' into lint/simplify 2020-06-01 17:11:46 +03:00
coderaiser 04f2b6e9ff CoreMouseService: reports: while pop -> [] 2020-06-01 17:07:14 +03:00
coderaiserandDaniel Imms a9862a1a6f Update src/common/buffer/Buffer.ts
Co-authored-by: Daniel Imms <tyriar@tyriar.com>
2020-06-01 16:30:17 +03:00
Daniel Imms 2e2acd77f3 Merge pull request #2954 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.16
Bump @types/webpack from 4.41.13 to 4.41.16
2020-06-01 05:44:04 -07:00
dependabot-preview[bot] 75e8999a88 Bump @types/webpack from 4.41.13 to 4.41.16
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.13 to 4.41.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 11:40:33 +00:00
Daniel Imms 7bf62a3078 Merge pull request #2955 from xtermjs/dependabot/npm_and_yarn/nyc-15.1.0
Bump nyc from 15.0.1 to 15.1.0
2020-06-01 04:38:44 -07:00
dependabot-preview[bot] 0030ed214d Bump nyc from 15.0.1 to 15.1.0
Bumps [nyc](https://github.com/istanbuljs/nyc) from 15.0.1 to 15.1.0.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v15.0.1...v15.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-06-01 08:21:24 +00:00
coderaiser f63f1f7b95 chore: lint using putout 2020-06-01 00:04:17 +03:00
Puneethnaik 6daa3f4499 ColorManager.ts : modified the setTheme function to add opacity of 0.3 to the selection color if selection color provided is opaque. 2020-05-31 12:42:14 +05:30
Daniel Imms 4e6151d011 Merge pull request #2951 from roke22/patch-1
Added Laravel Ssh Web Client to readme file
2020-05-29 06:45:54 -07:00
Jose J. Anton 18330b47ed Added Laravel Ssh Web Client
Added Laravel Ssh Web Client
2020-05-29 14:55:49 +02:00
Daniel Imms 864f1a9be9 Merge pull request #2950 from JoshuaKGoldberg/patch-1
Add Codecademy to README.md list
2020-05-27 14:44:14 -07:00
Josh Goldberg 1b6e24d94a Add Codecademy to README.md list
💖
2020-05-27 16:26:09 -04:00
Daniel Imms 617e702a94 Merge pull request #2949 from xtermjs/dependabot/npm_and_yarn/source-map-loader-1.0.0
Bump source-map-loader from 0.2.4 to 1.0.0
2020-05-27 06:25:17 -07:00
dependabot-preview[bot] 6c0de23915 Bump source-map-loader from 0.2.4 to 1.0.0
Bumps [source-map-loader](https://github.com/webpack-contrib/source-map-loader) from 0.2.4 to 1.0.0.
- [Release notes](https://github.com/webpack-contrib/source-map-loader/releases)
- [Changelog](https://github.com/webpack-contrib/source-map-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack-contrib/source-map-loader/compare/v0.2.4...v1.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-27 07:49:40 +00:00
Daniel Imms 869d791f44 Merge pull request #2942 from sfx101/patch-1
Added DockerStacks link to real world uses
2020-05-26 08:12:25 -07:00
Daniel Imms e5499711c3 Merge pull request #2947 from xtermjs/dependabot/npm_and_yarn/ts-loader-7.0.5
Bump ts-loader from 7.0.4 to 7.0.5
2020-05-26 07:54:47 -07:00
Daniel Imms 3fbd215854 Merge pull request #2948 from xtermjs/dependabot/npm_and_yarn/mocha-7.2.0
Bump mocha from 7.1.2 to 7.2.0
2020-05-26 07:54:33 -07:00
dependabot-preview[bot] b7132e7fa7 Bump mocha from 7.1.2 to 7.2.0
Bumps [mocha](https://github.com/mochajs/mocha) from 7.1.2 to 7.2.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v7.1.2...v7.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-25 08:04:35 +00:00
dependabot-preview[bot] 7f201e3e6b Bump ts-loader from 7.0.4 to 7.0.5
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.4 to 7.0.5.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.4...v7.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-25 08:04:03 +00:00
Subhadip Naskar cebbac8265 Added DockerStacks link to real world uses 2020-05-22 10:48:17 +05:30
Daniel Imms 227a1f5aa3 Merge pull request #2940 from xtermjs/dependabot/npm_and_yarn/typescript-3.9.3
Bump typescript from 3.9.2 to 3.9.3
2020-05-20 05:24:47 -07:00
dependabot-preview[bot] 07bdc10245 Bump typescript from 3.9.2 to 3.9.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.9.2 to 3.9.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.9.2...v3.9.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-20 08:06:43 +00:00
Daniel Imms 1b9b6f0cbf Merge pull request #2938 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.34.0
Bump @typescript-eslint/parser from 2.33.0 to 2.34.0
2020-05-19 05:36:29 -07:00
dependabot-preview[bot] 1f6ebb3dac Bump @typescript-eslint/parser from 2.33.0 to 2.34.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.33.0 to 2.34.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.34.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-19 12:28:45 +00:00
Daniel Imms 3abb66500d Merge pull request #2939 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.34.0
Bump @typescript-eslint/eslint-plugin from 2.33.0 to 2.34.0
2020-05-19 05:27:05 -07:00
dependabot-preview[bot] b6b2e67180 Bump @typescript-eslint/eslint-plugin from 2.33.0 to 2.34.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.33.0 to 2.34.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.34.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-19 07:57:29 +00:00
Daniel Imms db9d950fb4 Merge pull request #2936 from xtermjs/dependabot/npm_and_yarn/types/jsdom-16.2.3
Bump @types/jsdom from 16.2.2 to 16.2.3
2020-05-18 07:45:18 -07:00
dependabot-preview[bot] bdd8b8d32f Bump @types/jsdom from 16.2.2 to 16.2.3
Bumps [@types/jsdom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsdom) from 16.2.2 to 16.2.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsdom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-18 08:12:37 +00:00
Daniel Imms d8bc7ceaff Merge pull request #2934 from xtermjs/tyriar/2933
Fix exception when disposing Terminal twice
2020-05-15 12:29:23 -07:00
Daniel Imms 6a0f7b0713 Fix exception when disposing Terminal twice
Fixes #2933
2020-05-15 10:58:09 -07:00
Daniel Imms 3ac8a89f9b Merge pull request #2932 from xtermjs/dependabot/npm_and_yarn/types/jsdom-16.2.2
Bump @types/jsdom from 16.2.1 to 16.2.2
2020-05-15 08:38:11 -07:00
dependabot-preview[bot] fcec9c793c Bump @types/jsdom from 16.2.1 to 16.2.2
Bumps [@types/jsdom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsdom) from 16.2.1 to 16.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsdom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-15 08:14:52 +00:00
David Sichau 2140930793 fixed warnings about non passive events 2020-05-14 15:03:13 +02:00
Daniel Imms 2c16a7e0d7 Merge pull request #2930 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.13
Bump @types/webpack from 4.41.12 to 4.41.13
2020-05-14 05:41:14 -07:00
dependabot-preview[bot] 325559e5d1 Bump @types/webpack from 4.41.12 to 4.41.13
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.12 to 4.41.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-14 08:05:09 +00:00
Daniel Imms 3ec926750a Merge pull request #2929 from Tyriar/4_6_0
v4.6.0 and bump all addons
2020-05-13 07:29:15 -07:00
Daniel Imms 6d8e9c43c9 v4.6.0 and bump all addons 2020-05-13 07:05:58 -07:00
Daniel Imms 69f3f302d6 Merge pull request #2928 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.33.0
Bump @typescript-eslint/eslint-plugin from 2.32.0 to 2.33.0
2020-05-13 06:37:16 -07:00
dependabot-preview[bot] 1282900140 Bump @typescript-eslint/eslint-plugin from 2.32.0 to 2.33.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.33.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-13 13:23:37 +00:00
Daniel Imms 768710b2d7 Merge pull request #2927 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.33.0
Bump @typescript-eslint/parser from 2.32.0 to 2.33.0
2020-05-13 05:43:51 -07:00
Daniel Imms 8750ad4ec2 Merge pull request #2926 from xtermjs/dependabot/npm_and_yarn/typescript-3.9.2
Bump typescript from 3.8.3 to 3.9.2
2020-05-13 05:42:33 -07:00
dependabot-preview[bot] 409d995080 Bump @typescript-eslint/parser from 2.32.0 to 2.33.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.32.0 to 2.33.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.33.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-13 08:09:36 +00:00
dependabot-preview[bot] a151b72fc5 Bump typescript from 3.8.3 to 3.9.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 3.8.3 to 3.9.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v3.8.3...v3.9.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-13 08:09:16 +00:00
Daniel Imms 0626b7ec22 Merge pull request #2923 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.32.0
Bump @typescript-eslint/parser from 2.31.0 to 2.32.0
2020-05-12 08:27:10 -07:00
dependabot-preview[bot] 91205710ef Bump @typescript-eslint/parser from 2.31.0 to 2.32.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.31.0 to 2.32.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.32.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-12 14:53:11 +00:00
Daniel Imms 5a4f352bb0 Merge pull request #2924 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.32.0
Bump @typescript-eslint/eslint-plugin from 2.31.0 to 2.32.0
2020-05-12 07:51:31 -07:00
dependabot-preview[bot] f62a14e976 Bump @typescript-eslint/eslint-plugin from 2.31.0 to 2.32.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.31.0 to 2.32.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.32.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-12 12:08:11 +00:00
Daniel Imms 5f3fb410f7 Merge pull request #2925 from xtermjs/dependabot/npm_and_yarn/ts-loader-7.0.4
Bump ts-loader from 7.0.3 to 7.0.4
2020-05-12 05:06:27 -07:00
dependabot-preview[bot] 2d8dfde660 Bump ts-loader from 7.0.3 to 7.0.4
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.3 to 7.0.4.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.3...v7.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-12 07:54:10 +00:00
Daniel Imms 7fb885ce7d Merge pull request #2921 from Tyriar/2826_api_check
Add a proposed API check option
2020-05-11 04:46:45 -07:00
Daniel Imms 4aa3097cd1 Merge pull request #2922 from xtermjs/dependabot/npm_and_yarn/ws-7.3.0
Bump ws from 7.2.5 to 7.3.0
2020-05-11 04:35:48 -07:00
dependabot-preview[bot] 0b87d9a39c Bump ws from 7.2.5 to 7.3.0
Bumps [ws](https://github.com/websockets/ws) from 7.2.5 to 7.3.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.2.5...7.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-11 08:29:28 +00:00
Daniel Imms 92fdf0ce58 Fix lint issue 2020-05-08 12:41:26 -07:00
Daniel Imms aa59f34aab Add a proposed API check option
Part of #2826
2020-05-08 12:41:10 -07:00
Daniel Imms 05c149783f Merge pull request #2914 from drauggres/bug/demo_addons_list
Fix demo. Clear addons list on terminal recreation
2020-05-08 11:27:51 -07:00
Daniel Imms c3bc436e49 Merge branch 'master' into bug/demo_addons_list 2020-05-08 11:26:25 -07:00
Daniel Imms 64328ee39c Merge pull request #2920 from xtermjs/dependabot/npm_and_yarn/ts-loader-7.0.3
Bump ts-loader from 7.0.2 to 7.0.3
2020-05-07 04:53:58 -07:00
dependabot-preview[bot] 61667c1c23 Bump ts-loader from 7.0.2 to 7.0.3
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.2 to 7.0.3.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.2...v7.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-07 07:52:11 +00:00
Daniel Imms 3a9cdbab0d Merge pull request #2916 from xtermjs/tyriar/intersecting
Remove intersecting lower priority links
2020-05-06 06:55:51 -07:00
Daniel Imms 27af770068 Remove intersecting lower priority links
Fixes #2848
2020-05-06 06:16:36 -07:00
Sergey Volkov 71e45cdd25 Fix demo. Clear addons list on terminal recreation 2020-05-06 15:28:23 +03:00
Daniel Imms f9adf8ad83 Merge pull request #2912 from xtermjs/tyriar/2911
Workaround for hover firing multiple times
2020-05-06 04:59:33 -07:00
Daniel Imms f886698dc3 Workaround for hover firing multiple times
Fixes #2911
2020-05-06 04:53:25 -07:00
Daniel Imms 7ab0a42b24 Merge pull request #2908 from Tyriar/line_links
Change link provider API to provide all links for a line
2020-05-06 03:05:32 -07:00
Daniel Imms 99e2a3db1c Add test for multiple links on one line 2020-05-06 02:56:52 -07:00
Daniel Imms 9ca6733f68 Fix api tests 2020-05-06 02:50:35 -07:00
Daniel Imms 6d5ae1416a Correct api usage in tests
assertions should still fail
2020-05-05 18:35:37 -07:00
Daniel Imms 0707398a5b Remove logs 2020-05-05 18:27:11 -07:00
Daniel Imms 75e4e2089e Improve api 2020-05-05 18:26:07 -07:00
Daniel Imms 484883f442 Fix Linkifier2 tests 2020-05-05 18:24:45 -07:00
Daniel Imms d488b49fc4 Change link provider API to return all links for the line
Fixes #2848
2020-05-05 18:19:57 -07:00
Daniel Imms 1168c6c52f Merge pull request #2903 from theflyingape/patch-1
Update README.md
2020-05-05 05:50:14 -07:00
Daniel Imms f4e87cdbb3 Merge pull request #2905 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.31.0
Bump @typescript-eslint/eslint-plugin from 2.30.0 to 2.31.0
2020-05-05 05:33:03 -07:00
dependabot-preview[bot] 24c64bfc7f Bump @typescript-eslint/eslint-plugin from 2.30.0 to 2.31.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.31.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-05 12:06:10 +00:00
Daniel Imms ed5aeb7472 Merge pull request #2906 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.31.0
Bump @typescript-eslint/parser from 2.30.0 to 2.31.0
2020-05-05 05:04:34 -07:00
dependabot-preview[bot] eb3f933290 Bump @typescript-eslint/parser from 2.30.0 to 2.31.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.30.0 to 2.31.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.31.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-05-05 08:06:57 +00:00
Robert Hurst 832c43a509 Update README.md
A TypeScript port (app & client) of the venerable Hack & Slash game.
2020-05-04 09:57:35 -04:00
Daniel Imms 31d3ae451c Merge pull request #2899 from Tyriar/memoryleak
Fix listener leaks causing Terminal memory from not getting freed
2020-05-03 15:30:29 -07:00
Daniel Imms e413133602 Remove unused helper 2020-05-03 15:26:02 -07:00
Daniel Imms 06b8d36cf0 Fix other leaking listeners 2020-05-03 14:37:20 -07:00
Daniel Imms b75e42a56c Fix terminal object leaking 2020-05-03 12:46:37 -07:00
Daniel Imms 66b2c01549 Merge pull request #2898 from Tyriar/eslint_js
Disable eslint in all js files
2020-05-03 07:39:11 -07:00
Daniel Imms 065eb13a9d Merge pull request #2751 from jerch/underline_core
Underline styles and colors - core part
2020-05-03 07:32:32 -07:00
Daniel Imms 15bb9aa137 Disable eslint in all js files
This was causing distracting editor diagnostics
2020-05-03 07:31:46 -07:00
Daniel Imms 07862c2e52 Fixing minor comments 2020-05-03 07:26:27 -07:00
Daniel Imms a8b6252c3c Fix compile after merge 2020-05-03 07:20:58 -07:00
Daniel Imms bbbf128b7c Fix tests 2020-05-03 07:19:10 -07:00
Daniel Imms 62b8398719 Merge branch 'master' into pr/jerch/2751 2020-05-03 07:14:02 -07:00
Daniel Imms 3ea9a7511e Merge pull request #2724 from jerch/reverse_wraparound
Reverse wraparound
2020-05-03 07:11:25 -07:00
Daniel Imms 076d51fc35 Merge branch 'master' into reverse_wraparound 2020-05-03 07:05:14 -07:00
Daniel Imms 210fa7f655 Move commented test into Terminal.test 2020-05-03 07:04:01 -07:00
Daniel Imms fbdb01d43c Merge pull request #2847 from LabhanshAgrawal/ligatures-addon
Merge ligatures addon into core repo
2020-05-03 06:54:46 -07:00
Daniel Imms 36e241cd8d Alphabetize tsconfig addons 2020-05-03 06:49:05 -07:00
Daniel Imms c5b0068c9b Remove coveralls 2020-05-03 06:48:00 -07:00
Daniel Imms ed7bab7f02 Correct package.json repo links 2020-05-03 06:46:38 -07:00
Daniel Imms 001e16e081 Copyright 2020-05-03 06:45:12 -07:00
Daniel Imms 41670dc181 Remove test dependence on applyAddon 2020-05-03 06:44:17 -07:00
Daniel Imms 6c6900ede8 Bring ligatures readme install/usage up to date 2020-05-03 06:35:36 -07:00
Daniel Imms b450470142 Remove old addon api 'apply' call 2020-05-03 06:32:32 -07:00
Daniel Imms d98fcf8d1f Update copyright 2020-05-03 06:29:02 -07:00
Daniel Imms 5b90b8a3ad Clean up ligatures readme 2020-05-03 06:26:23 -07:00
Daniel Imms e343e690f2 Merge branch 'master' into ligatures-addon 2020-05-03 06:22:14 -07:00
Daniel Imms 6f1f4ba98f Merge pull request #2867 from rishab-pdx/#2840
Different behavior when search two same words in only one row
2020-05-03 06:21:14 -07:00
Daniel Imms 7a34b4de73 Merge pull request #2895 from Tyriar/eslint_warn
Make all eslint rules warnings
2020-05-03 06:15:15 -07:00
Daniel Imms b84831f148 Make all eslint rules warnings
eslint warnings normally don't exit with non-zero when warnings fail unless
'--max-warnings 0' is used. This commit adds that and changes all rules to
be warnings in order to improve feedback in the editor. After this commit
all warning diagnostics (yellow) are stylistic/lint-related ones that will
still fail lint, which error diagnostics (red) are actual errors that will
fail compilation (from tsc).

Fixes #2886
2020-05-03 06:07:53 -07:00
Daniel Imms d9ecafeb2a Merge pull request #2892 from Eugeny/fixed-dpr-listener
fixed ScreenDprListener never being fired
2020-05-02 15:54:52 -07:00
EugeneandDaniel Imms 930de9aeb7 Update src/browser/ScreenDprMonitor.ts
Co-authored-by: Daniel Imms <tyriar@tyriar.com>
2020-05-02 22:48:30 +02:00
Eugene Pankov 40a09d7412 fixed ScreenDprListener never being fired 2020-05-02 16:20:46 +02:00
Labhansh Agrawal ad9aabbb7e fix ci errors 2020-05-01 14:26:03 +05:30
Labhansh Agrawal 195bce0485 add dependencies as externals in webpack 2020-05-01 14:26:03 +05:30
Labhansh Agrawal 42b88f34f4 remove azure devops config 2020-05-01 14:26:03 +05:30
Labhansh Agrawal 7bde7039bb add webpack config 2020-05-01 14:26:03 +05:30
Labhansh Agrawal 4702a0af9d lint 2020-05-01 14:26:03 +05:30
Labhansh Agrawal c818381ef1 add ligatures addon config 2020-05-01 14:26:03 +05:30
Labhansh Agrawal ef4ecf7c8e clean up dev dependencies 2020-05-01 14:26:03 +05:30
Labhansh Agrawal fb65cea115 set up similar to other addons 2020-05-01 14:26:03 +05:30
Labhansh Agrawal dcca79baef delete non-required files 2020-05-01 14:26:03 +05:30
Labhansh Agrawal 15df03ba09 clone ligatures addon repo 2020-05-01 14:26:03 +05:30
rishab 5eb33e9d8a Merge branch 'master' of https://github.com/xtermjs/xterm.js into #2840 2020-04-30 14:05:01 -07:00
Daniel Imms 939de5d151 Merge pull request #2888 from lunaroyster/master
Added @ as a character in URL paths for the weblinks addon
2020-04-30 06:30:59 -07:00
Daniel Imms 4c440b8552 Merge pull request #2890 from xtermjs/dependabot/npm_and_yarn/ts-loader-7.0.2
Bump ts-loader from 7.0.1 to 7.0.2
2020-04-30 05:10:20 -07:00
dependabot-preview[bot] 1c73fd5454 Bump ts-loader from 7.0.1 to 7.0.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.1 to 7.0.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.1...v7.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-30 08:01:12 +00:00
lunaroysterandEricWangUTM 9567ae4bfe Added @ as a character to pathCharacterSet for xterm-addons-web-links
Co-authored-by: lunaroyster <oneinaquadrillion@live.com>
Co-authored-by: EricWangUTM <yifeng.wang@mail.utoronto.ca>
2020-04-30 04:35:34 +00:00
rishab 853b454eae Merge branch 'master' of https://github.com/xtermjs/xterm.js into #2840 2020-04-29 19:56:45 -07:00
Daniel Imms 94b1fec91e Merge pull request #2883 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.30.0
Bump @typescript-eslint/eslint-plugin from 2.29.0 to 2.30.0
2020-04-28 05:57:46 -07:00
dependabot-preview[bot] a6a5c010fe Bump @typescript-eslint/eslint-plugin from 2.29.0 to 2.30.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.29.0 to 2.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.30.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-28 12:46:07 +00:00
Daniel Imms 52bcbaed08 Merge pull request #2882 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.30.0
Bump @typescript-eslint/parser from 2.29.0 to 2.30.0
2020-04-28 05:44:20 -07:00
dependabot-preview[bot] 74ac45730f Bump @typescript-eslint/parser from 2.29.0 to 2.30.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.29.0 to 2.30.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.30.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-28 08:06:37 +00:00
Jörg Breitbart 0d0f04de5c resolve master conflicts 2020-04-27 16:16:31 +02:00
Jörg Breitbart e1be294147 Merge branch 'master' into reverse_wraparound 2020-04-27 16:11:39 +02:00
Daniel Imms 45077d7106 Merge pull request #2880 from xtermjs/dependabot/npm_and_yarn/mocha-7.1.2
Bump mocha from 7.1.1 to 7.1.2
2020-04-27 06:16:14 -07:00
dependabot-preview[bot] e65ead3f20 Bump mocha from 7.1.1 to 7.1.2
Bumps [mocha](https://github.com/mochajs/mocha) from 7.1.1 to 7.1.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v7.1.1...v7.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 13:01:17 +00:00
Daniel Imms 5ed6d0fedb Merge pull request #2879 from xtermjs/dependabot/npm_and_yarn/ws-7.2.5
Bump ws from 7.2.3 to 7.2.5
2020-04-27 05:59:41 -07:00
dependabot-preview[bot] 673138c5af Bump ws from 7.2.3 to 7.2.5
Bumps [ws](https://github.com/websockets/ws) from 7.2.3 to 7.2.5.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.2.3...7.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 08:26:57 +00:00
Rishab 0e145a1a57 Merge branch 'master' into #2840 2020-04-26 14:42:43 -07:00
Daniel Imms a8bcfc62d0 Merge pull request #2876 from Tyriar/layers3
Move more parts of Terminal into CoreTerminal and move everything else into browser/
2020-04-26 11:19:05 -07:00
Daniel Imms 394bb38913 Remove src/tsconfig.json from eslintrc 2020-04-26 11:11:04 -07:00
Daniel Imms 80c5c94e7e Remove src project 2020-04-26 11:06:30 -07:00
Daniel Imms 03bfd2c842 Move Terminal*.test into browser 2020-04-26 10:59:32 -07:00
Daniel Imms bdb438972f Fix errors in Terminal and elsewhere
This was mostly ! to compel TS, we should actually fix this down the road
but that can come later.
2020-04-26 10:44:44 -07:00
Daniel Imms f256206fd4 Move Terminal and AccessibilityManager into browser 2020-04-26 10:18:05 -07:00
Daniel Imms 4d01929503 Introduce ICoreTerminal 2020-04-26 10:11:24 -07:00
Daniel Imms 2a9b76246b Move scroll into CoreTerminal 2020-04-26 10:02:59 -07:00
Daniel Imms 21bcef5008 Move a bunch of scroll logic into CoreTerminal
This change will now reset userScrolling on RIS
2020-04-26 09:54:44 -07:00
Daniel Imms 46e7fc61cc Move WriteBuffer into CoreTerminal 2020-04-26 09:38:34 -07:00
Daniel Imms b9dee59900 Move InputHandler init into CoreTerminal 2020-04-26 09:36:56 -07:00
Daniel Imms 2fd4c149fd Merge pull request #2874 from Tyriar/layers2
Move InputHandler into common
2020-04-26 09:08:50 -07:00
Daniel Imms d085768e8b Fix some lint issues 2020-04-26 08:23:38 -07:00
Daniel Imms 6f9730c652 Merge branch 'master' into layers2 2020-04-26 08:14:47 -07:00
Daniel Imms b79a0a9832 Remove unwanted vscode setting 2020-04-26 08:12:53 -07:00
Daniel Imms 212061be50 Move InputHandler.test into common, fix strict errors 2020-04-26 08:11:53 -07:00
Daniel Imms c931341259 Remove Terminal dep in InputHandler.test 2020-04-26 08:08:49 -07:00
Daniel Imms 51dc03a730 Merge pull request #2873 from jerch/fix_2872
Fix missing ybase calc in print
2020-04-26 08:08:26 -07:00
Jörg Breitbart 31670da633 fix sloppy coding in InputHandler 2020-04-26 16:53:15 +02:00
Jörg Breitbart 51a808c094 some refactoring 2020-04-26 16:34:15 +02:00
Daniel Imms d756086b8e Move InputHandler into common
Part of #2749
Part of #1507
2020-04-26 07:24:30 -07:00
Daniel Imms 81d289b266 Remove RenderService dep in InputHandler 2020-04-26 07:03:11 -07:00
Jörg Breitbart 71c2551a2e Merge branch 'reverse_wraparound' of github.com:jerch/xterm.js into reverse_wraparound 2020-04-26 15:59:27 +02:00
Jörg Breitbart ab2c8c7382 Merge branch 'master' into reverse_wraparound 2020-04-26 15:59:10 +02:00
Daniel Imms ba40fe4ff4 Remove Terminal dependency from InputHandler 🎉 2020-04-26 06:46:37 -07:00
Daniel Imms dbced5c1a4 Move Terminal.is into InputHandler 2020-04-26 06:38:10 -07:00
Daniel Imms 3a1a0d6590 Remove input handler Terminal.resize dep 2020-04-26 06:34:36 -07:00
Daniel Imms 451d9aab96 Register forwardEvent calls 2020-04-26 06:21:16 -07:00
Daniel Imms a6949d522e Move resize event into bufferservice 2020-04-26 06:16:13 -07:00
Daniel Imms eba372e2cc More some of Terminal.resize into bufferservice 2020-04-25 20:52:59 -07:00
Daniel Imms a3ac0d542d Remove unused imports 2020-04-25 20:39:58 -07:00
Daniel Imms 0709b0dc3b Break input handler dep on Terminal.scroll 2020-04-25 19:28:00 -07:00
rishab 5bb710e921 Merge branch 'master' of https://github.com/xtermjs/xterm.js 2020-04-25 17:39:30 -07:00
Rishab a5c1e594b3 Merge pull request #1 from rishab-pdx/#2840
handle wrap back with find previous
2020-04-25 17:37:12 -07:00
rishab 08f8f51ade handle wrap back with find previous
wrap back search selection to last selected result when we hit top
2020-04-25 17:33:48 -07:00
Daniel Imms 3897950e22 Remove a11y event dep, introduce forwardEvent helper 2020-04-25 16:45:46 -07:00
Daniel Imms e9db1ecd1f Remove Terminal.handleTitle dep 2020-04-25 16:37:31 -07:00
Daniel Imms 9346eba2f2 Remove Terminal.showCursor dep from input handler 2020-04-25 16:18:43 -07:00
Daniel Imms c5ba1d62e7 Remove mouseEvents from Terminal
Depend on CoreMouseService directly
2020-04-25 13:31:45 -07:00
Daniel Imms 37996bcd15 Move sendFocus to core service 2020-04-25 13:26:06 -07:00
Daniel Imms d5729f9216 Move insertMode into core service 2020-04-25 11:26:20 -07:00
Daniel Imms 4cec11be9c Move bracketed paste mode to coreservice 2020-04-25 11:11:05 -07:00
Daniel Imms b80c14639e Move option listeners to core 2020-04-25 10:34:37 -07:00
Daniel Imms 0d3bd2052b Remove remaining common service inits to common 2020-04-25 10:26:29 -07:00
Daniel Imms 353a8c5388 Create CoreTerminal, fix createInstance in strict mode 2020-04-25 10:21:56 -07:00
Daniel Imms dac3037ee4 Merge pull request #2871 from Tyriar/layers
Support dependency injection in UnicodeService
2020-04-25 08:44:25 -07:00
Daniel Imms e3c81048af Use DI with Linkifier2 2020-04-25 07:29:07 -07:00
Daniel Imms c752ca84df Merge pull request #2870 from Tyriar/selection
Make sure selection gets redrawn when switching renderers
2020-04-25 07:27:17 -07:00
Daniel Imms a5d50960a7 Support DI in UnicodeService 2020-04-25 07:27:09 -07:00
Daniel Imms af0845b4a3 Merge branch 'master' into selection 2020-04-25 07:18:27 -07:00
Daniel Imms 8d77b1ae16 Merge pull request #2869 from Tyriar/vs95556
Invalidate all links above when the terminal scrolls
2020-04-25 07:17:20 -07:00
Daniel Imms c185529ad5 Make sure selection gets redrawn when switching renderers
Fixes #2555
2020-04-25 07:11:43 -07:00
Daniel Imms 3a5def98e5 Correct selection types being optional 2020-04-25 06:56:00 -07:00
Daniel Imms 603c68bd69 Merge branch 'master' into vs95556 2020-04-25 06:46:02 -07:00
Daniel Imms 2f984964da Merge pull request #2868 from Tyriar/2595_selection_colors
Refresh model colors after changing theme
2020-04-25 06:42:01 -07:00
Daniel Imms 22aaf0471a Invalidate all links above when the terminal scrolls
See microsoft/vscode#95556
2020-04-25 06:41:25 -07:00
Daniel Imms 1134d0d7d4 Refresh model colors after changing theme
Fixes #2595
2020-04-25 06:22:08 -07:00
rishab 45ff3ee637 Update SearchAddon.ts 2020-04-25 03:13:32 -07:00
rishab 50ba6bfa1b Wrap search back if there exists a result in search
Search must wrap back as it does when there are multiple lines.
2020-04-25 03:13:19 -07:00
Daniel Imms cdcbb1d6da Merge pull request #2866 from xtermjs/dependabot/npm_and_yarn/deep-equal-2.0.3
Bump deep-equal from 2.0.2 to 2.0.3
2020-04-24 05:09:50 -07:00
dependabot-preview[bot] 49bf22ace4 Bump deep-equal from 2.0.2 to 2.0.3
Bumps [deep-equal](https://github.com/inspect-js/node-deep-equal) from 2.0.2 to 2.0.3.
- [Release notes](https://github.com/inspect-js/node-deep-equal/releases)
- [Changelog](https://github.com/inspect-js/node-deep-equal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/inspect-js/node-deep-equal/compare/v2.0.2...v2.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-24 08:02:20 +00:00
Daniel Imms 22fa95cf87 Merge pull request #2865 from xtermjs/dependabot/npm_and_yarn/webpack-4.43.0
Bump webpack from 4.42.1 to 4.43.0
2020-04-22 05:30:31 -07:00
dependabot-preview[bot] a76a889924 Bump webpack from 4.42.1 to 4.43.0
Bumps [webpack](https://github.com/webpack/webpack) from 4.42.1 to 4.43.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.42.1...v4.43.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-22 08:27:07 +00:00
Daniel Imms 8f7c6a635f Merge pull request #2864 from Tyriar/center_text
Center webgl text vertically
2020-04-21 18:23:14 -07:00
Daniel Imms 9ece6b1fbc Center webgl text vertically
Fixes #2613
2020-04-21 18:20:10 -07:00
Daniel Imms 9d7a45f459 Merge pull request #2862 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.29.0
Bump @typescript-eslint/parser from 2.28.0 to 2.29.0
2020-04-21 03:33:20 -07:00
dependabot-preview[bot] 0465ba24a2 Bump @typescript-eslint/parser from 2.28.0 to 2.29.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.29.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-21 10:22:18 +00:00
Daniel Imms b622c89967 Merge pull request #2861 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.29.0
Bump @typescript-eslint/eslint-plugin from 2.28.0 to 2.29.0
2020-04-21 03:20:43 -07:00
dependabot-preview[bot] 7efb141f88 Bump @typescript-eslint/eslint-plugin from 2.28.0 to 2.29.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.28.0 to 2.29.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.29.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-21 08:13:30 +00:00
Daniel Imms d093912f9d Merge pull request #2859 from xtermjs/dependabot/npm_and_yarn/ts-loader-7.0.1
Bump ts-loader from 7.0.0 to 7.0.1
2020-04-20 07:20:17 -07:00
dependabot-preview[bot] 92e5c8d228 Bump ts-loader from 7.0.0 to 7.0.1
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v7.0.0...v7.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 13:06:59 +00:00
Daniel Imms 68995e6ed8 Merge pull request #2858 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.12
Bump @types/webpack from 4.41.11 to 4.41.12
2020-04-20 06:05:01 -07:00
dependabot-preview[bot] edac29fe51 Bump @types/webpack from 4.41.11 to 4.41.12
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.11 to 4.41.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-20 08:35:06 +00:00
Daniel Imms e7f72a1ba8 Merge pull request #2857 from Tyriar/decoration_customizations
Allow embedders to customize link decorations independently
2020-04-19 04:24:50 -07:00
Daniel Imms d0519d6c25 Fix tests 2020-04-19 04:20:10 -07:00
Daniel Imms 2ce435f98d Allow embedders to customize link decorations independently
See microsoft/vscode#95631
2020-04-19 04:07:22 -07:00
Daniel Imms 67fde3e941 Merge pull request #2856 from Tyriar/link_underline
Prevent hover callbacks firing if the mouse is outside the viewport
2020-04-18 18:27:12 -07:00
Daniel Imms 1282c060fc Prevent hover callbacks firing if the mouse is outside the viewport
Fixes #2849
2020-04-18 18:02:51 -07:00
Daniel Imms 52f1fc943d Merge pull request #2855 from Tyriar/link_underline
Polish link decorations and better support embedder hovers
2020-04-18 10:21:57 -07:00
Daniel Imms 88ff19383b Allow embedders to designate link hover elements 2020-04-18 09:13:09 -07:00
Daniel Imms 832312e095 Change hideUnderline to hideDecorations
Also track cursor style
2020-04-18 06:23:46 -07:00
Daniel Imms f2ed01993d Track changes to hideUnderline 2020-04-18 06:18:01 -07:00
Daniel Imms ccf869e671 Merge pull request #2854 from Tyriar/hide_underline
Allow hiding of link underlines
2020-04-17 19:01:22 -07:00
Daniel Imms 48f579977e Allow hiding of link underlines
See microsoft/vscode#95080
2020-04-17 18:46:01 -07:00
Daniel Imms ab595659c2 Merge pull request #2852 from Tyriar/mouseleave
Clear link when leaving xterm link
2020-04-17 17:38:45 -07:00
Daniel Imms 0cd2b78425 Clear link when leaving xterm link
Fixes #2851
2020-04-17 17:30:53 -07:00
Daniel Imms c1e618fc3b Merge pull request #2830 from kumaran-14/2702_api_test_debug
Add api-test script to log poll result on passing --debug flag
2020-04-15 08:04:12 -07:00
Daniel Imms 934b9faf36 Merge branch 'master' into 2702_api_test_debug 2020-04-15 06:52:14 -07:00
Daniel Imms 2836dcb71f Merge pull request #2845 from xtermjs/dependabot/npm_and_yarn/ts-loader-7.0.0
Bump ts-loader from 6.2.2 to 7.0.0
2020-04-15 06:09:39 -07:00
dependabot-preview[bot] 2b874c5817 Bump ts-loader from 6.2.2 to 7.0.0
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 6.2.2 to 7.0.0.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v6.2.2...v7.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-15 08:12:32 +00:00
Daniel Imms 19b73d2ba7 Merge pull request #2842 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.28.0
Bump @typescript-eslint/parser from 2.27.0 to 2.28.0
2020-04-14 06:36:51 -07:00
Daniel Imms 548a17d94c Merge pull request #2844 from Tyriar/2824
Enforce explicit access modifiers
2020-04-14 06:36:34 -07:00
Daniel Imms de4005d470 Merge branch 'master' into 2824 2020-04-14 06:31:48 -07:00
dependabot-preview[bot] 46e9b9499c Bump @typescript-eslint/parser from 2.27.0 to 2.28.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.28.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 13:26:53 +00:00
Daniel Imms 580b06ada5 Merge pull request #2843 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.28.0
Bump @typescript-eslint/eslint-plugin from 2.27.0 to 2.28.0
2020-04-14 06:25:15 -07:00
Daniel Imms 1472e7b051 Merge branch 'master' into 2824 2020-04-14 06:25:06 -07:00
Daniel Imms 9817754f92 Fix explicit access 2020-04-14 06:23:11 -07:00
dependabot-preview[bot] 05f1959c83 Bump @typescript-eslint/eslint-plugin from 2.27.0 to 2.28.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.28.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 13:08:53 +00:00
Daniel Imms 80a692a751 Merge pull request #2841 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.4
Bump @types/ws from 7.2.3 to 7.2.4
2020-04-14 06:07:11 -07:00
Daniel Imms a5ebb6d98c Add member access eslint rule 2020-04-14 06:03:47 -07:00
Daniel Imms 04c1e4b57d Remove readonly from ctors 2020-04-14 06:03:31 -07:00
dependabot-preview[bot] f8f9c06ed8 Bump @types/ws from 7.2.3 to 7.2.4
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.3 to 7.2.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-14 08:14:38 +00:00
kumaran-14 1f4b2607cc Replace flatMap method with reduce and map 2020-04-13 22:36:33 +05:30
Daniel Imms f0c518a134 Merge pull request #2838 from xtermjs/dependabot/npm_and_yarn/types/jsdom-16.2.1
Bump @types/jsdom from 16.2.0 to 16.2.1
2020-04-13 06:33:50 -07:00
dependabot-preview[bot] c396518736 Bump @types/jsdom from 16.2.0 to 16.2.1
Bumps [@types/jsdom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsdom) from 16.2.0 to 16.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jsdom)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-13 12:34:17 +00:00
Daniel Imms d6a45b511e Merge pull request #2839 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.11
Bump @types/webpack from 4.41.10 to 4.41.11
2020-04-13 05:32:38 -07:00
dependabot-preview[bot] f5c4c3e450 Bump @types/webpack from 4.41.10 to 4.41.11
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.10 to 4.41.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-13 08:19:05 +00:00
Daniel Imms aecfb5772d Merge pull request #2835 from Tyriar/2822
Add linkTooltipHoverDuration setting
2020-04-11 10:08:30 -07:00
Daniel Imms 3b7b936582 Merge pull request #2837 from Tyriar/2836
Only fire IRenderService.onRender when buffer changes occurred
2020-04-11 09:59:34 -07:00
Daniel Imms 309bdf3d70 Rename onRender 2020-04-11 09:53:32 -07:00
Daniel Imms 55f9203f60 Only fire IRenderService.onRender when buffer changes occurred
Fixes #2836
2020-04-11 09:51:28 -07:00
kumaran-14 df7ba37d57 Update args parser to allow flag values 2020-04-11 21:15:24 +05:30
kumaran-14 96cb4e9a52 Merge remote-tracking branch 'upstream/master' into 2702_api_test_debug 2020-04-11 19:55:36 +05:30
Daniel Imms f070be8dd3 Add deprecated with explanation 2020-04-11 07:23:53 -07:00
Daniel Imms 3408a0537f Add linkTooltipHoverDuration setting
Fixes #2822
2020-04-11 07:22:20 -07:00
Daniel Imms 5669cf832f Merge branch 'master' into reverse_wraparound 2020-04-11 06:41:28 -07:00
Daniel Imms e2ac4b45d0 Merge pull request #2834 from Tyriar/2833
Fix selection wrapping to end when not beyond viewport
2020-04-11 06:38:50 -07:00
Daniel Imms 714daba393 Fix selection wrapping to end when not beyond viewport
This was happening as the devicePixelRatio wasn't being taken into account,
the fix was to rely on IRenderService to get the right canvas height.

Fixes #2833
2020-04-11 06:31:58 -07:00
Daniel Imms 1913e9512c Merge pull request #2718 from kumaran-14/2498_alt_enter
Support alt+enter key signal by default
2020-04-11 05:49:33 -07:00
kumaran-14 ae72994cfb Undo changes on ./bin/test.js 2020-04-11 12:02:27 +05:30
kumaran-14 f9b2f3e87d Add api-test script to log poll result on passing --debug flag 2020-04-11 11:54:58 +05:30
Daniel Imms e05bf87528 Merge pull request #2829 from Tyriar/lgtm
Fix most lgtm warnings
2020-04-10 14:22:24 -07:00
Daniel Imms 7609a5456e Fix most lgtm warnings 2020-04-10 14:08:28 -07:00
Daniel Imms 4809a2e0df Merge pull request #2828 from Tyriar/release45
v4.5.0
2020-04-10 12:53:39 -07:00
Daniel Imms e61c34b85f Merge branch 'master' into 2498_alt_enter 2020-04-10 12:53:16 -07:00
Daniel Imms ba0dc60b09 Combine into ternary 2020-04-10 12:53:02 -07:00
Daniel Imms f61d6320a3 v4.5.0 2020-04-10 12:44:39 -07:00
kumaran-14 3ef41f2b1d Remove decset modes from coreservices 2020-04-10 23:19:31 +05:30
Daniel Imms 2e6f547bfc Merge branch 'master' into reverse_wraparound 2020-04-10 10:30:30 -07:00
Daniel Imms c66b25b4cc Merge pull request #2827 from Tyriar/eslint_types
Convert eslintrc to json and fix errors
2020-04-10 10:29:46 -07:00
Daniel Imms a66edbdda8 Merge pull request #2713 from JavaCS3/master
expose IBufferSet API
2020-04-10 10:18:51 -07:00
Daniel Imms ef0d834db8 Convert eslintrc to json and fix errors 2020-04-10 10:05:23 -07:00
Daniel Imms 89daacac32 Add missing api docs 2020-04-10 10:02:09 -07:00
Daniel Imms f4f15ee5e9 Add missing line in api 2020-04-10 09:57:10 -07:00
Daniel Imms 4c36ef9d24 Don't pass buffers to BufferApiView 2020-04-10 09:56:26 -07:00
Daniel Imms 886af692e2 Use a separate emitter for BufferNamespaceApi.onBufferChange 2020-04-10 09:53:51 -07:00
Daniel Imms c63949f384 Merge branch 'master' into master 2020-04-10 09:37:51 -07:00
Daniel Imms 9460e915cd Merge branch 'master' into underline_core 2020-04-10 09:22:07 -07:00
Daniel Imms 34a324f551 Merge pull request #2825 from Tyriar/debug_log
Use debug log level for open not attached to the DOM
2020-04-10 07:50:51 -07:00
Daniel Imms 996694aec4 Use debug log level for open not attached to the DOM
It seems mostly harmless now

Part of microsoft/vscode#88529
2020-04-10 07:50:10 -07:00
Daniel Imms e21060a259 Merge pull request #2725 from Tyriar/webkit
Improve Linux dependencies, remove browser args
2020-04-10 06:45:37 -07:00
Daniel Imms 951d342ed7 Disable webkit 2020-04-10 06:38:54 -07:00
Daniel Imms 74b76704f8 Merge pull request #2746 from jerch/fix_2745
cursor handling in DECSTR
2020-04-10 06:36:39 -07:00
Daniel Imms 6efc37eaf3 Merge branch 'master' into webkit 2020-04-10 06:34:45 -07:00
Daniel Imms 9cf4e68ac4 Merge pull request #2739 from felixse/fix-edge-selection-color
Fix selection color in Legacy Edge
2020-04-10 06:34:05 -07:00
Daniel Imms 1c35c8b617 Merge pull request #2817 from Tyriar/2764
Pause cursor render layer before resuming
2020-04-10 06:25:30 -07:00
Charles Wei 94dabe225b Merge branch 'master' into master 2020-04-10 12:11:17 +08:00
Daniel Imms 21b490f03a Merge pull request #2819 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/parser-2.27.0
Bump @typescript-eslint/parser from 2.26.0 to 2.27.0
2020-04-07 06:31:30 -07:00
dependabot-preview[bot] f8f509a296 Bump @typescript-eslint/parser from 2.26.0 to 2.27.0
Bumps [@typescript-eslint/parser](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/parser) from 2.26.0 to 2.27.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/parser/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.27.0/packages/parser)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-07 13:17:32 +00:00
Daniel Imms 062b771622 Merge pull request #2820 from xtermjs/dependabot/npm_and_yarn/typescript-eslint/eslint-plugin-2.27.0
Bump @typescript-eslint/eslint-plugin from 2.26.0 to 2.27.0
2020-04-07 06:15:48 -07:00
dependabot-preview[bot] adff472011 Bump @typescript-eslint/eslint-plugin from 2.26.0 to 2.27.0
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 2.26.0 to 2.27.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v2.27.0/packages/eslint-plugin)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-07 08:17:08 +00:00
Charles Wei 9c043dbf9f Merge branch 'master' into master 2020-04-07 11:27:32 +08:00
Daniel Imms 59d28e7b99 Use browser types instead of nodejs 2020-04-06 05:33:09 -07:00
Daniel Imms 8b5a133106 Pause cursor render layer before resuming
Fixes #2764
2020-04-06 05:32:11 -07:00
Daniel Imms 86a41dd6dd Merge pull request #2815 from xtermjs/dependabot/npm_and_yarn/nyc-15.0.1
Bump nyc from 15.0.0 to 15.0.1
2020-04-06 04:23:57 -07:00
dependabot-preview[bot] 2d77b25e26 Bump nyc from 15.0.0 to 15.0.1
Bumps [nyc](https://github.com/istanbuljs/nyc) from 15.0.0 to 15.0.1.
- [Release notes](https://github.com/istanbuljs/nyc/releases)
- [Changelog](https://github.com/istanbuljs/nyc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/istanbuljs/nyc/compare/v15.0.0...v15.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-06 08:41:11 +00:00
Daniel Imms 43526c2297 Merge pull request #2814 from Tyriar/role_list
Use role=list in screen reader mode
2020-04-05 09:54:56 -07:00
Daniel Imms 192762add8 Use role=list in screen reader mode 2020-04-05 09:54:19 -07:00
javacs3 0f64847351 fix lint error 2020-04-05 15:31:05 +08:00
Charles Wei 88d2f26269 Merge branch 'master' into master 2020-04-05 12:15:37 +08:00
Daniel Imms 21aabb1215 Merge pull request #2810 from xtermjs/dependabot/npm_and_yarn/deep-equal-2.0.2
Bump deep-equal from 2.0.1 to 2.0.2
2020-04-02 07:58:40 -07:00
dependabot-preview[bot] e6ea51f8cb Bump deep-equal from 2.0.1 to 2.0.2
Bumps [deep-equal](https://github.com/inspect-js/node-deep-equal) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/inspect-js/node-deep-equal/releases)
- [Changelog](https://github.com/inspect-js/node-deep-equal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/inspect-js/node-deep-equal/compare/v2.0.1...v2.0.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-02 08:07:09 +00:00
Daniel Imms 6d52e1709f Merge pull request #2805 from xtermjs/dependabot/npm_and_yarn/mustache-4.0.1
Bump mustache from 3.2.1 to 4.0.1
2020-04-01 06:59:52 -07:00
dependabot-preview[bot] aaf1fd0256 Bump mustache from 3.2.1 to 4.0.1
Bumps [mustache](https://github.com/janl/mustache.js) from 3.2.1 to 4.0.1.
- [Release notes](https://github.com/janl/mustache.js/releases)
- [Changelog](https://github.com/janl/mustache.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/janl/mustache.js/compare/v3.2.1...v4.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-01 13:27:45 +00:00
Daniel Imms 97ef539a6c Merge pull request #2803 from Tyriar/more_deps
Upgrade more deps
2020-04-01 06:25:58 -07:00
Daniel Imms b630aad44a Namespace window 2020-04-01 05:25:39 -07:00
Daniel Imms 2f6fb4b97c Upgrade jsdom 2020-03-31 11:10:39 -07:00
Daniel Imms 5c99114b02 Upgrade nyc 2020-03-31 11:07:26 -07:00
Daniel Imms 318421df9d Update more types 2020-03-31 11:01:33 -07:00
Daniel Imms 2f42dc6473 Upgrade chai to 4 2020-03-31 10:59:15 -07:00
Daniel Imms 66bcdc3c00 Update some more dependencies 2020-03-31 10:55:55 -07:00
Daniel Imms 8b042caf60 Merge pull request #2792 from xtermjs/dependabot/npm_and_yarn/mocha-7.1.1
Bump mocha from 6.2.3 to 7.1.1
2020-03-31 09:12:50 -07:00
dependabot-preview[bot] b3408f5ad4 Bump mocha from 6.2.3 to 7.1.1
Bumps [mocha](https://github.com/mochajs/mocha) from 6.2.3 to 7.1.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v6.2.3...v7.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 14:33:22 +00:00
Daniel Imms 5558bc1ef3 Merge pull request #2780 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.3
Bump @types/ws from 6.0.1 to 7.2.3
2020-03-31 07:31:37 -07:00
dependabot-preview[bot] 2426a731fc Bump @types/ws from 6.0.1 to 7.2.3
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 6.0.1 to 7.2.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/ws)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 14:14:25 +00:00
Daniel Imms 47e2b0991a Merge pull request #2801 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.10
Bump @types/webpack from 4.41.9 to 4.41.10
2020-03-31 07:12:46 -07:00
dependabot-preview[bot] ceec98ffc3 Bump @types/webpack from 4.41.9 to 4.41.10
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.9 to 4.41.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-31 08:10:36 +00:00
Daniel Imms a24b977f72 Merge pull request #2800 from Tyriar/upgrade_mac
Upgrade mac agent in pipelines
2020-03-30 10:00:29 -07:00
Daniel Imms 4602ffba29 Merge pull request #2799 from Tyriar/enum_like_upper_case
Allow enum-like objects to use upper case naming
2020-03-30 06:46:48 -07:00
Daniel Imms 21d4ee8e2e Upgrade mac agent in pipelines
Looks like capacity has run out for old macOS, this should get builds
green again.
2020-03-30 06:43:45 -07:00
Daniel Imms 8ec41a7128 Merge pull request #2795 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.9
Bump @types/webpack from 4.41.8 to 4.41.9
2020-03-30 06:42:12 -07:00
Daniel Imms 8842625bb4 Allow enum-like objects to use upper case naming 2020-03-30 06:17:37 -07:00
dependabot-preview[bot] 586be86b41 Bump @types/webpack from 4.41.8 to 4.41.9
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.8 to 4.41.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-30 08:38:01 +00:00
Daniel Imms 55190fd703 Merge pull request #2786 from Tyriar/eslint
Migrate from tslint to eslint
2020-03-28 08:57:58 -07:00
Daniel Imms 64f7978037 Format eslintrc 2020-03-28 07:50:30 -07:00
Daniel Imms 3f33751ff2 Merge remote-tracking branch 'ups/master' into eslint 2020-03-28 07:45:06 -07:00
Daniel Imms 392f349da1 Remove tslint completely 2020-03-28 07:39:51 -07:00
Daniel Imms bbd83b9dba Migrate whitespace tslint rule 2020-03-28 07:34:49 -07:00
Daniel Imms 2e9b4779c9 Migrate from typedef to explicit-function-return-type 2020-03-28 07:10:08 -07:00
Daniel Imms 8475f95b19 Disable naming convention on CoreMouseService
Until #2787 gets looked at
2020-03-28 07:04:21 -07:00
Daniel Imms 2c0669c865 Fix some naming conventions issues 2020-03-28 06:57:55 -07:00
Daniel Imms 937b551ae4 Migrate naming-convention rules to @typescript/eslint equivalent 2020-03-28 06:53:15 -07:00
Daniel Imms 88a50d3779 Fix most rules 2020-03-28 06:51:36 -07:00
Daniel Imms 57be6616ce Initial eslintrc.js
Generated by tool
2020-03-28 05:10:03 -07:00
Daniel Imms 7e073e6e26 Merge pull request #2783 from Tyriar/deps
Update several dependencies
2020-03-27 18:31:28 -07:00
Daniel Imms 10ff95af6a Update several dependencies 2020-03-27 16:50:49 -07:00
Daniel Imms 378d3e3889 Merge pull request #2772 from xtermjs/dependabot/npm_and_yarn/https-proxy-agent-2.2.4
[Security] Bump https-proxy-agent from 2.2.1 to 2.2.4
2020-03-27 16:06:29 -07:00
dependabot-preview[bot] 88f1353670 [Security] Bump https-proxy-agent from 2.2.1 to 2.2.4
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.1 to 2.2.4. **This update includes security fixes.**
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.1...2.2.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-27 22:52:12 +00:00
Daniel Imms c229aa8cfe Merge pull request #2760 from xtermjs/dependabot/npm_and_yarn/acorn-5.7.4
Bump acorn from 5.7.1 to 5.7.4
2020-03-27 15:50:55 -07:00
dependabot[bot] 96549a5421 Bump acorn from 5.7.1 to 5.7.4
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.1 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.1...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>
2020-03-27 22:45:12 +00:00
Daniel Imms a99c6145a7 Merge pull request #2779 from xtermjs/dependabot/npm_and_yarn/webpack-cli-3.3.11
Bump webpack-cli from 3.1.0 to 3.3.11
2020-03-27 15:44:21 -07:00
dependabot-preview[bot] c85ab8dcb6 Bump webpack-cli from 3.1.0 to 3.3.11
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.1.0 to 3.3.11.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/next/CHANGELOG_v3.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v.3.1.0...v3.3.11)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-27 21:32:21 +00:00
Daniel Imms db172b341e Merge pull request #2770 from xtermjs/dependabot/npm_and_yarn/deep-equal-2.0.1
Bump deep-equal from 1.1.0 to 2.0.1
2020-03-27 14:28:06 -07:00
dependabot-preview[bot] 11dbba422f Bump deep-equal from 1.1.0 to 2.0.1
Bumps [deep-equal](https://github.com/inspect-js/node-deep-equal) from 1.1.0 to 2.0.1.
- [Release notes](https://github.com/inspect-js/node-deep-equal/releases)
- [Changelog](https://github.com/inspect-js/node-deep-equal/blob/master/CHANGELOG.md)
- [Commits](https://github.com/inspect-js/node-deep-equal/compare/v1.1.0...v2.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-27 21:01:51 +00:00
Felix Seidl a1e60045d9 Merge branch 'master' into fix-edge-selection-color 2020-03-25 17:53:08 +01:00
Charles Wei b36a9d5af3 Merge branch 'master' into master 2020-03-24 21:15:20 +08:00
Daniel Imms fb5ff49008 Merge pull request #2767 from JavaCS3/fix/addDisposableDomListener-leak
fix: addDisposableDomListener dispose() leaking
2020-03-23 06:42:22 -07:00
javacs3 1b857f743e fix: addDisposableDomListener dispose() leaking 2020-03-22 12:56:50 +08:00
javacs3 c2df14cfa0 reduce BufferApiView object creation times 2020-03-22 12:13:53 +08:00
javacs3 44ff7b0f5f change buffer interface from IBuffer to IBufferNamespace 2020-03-22 12:13:52 +08:00
javacs3 5fdbd7428b expose IBufferSet API 2020-03-22 12:10:02 +08:00
Daniel Imms bc9aaebd04 Merge pull request #2766 from Tyriar/readme
Improve demo warning and add to server.js as well
2020-03-19 18:29:01 -07:00
Daniel Imms d90a0ce910 Improve demo warning and add to server.js as well
Fixes #2765
2020-03-19 18:26:45 -07:00
Daniel Imms 9c19043fed Merge pull request #2761 from slel/patch-1
Add CoCalc to "Real-world uses" in README
2020-03-16 06:59:22 -07:00
Samuel Lelièvre beb39ada0c Add CoCalc at end of list of real-world uses 2020-03-16 13:43:42 +01:00
Samuel Lelièvre 47f3eb28a6 Add CoCalc to "Real-world uses" in README 2020-03-16 04:32:34 +01:00
Daniel Imms 28105af761 Merge pull request #2731 from jerch/fix_2729
Clamp visual cursor to cols - 1
2020-03-13 19:26:46 -07:00
Daniel Imms e0ac87e702 Update xterm.d.ts 2020-03-13 19:17:34 -07:00
Daniel Imms b9ea05f97a Merge branch 'master' into fix_2729 2020-03-13 19:09:13 -07:00
Daniel Imms e348163689 Merge pull request #2758 from Tyriar/acorn
Upgrade acorn due to CVE
2020-03-13 18:53:48 -07:00
Daniel Imms 90375531bc Merge branch 'master' into acorn 2020-03-13 18:42:49 -07:00
Daniel Imms ca85f2d725 Upgrade acorn due to CVE 2020-03-13 18:42:10 -07:00
jerch eaadb75d39 Merge pull request #2754 from jerch/fix_vtfeatures_2
vtfeatures 2nd fix
2020-03-11 00:09:53 +01:00
Jörg Breitbart f6793df94a remove leading empty line 2020-03-10 23:59:41 +01:00
jerch 90e716b932 Merge pull request #2753 from jerch/fix_vtfeatures_template
fix missing jekyll header in vtfeatures template
2020-03-10 23:43:48 +01:00
Jörg Breitbart db2853c8ae add missing jekyll yaml entries 2020-03-10 23:35:08 +01:00
Jörg Breitbart 120527cb41 underline color support, test cases 2020-03-08 22:56:58 +01:00
Jörg Breitbart 058f33cd7b update vt docs 2020-03-08 20:25:26 +01:00
Jörg Breitbart 88582726b7 implement SGR 21, sequence tests 2020-03-08 20:08:22 +01:00
Jörg Breitbart fd5f5e3204 extend AttributeData with eAttrs, implement SGR 4 subparams, tests 2020-03-08 18:57:05 +01:00
Jörg Breitbart 47d7a71ad0 fix cursor reset in DECSTR, some tests 2020-03-01 13:29:18 +01:00
Felix Seidl 88a6be16af use original css color string 2020-02-27 23:03:23 +01:00
jerch 23cacbf81a Merge branch 'master' into reverse_wraparound 2020-02-22 23:49:25 +01:00
Jörg Breitbart db304513b1 unify naming, adjust addon version, fix interface description 2020-02-22 20:30:36 +01:00
Jörg Breitbart 8d1b4bf78f fix webgl renderer 2020-02-22 20:18:45 +01:00
Jörg Breitbart 1cff37af99 fix dom renderer 2020-02-22 20:08:34 +01:00
jerch ecc7f2d780 Merge branch 'master' into fix_2729 2020-02-22 19:57:53 +01:00
Daniel Imms dbb6610d50 Merge pull request #2730 from Tyriar/ts38
typescript@3.8
2020-02-22 19:53:40 +01:00
Daniel Imms ae135ac181 Merge pull request #2730 from Tyriar/ts38
typescript@3.8
2020-02-22 10:04:07 -08:00
Daniel Imms df1d68b626 typescript@3.8 2020-02-22 09:43:16 -08:00
Jörg Breitbart d35d12f671 Merge branch 'reverse_wraparound' of github.com:jerch/xterm.js into reverse_wraparound 2020-02-21 18:24:55 +01:00
Jörg Breitbart cb31179274 respect scroll margins, tests 2020-02-21 18:23:00 +01:00
kumaran-14 c9277c3c72 Remove altEscape DECSET mode and add support for alt+esc key 2020-02-21 13:13:46 +05:30
kumaran-14 5896a05ca6 Change decset flag to altEscMode 2020-02-20 00:21:33 +05:30
jerch 5cf0aadd84 Merge branch 'master' into reverse_wraparound 2020-02-18 20:12:55 +01:00
Daniel Imms a18bac7380 Remove browser args 2020-02-18 07:47:01 -08:00
Daniel Imms 9a1c7953e7 dumpio in browser launch 2020-02-18 07:39:15 -08:00
Daniel Imms 53c526f48c Improve Linux dependencies, enable WebKit 2020-02-18 06:49:11 -08:00
Daniel Imms 49bfd05d7c Merge pull request #2723 from UziTech/patch-1
atom-xterm -> x-terminal
2020-02-18 06:33:24 -08:00
Jörg Breitbart 62ea2c691e wide char tests 2020-02-17 12:39:36 +01:00
Jörg Breitbart 7de600cc64 test case for clearing cells to the right on early wrap-around 2020-02-17 12:30:35 +01:00
Jörg Breitbart 0c703276b1 fix behavior, first BS tests 2020-02-17 12:22:53 +01:00
Tony Brix 11ac8da14e Update README.md 2020-02-17 00:04:47 -06:00
Jörg Breitbart f736b6c299 comment missing empty cell handling 2020-02-16 20:53:53 +01:00
Jörg Breitbart 6f886fe167 working draft 2020-02-16 20:41:55 +01:00
Daniel Imms 986baed290 Merge pull request #2722 from Tyriar/linux_tests
Install deps for webkit and firefox on Linux
2020-02-16 08:08:20 -08:00
Daniel Imms 84c5f76b76 Remove webkit tests on Linux 2020-02-16 07:57:28 -08:00
Tony Brix 39c6f41f0e atom-xterm -> x-terminal 2020-02-15 15:16:37 -06:00
Daniel Imms bdb01e6166 Remove DEBUG, test fit addon based on a range 2020-02-15 12:26:59 -08:00
Daniel Imms 35ddcdd266 Upgrade to ubuntu-18.04 2020-02-15 12:13:38 -08:00
Daniel Imms 7e8e1215ad Fix order 2020-02-15 12:09:57 -08:00
Daniel Imms 83abd7ef59 Change pipeline property names 2020-02-15 12:07:19 -08:00
Daniel Imms 26fa6c97bf Install deps for webkit and firefox on Linux
Fixes #2721
2020-02-15 07:38:40 -08:00
Daniel Imms 708c6bdeb8 Merge pull request #2712 from jmbockhorst/playwright
Use playwright instead of puppeteer
2020-02-15 07:22:52 -08:00
Daniel Imms c73adf02bc Disable windows tests 2020-02-15 07:14:09 -08:00
Daniel Imms c36a468561 script -> pwsh 2020-02-15 07:08:42 -08:00
Daniel Imms 83794c433f Tweak windows server start 2020-02-15 07:05:20 -08:00
Daniel Imms eb82346ce7 Add a Windows test job 2020-02-15 06:40:04 -08:00
Daniel Imms 1a6ec0d768 Disable webkit on Linux 2020-02-15 06:39:10 -08:00
Daniel Imms 446f8f93c6 Disable firefox on linux 2020-02-15 06:27:03 -08:00
Daniel Imms 445a801d5d Fix syntax error 2020-02-15 06:21:05 -08:00
Daniel Imms 579a135087 Try firefox deps
https://bugzilla.mozilla.org/show_bug.cgi?id=1372998
2020-02-15 06:17:53 -08:00
Daniel Imms cd1b251cef Up timeout for slower CI agents 2020-02-15 06:07:33 -08:00
Daniel Imms ed23194abd Update macOS version 2020-02-15 06:00:59 -08:00
Daniel Imms 2ac0c0a957 Move playwright-core back to dev 2020-02-15 05:55:01 -08:00
Daniel Imms 477b161ba2 Change browserType back to sync 2020-02-15 05:51:39 -08:00
Daniel Imms cb1353c898 Cache yarn modules on integration test jobs 2020-02-15 05:48:38 -08:00
Daniel Imms 47dc137de0 Download browser at start of test 2020-02-15 05:47:42 -08:00
Daniel Imms 03c6b0c688 Fix typo in firefox job 2020-02-15 05:30:33 -08:00
Daniel Imms ffc5e2f446 Move to playwright-core, download browser if needed 2020-02-15 05:28:21 -08:00
Daniel Imms 4ebb61b580 Adopt playwright breaking changes 2020-02-15 05:18:46 -08:00
Daniel Imms 4ae25e57a3 playwright@0.11.1 2020-02-15 05:14:00 -08:00
Daniel Imms 7bd4f3874e Fix lint 2020-02-15 05:13:52 -08:00
Daniel Imms 2b7080294d Only start server once in pipelines 2020-02-15 05:06:44 -08:00
Daniel Imms 3b51565a13 Fix pipelines file 2020-02-15 05:02:28 -08:00
Daniel Imms 7400b888df Skip mouse wheel-related tests on non-chromium 2020-02-15 05:00:52 -08:00
Daniel Imms 3f15a7251b Skip webgl tests instead of not registering 2020-02-15 04:53:45 -08:00
Daniel Imms a9356fd377 Skip paste test when not Chromium 2020-02-15 04:43:38 -08:00
Daniel Imms f3eb9f79a1 Movee api test timeout into CLI args 2020-02-15 04:29:04 -08:00
Daniel Imms 93026bcae0 Only enable webgl tests on chromium and non-headless firefox
See microsoft/playwright#1032
2020-02-15 04:23:31 -08:00
Daniel Imms 6082c00b1d Fix serialize tests on firefox
Firefox takes longer to start up
2020-02-15 03:58:33 -08:00
Daniel Imms e6e181e6bc Fix firefox tests FitAddon tests 2020-02-15 03:54:30 -08:00
Daniel Imms 502452f58e Enable tests on other browsers 2020-02-15 03:35:08 -08:00
Daniel Imms 1d0cceb2d3 Merge branch 'master' into playwright 2020-02-15 03:26:37 -08:00
kumaran-14 b75ae0f7b1 Support alt+Enter key signal by default 2020-02-14 20:00:03 +05:30
Daniel Imms 5f0217cdb0 Merge pull request #2710 from jmbockhorst/linkFix
Fix Link Provider end positions
2020-02-13 08:49:45 -08:00
Daniel Imms 7b40aa89b4 Merge branch 'master' into linkFix 2020-02-13 08:36:43 -08:00
Jon Bockhorst e817a7b6c6 Add Linkifier2 tests 2020-02-13 00:43:24 -06:00
Jon Bockhorst b53c2e1a26 Fix tests 2020-02-13 00:15:12 -06:00
Jon Bockhorst 383e2ed46f Remove duplicate code and clean up after merge 2020-02-13 00:07:07 -06:00
Jon Bockhorst 258b084a62 Merge branch 'master' of https://github.com/xtermjs/xterm.js into playwright 2020-02-12 23:53:53 -06:00
Daniel Imms c5593bde08 Merge pull request #2711 from jmbockhorst/testing
Move openTerminal() to common util file
2020-02-12 16:12:47 -08:00
Daniel Imms 2cd4580154 Merge pull request #2715 from kumaran-14/2586_dom_renderer
Remove multiple usance of background-color in dom renderer
2020-02-12 16:05:38 -08:00
Jon Bockhorst 2442dc09b0 Clean up some stuff based on feedback 2020-02-12 16:00:21 -06:00
Jon Bockhorst d482ca5d68 Merge branch 'master' into testing 2020-02-12 14:34:30 -06:00
Jon Bockhorst 3616b697ec Remove unnecessary composite setting 2020-02-12 14:29:38 -06:00
Kumaran a19dfe608d Merge branch 'master' into 2586_dom_renderer 2020-02-12 23:12:28 +05:30
kumaran-14 0c1e9b6678 Remove multiple usance of background-color in dom renderer 2020-02-12 23:07:12 +05:30
Jon Bockhorst 391313cd39 Revert some formatting and remove puppeteer 2020-02-11 13:32:55 -06:00
Jon Bockhorst 8fb6ded506 Fix mouse tests for chromium 2020-02-11 13:13:03 -06:00
Jon Bockhorst eb7b2f4683 Make addons use common test functions 2020-02-11 11:39:36 -06:00
Jon Bockhorst 520918348e Fix some mouse tests 2020-02-10 18:18:23 -06:00
Jon Bockhorst e7b3910f3d Update CI to node 10 2020-02-10 17:05:18 -06:00
Jon Bockhorst 7515ed6146 Use playwright instead of puppeteer 2020-02-10 16:56:37 -06:00
Jon Bockhorst 901adb38ae Fix linkProvider end positions 2020-02-10 12:39:16 -06:00
Jon Bockhorst 522378a507 Move openTerminal() to common util file 2020-02-10 11:18:23 -06:00
Daniel Imms 1bb2fc912b Merge pull request #2709 from Tyriar/search_bump
Release search
2020-02-10 05:51:49 -08:00
Daniel Imms 423d112dfc Release search
0.4.0 isn't compatible with xterm@4.4
2020-02-10 05:51:02 -08:00
Daniel Imms 63fde03552 Merge pull request #2530 from jmbockhorst/linkParser
Basic link parser for better link detection
2020-02-08 11:12:10 -08:00
Daniel Imms d1d27b5367 Remove logs 2020-02-08 11:04:04 -08:00
Daniel Imms 0e302baa43 Mark link matcher API as deprecated 2020-02-08 10:58:58 -08:00
Daniel Imms a7c2d54e53 Document link provider argument in web links addon 2020-02-08 10:54:29 -08:00
Daniel Imms 54743eda16 Make link matcher API the default for web links addon 2020-02-08 10:52:36 -08:00
Daniel Imms 660cf26e49 Merge branch 'master' into linkParser 2020-02-07 12:47:25 -08:00
Daniel Imms e4875f26ff Add test for absense of hover/leave 2020-02-07 11:54:07 -08:00
Daniel Imms 7f1f22146d Add test for activate 2020-02-07 11:52:58 -08:00
Daniel Imms 0103c689f7 Start registerLinkProvider tests
Bugs fixed:

- Not breaking on first link match for multiple providers
- Hover event wasn't fired when on last character of link
2020-02-07 11:16:41 -08:00
Daniel Imms f4a31251cb handle -> activate 2020-02-07 09:59:25 -08:00
Daniel Imms b18ded0e2d Rename tooltip to hover/leave 2020-02-07 09:55:06 -08:00
Daniel Imms c327116e7f url -> text 2020-02-07 09:39:26 -08:00
Daniel Imms ef071ac7ac Polish API 2020-02-07 09:30:12 -08:00
Daniel Imms 56990f2a29 Merge pull request #2698 from xtermjs/Tyriar-patch-1
Fix grammar in demo
2020-02-07 09:13:58 -08:00
Daniel Imms 4475a82776 Fix grammar in demo 2020-02-07 09:13:03 -08:00
Daniel Imms 560a30662b Merge pull request #2696 from mofux/fix/serialize-addon-peer-dependency
Fix serialize addon peer dependency to xterm
2020-02-07 09:09:13 -08:00
Daniel Imms a066bbe32f 💄 2020-02-07 09:08:07 -08:00
Daniel Imms e252b4b674 Merge branch 'master' into linkParser 2020-02-07 09:04:24 -08:00
Thomas Zilz 3283ffb4e1 Fix serialize addon peer dependency to xterm 2020-02-06 12:27:02 +01:00
Jon Bockhorst a95b1b4881 Merge branch 'master' of https://github.com/xtermjs/xterm.js into linkParser 2020-02-04 11:40:48 -06:00
Jon Bockhorst a1906347b0 Only clear link if it was in the range of onRender and fix tests 2019-11-08 12:10:00 -06:00
Jon Bockhorst 8924aa736e Use onRender() instead of onData() and onScroll() 2019-11-08 11:08:50 -06:00
Daniel f93939ef20 Merge remote-tracking branch 'ups/master' into pr/jmbockhorst/2530 2019-11-08 08:46:09 -08:00
Jon Bockhorst 700c4acf75 Rework link parser to use a single cached link and make other requested changes 2019-11-08 02:14:53 -06:00
Jon Bockhorst f18a6fe1eb Fixed bug in link detection for wrapped links 2019-11-06 22:52:09 -06:00
Jon Bockhorst b07a6d10f1 Add test for multiline links 2019-11-05 23:44:30 -06:00
Jon Bockhorst ac6c8a5bd3 Support multiline links in the WebLinksAddon 2019-11-05 23:35:20 -06:00
Jon Bockhorst b3d95d20dc Merge branch 'master' of https://github.com/xtermjs/xterm.js into linkParser 2019-11-05 16:35:33 -06:00
Jon Bockhorst 28c43ac2bf Remove link caching 2019-11-05 13:01:53 -06:00
Jon Bockhorst fdfadfefbc Fixed link caching errors 2019-11-04 23:37:05 -06:00
Jon Bockhorst e57cb8bf7e Use regex parser for web links 2019-11-01 17:38:08 -05:00
Jon Bockhorst ec78fc7e7c Remove usage of ! operator 2019-11-01 13:42:02 -05:00
Jon Bockhorst cf082cca04 Fix links when viewport is scrolled 2019-11-01 11:24:21 -05:00
Jon Bockhorst 1e877a0f96 Fix lint errors 2019-11-01 09:18:45 -05:00
Jon Bockhorst 3e2e4ace48 Removed file detection from WebLinkProvider 2019-11-01 01:05:18 -05:00
Jon Bockhorst 0c5962c538 Added support for a basic link parser 2019-11-01 00:54:31 -05:00
190 changed files with 11602 additions and 7149 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
"dockerFile": "Dockerfile",
"appPort": 3000,
"extensions": [
"editorconfig.editorconfig",
"ms-vscode.vscode-typescript-tslint-plugin"
"dbaeumer.vscode-eslint",
"editorconfig.editorconfig"
]
}
-16
View File
@@ -1,16 +0,0 @@
node_modules/
*.swp
.lock-wscript
lib/
Makefile.gyp
*.Makefile
*.target.gyp.mk
*.node
example/*.log
docs/
npm-debug.log
/.idea/
.env
build/
.vscode/
.git/
+157
View File
@@ -0,0 +1,157 @@
{
"env": {
"browser": true,
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": [
"src/browser/tsconfig.json",
"src/common/tsconfig.json",
"test/api/tsconfig.json",
"test/benchmark/tsconfig.json",
"addons/xterm-addon-attach/src/tsconfig.json",
"addons/xterm-addon-fit/src/tsconfig.json",
"addons/xterm-addon-search/src/tsconfig.json",
"addons/xterm-addon-unicode11/src/tsconfig.json",
"addons/xterm-addon-web-links/src/tsconfig.json",
"addons/xterm-addon-webgl/src/tsconfig.json",
"addons/xterm-addon-serialize/src/tsconfig.json",
"addons/xterm-addon-serialize/benchmark/tsconfig.json",
"addons/xterm-addon-ligatures/src/tsconfig.json"
],
"sourceType": "module"
},
"ignorePatterns": [
"**/typings/*.d.ts",
"**/node_modules",
"**/*.js"
],
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-extra-semi": "error",
"@typescript-eslint/array-type": [
"warn",
{
"default": "array-simple",
"readonly": "generic"
}
],
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/explicit-function-return-type": [
"warn",
{
"allowExpressions": true
}
],
"@typescript-eslint/explicit-member-accessibility": [
"warn",
{
"accessibility": "explicit",
"overrides": {
"constructors": "off"
}
}
],
"@typescript-eslint/indent": [
"warn",
2
],
"@typescript-eslint/member-delimiter-style": [
"warn",
{
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "comma",
"requireLast": false
}
}
],
"@typescript-eslint/naming-convention": [
"warn",
{ "selector": "default", "format": ["camelCase"] },
// variableLike
{ "selector": "variable", "format": ["camelCase", "UPPER_CASE"] },
{ "selector": "variable", "filter": "^I.+Service$", "format": ["PascalCase"], "prefix": ["I"] },
// memberLike
{ "selector": "memberLike", "modifiers": ["private"], "format": ["camelCase"], "leadingUnderscore": "require" },
{ "selector": "memberLike", "modifiers": ["protected"], "format": ["camelCase"], "leadingUnderscore": "require" },
{ "selector": "enumMember", "format": ["UPPER_CASE"] },
// memberLike - Allow enum-like objects to use UPPER_CASE
{ "selector": "property", "modifiers": ["public"], "format": ["camelCase", "UPPER_CASE"] },
{ "selector": "method", "modifiers": ["public"], "format": ["camelCase", "UPPER_CASE"] },
// typeLike
{ "selector": "typeLike", "format": ["PascalCase"] },
{ "selector": "interface", "format": ["PascalCase"], "prefix": ["I"] }
],
"@typescript-eslint/prefer-namespace-keyword": "warn",
"@typescript-eslint/type-annotation-spacing": "warn",
"@typescript-eslint/quotes": [
"warn",
"single",
{ "allowTemplateLiterals": true }
],
"@typescript-eslint/semi": [
"warn",
"always"
],
"comma-dangle": [
"warn",
{
"objects": "never",
"arrays": "never",
"functions": "never"
}
],
"curly": [
"warn",
"multi-line"
],
"eol-last": "warn",
"eqeqeq": [
"warn",
"always"
],
"keyword-spacing": "warn",
"new-parens": "warn",
"no-duplicate-imports": "warn",
"no-else-return": [
"warn",
{
"allowElseIf": false
}
],
"no-eval": "warn",
"no-irregular-whitespace": "warn",
"no-restricted-imports": [
"warn",
{
"patterns": [
".*\\/out\\/.*"
]
}
],
"no-trailing-spaces": "warn",
"no-unsafe-finally": "warn",
"no-var": "warn",
"one-var": [
"warn",
"never"
],
"prefer-const": "warn",
"spaced-comment": [
"warn",
"always",
{
"markers": ["/"],
"exceptions": ["-"]
}
]
}
}
-1
View File
@@ -42,7 +42,6 @@
*.test.js
*.test.js.map
lib/test/
tslint.json
webpack.config.js
docs/
+2 -2
View File
@@ -1,4 +1,4 @@
{
"typescript.preferences.quoteStyle": "single",
"typescript.preferences.importModuleSpecifier": "non-relative"
"typescript.preferences.importModuleSpecifier": "non-relative",
"typescript.preferences.quoteStyle": "single"
}
-19
View File
@@ -1,19 +0,0 @@
FROM node:8
MAINTAINER Paris Kasidiaris <paris@sourcelair.com>
# Set the working directory
WORKDIR /usr/src/app
# Set an entrypoint, to automatically install node modules
ENTRYPOINT ["/bin/bash", "-c", "if [[ ! -d node_modules ]]; then npm install; fi; exec \"${@:0}\";"]
CMD ["npm", "run", "start"]
# First, install dependencies to improve layer caching
COPY package.json /usr/src/app/
RUN npm install
# Add the code
COPY . /usr/src/app
# Run the tests and build, to make sure everything is working nicely
RUN npm run build && npm run test
+9 -1
View File
@@ -159,7 +159,15 @@ Xterm.js is used in several world-class applications to provide great terminal e
- [**Gus**](https://gus.jp): A shared coding pad where you can run Python with xterm.js
- [**Linode**](https://linode.com): Linode uses xterm.js to provide users a web console for their Linode instances.
- [**FluffOS**](https://www.fluffos.info): Active maintained LPMUD driver with websocket support.
- [**x-terminal**](https://atom.io/packages/x-terminal): Atom plugin for providing terminals inside your Atom workspace.
- [**CoCalc**](https://cocalc.com/): Lots of free software pre-installed, to chat, collaborate, develop, program, publish, research, share, teach, in C++, HTML, Julia, Jupyter, LaTeX, Markdown, Python, R, SageMath, Scala, ...
- [**Dank Domain**](https://www.DDgame.us/): Open source multiuser medieval game supporting old & new terminal emulation.
- [**DockerStacks**](https://docker-stacks.com/): Local LAMP/LEMP development studio
- [**Codecademy**](https://codecademy.com/): Uses xterm.js in its courses on Bash.
- [**Laravel Ssh Web Client**](https://github.com/roke22/Laravel-ssh-client): Laravel server inventory with ssh web client to connect at server using xterm.js
- [**Repl.it**](https://repl.it): Collaborative browser based IDE with support for 50+ different languages.
- [**TeleType**](https://github.com/akshaykmr/TeleType): cli tool that allows you to share your terminal online conveniently. Show off mad cli-fu, help a colleague, teach, or troubleshoot.
- [**Intervue**](https://www.intervue.io): Pair programming for interviews. Multiple programming languages supported, with results displayed by xterm.js.
[And much more...](https://github.com/xtermjs/xterm.js/network/dependents)
Do you use xterm.js in your application as well? Please [open a Pull Request](https://github.com/sourcelair/xterm.js/pulls) to include it here. We would love to have it in our list. Note: Please add any new contributions to the end of the list only.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-attach",
"version": "0.5.0",
"version": "0.6.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -3,77 +3,51 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { assert } from 'chai';
import { ITerminalOptions } from 'xterm';
import WebSocket = require('ws');
import { openTerminal, pollFor, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 800;
const height = 600;
describe('AttachAddon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
});
after(async () => {
await browser.close();
});
beforeEach(async function(): Promise<any> {
this.timeout(20000);
await page.goto(APP);
});
beforeEach(async () => await page.goto(APP));
it('string', async function(): Promise<any> {
this.timeout(20000);
await openTerminal({ rendererType: 'dom' });
await openTerminal(page, { rendererType: 'dom' });
const port = 8080;
const server = new WebSocket.Server({ port });
server.on('connection', socket => socket.send('foo'));
await page.evaluate(`window.term.loadAddon(new window.AttachAddon(new WebSocket('ws://localhost:${port}')))`);
await pollFor(page, `window.term.buffer.getLine(0).translateToString(true)`, 'foo');
await pollFor(page, `window.term.buffer.active.getLine(0).translateToString(true)`, 'foo');
server.close();
});
it('utf8', async function(): Promise<any> {
this.timeout(20000);
await openTerminal({ rendererType: 'dom' });
await openTerminal(page, { rendererType: 'dom' });
const port = 8080;
const server = new WebSocket.Server({ port });
const data = new Uint8Array([102, 111, 111]);
server.on('connection', socket => socket.send(data));
await page.evaluate(`window.term.loadAddon(new window.AttachAddon(new WebSocket('ws://localhost:${port}')))`);
await pollFor(page, `window.term.buffer.getLine(0).translateToString(true)`, 'foo');
await pollFor(page, `window.term.buffer.active.getLine(0).translateToString(true)`, 'foo');
server.close();
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
async function pollFor(page: puppeteer.Page, fn: string, val: any): Promise<void> {
const result = await page.evaluate(fn);
if (result !== val) {
return new Promise<void>(r => {
setTimeout(() => r(pollFor(page, fn, val)), 10);
});
}
}
+5 -1
View File
@@ -10,7 +10,11 @@
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-fit",
"version": "0.3.0",
"version": "0.4.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
+28 -33
View File
@@ -3,28 +3,27 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { assert } from 'chai';
import { ITerminalOptions } from 'xterm';
import { openTerminal, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 1024;
const height = 768;
describe('FitAddon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
await page.goto(APP);
await openTerminal();
await openTerminal(page);
});
after(async () => {
@@ -43,18 +42,18 @@ describe('FitAddon', () => {
it('default', async function(): Promise<any> {
await loadFit();
assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), {
cols: 87,
rows: 26
});
const dimensions: {cols: number, rows: number} = await page.evaluate(`window.fit.proposeDimensions()`);
assert.equal(dimensions.cols, 87);
assert.isAbove(dimensions.rows, 24);
assert.isBelow(dimensions.rows, 29);
});
it('width', async function(): Promise<any> {
await loadFit(1008);
assert.deepEqual(await page.evaluate(`window.fit.proposeDimensions()`), {
cols: 110,
rows: 26
});
const dimensions: {cols: number, rows: number} = await page.evaluate(`window.fit.proposeDimensions()`);
assert.equal(dimensions.cols, 110);
assert.isAbove(dimensions.rows, 24);
assert.isBelow(dimensions.rows, 29);
});
it('small', async function(): Promise<any> {
@@ -74,15 +73,21 @@ describe('FitAddon', () => {
it('default', async function(): Promise<any> {
await loadFit();
await page.evaluate(`window.fit.fit()`);
assert.equal(await page.evaluate(`window.term.cols`), 87);
assert.equal(await page.evaluate(`window.term.rows`), 26);
const cols: number = await page.evaluate(`window.term.cols`);
const rows: number = await page.evaluate(`window.term.rows`);
assert.equal(cols, 87);
assert.isAbove(rows, 24);
assert.isBelow(rows, 29);
});
it('width', async function(): Promise<any> {
await loadFit(1008);
await page.evaluate(`window.fit.fit()`);
assert.equal(await page.evaluate(`window.term.cols`), 110);
assert.equal(await page.evaluate(`window.term.rows`), 26);
const cols: number = await page.evaluate(`window.term.cols`);
const rows: number = await page.evaluate(`window.term.rows`);
assert.equal(cols, 110);
assert.isAbove(rows, 24);
assert.isBelow(rows, 29);
});
it('small', async function(): Promise<any> {
@@ -106,13 +111,3 @@ async function loadFit(width: number = 800, height: number = 450): Promise<void>
async function unloadFit(): Promise<void> {
await page.evaluate(`window.fit.dispose();`);
}
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
+2 -2
View File
@@ -38,7 +38,7 @@ export class FitAddon implements ITerminalAddon {
}
// TODO: Remove reliance on private API
const core = (<any>this._terminal)._core;
const core = (this._terminal as any)._core;
// Force a full render
if (this._terminal.rows !== dims.rows || this._terminal.cols !== dims.cols) {
@@ -57,7 +57,7 @@ export class FitAddon implements ITerminalAddon {
}
// TODO: Remove reliance on private API
const core = (<any>this._terminal)._core;
const core = (this._terminal as any)._core;
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
+5 -1
View File
@@ -10,7 +10,11 @@
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
+13
View File
@@ -0,0 +1,13 @@
node_modules/
.nyc_output/
coverage/
lib/
fonts/
.env
.vscode/
*.swp
*.tgz
npm-debug.log*
yarn-error.log*
+48
View File
@@ -0,0 +1,48 @@
# Blacklist - exclude everything except npm defaults such as LICENSE, etc
*
!*/
# Whitelist - entries to be included must be negated with "!"
!*.js
!*.json
# Whitelist - lib/
!lib/**/*.d.ts
!lib/**/*.js
!lib/**/*.js.map
# Whitelist - out/
!out/**/*.d.ts
!out/**/*.js
!out/**/*.js.map
# Whitelist - src/
!src/**/*.ts
!src/**/*.d.ts
!src/**/*.js
!src/**/*.js.map
# Whitelist - typings/
!typings/**/*.d.ts
# Blacklist - (normal behavior) these will override any whitelist
*.test.ts
*.test.d.ts
*.test.js
*.test.js.map
docs/
/.idea/
.vscode/
coverage/
.nyc_output/
fonts/
**/*.api.js
**/*.api.ts
tsconfig.json
.yarnrc
webpack.config.js
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+53
View File
@@ -0,0 +1,53 @@
## xterm-addon-ligatures
Add support for programming ligatures to [xterm.js] when running in environments with access to [Node.js] APIs (such as [Electron]).
### Requirements
* [Node.js] 8.x or higher (present in [Electron] 1.8.3 or higher)
* [xterm.js] 4.0.0 or higher using the default canvas renderer
### Install
```bash
npm install --save xterm-addon-ligatures
```
### Usage
```ts
import { Terminal } from 'xterm';
import { LigaturesAddon } from 'xterm-addon-ligatures';
const terminal = new Terminal();
const ligaturesAddon = new LigaturesAddon();
terminal.open(containerElement);
terminal.loadAddon(ligaturesAddon);
```
### How It Works
In a browser environment, font ligature information is read directly by the web browser and used to render text correctly without any intervention from the developer. As of version 3, xterm.js uses the canvas to render characters individually, resulting in a significant performance boost. However, this means that it can no longer lean on the browser to determine when to draw font ligatures.
This package locates the font file on disk for the font currently in use by the terminal and parses the ligature information out of it (via the [font-ligatures] package). As text is rendered in xterm.js, this package annotates it with the locations of ligatures, allowing xterm.js to render it correctly.
Since this package depends on being able to find and resolve a system font from disk, it has to have system access that isn't available in the web browser. As a result, this package is mainly useful in environments that combine browser and Node.js runtimes (such as [Electron]).
### Fonts
This package makes use of the following fonts for testing:
* [Fira Code][Fira Code] - [Licensed under the OFL][Fira Code License] by Nikita
Prokopov, Mozilla Foundation with reserved names Fira Code, Fira Mono, and
Fira Sans
* [Iosevka] - [Licensed under the OFL][Iosevka License] by Belleve Invis with
reserved name Iosevka
[xterm.js]: https://github.com/xtermjs/xterm.js
[Electron]: https://electronjs.org/
[Node.js]: https://nodejs.org/
[font-ligatures]: https://github.com/princjef/font-ligatures
[Fira Code]: https://github.com/tonsky/FiraCode
[Fira Code License]: https://github.com/tonsky/FiraCode/blob/master/LICENSE
[Iosevka]: https://github.com/be5invis/Iosevka
[Iosevka License]: https://github.com/be5invis/Iosevka/blob/master/LICENSE.md
@@ -0,0 +1,75 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
const fs = require('fs');
const path = require('path');
const util = require('util');
const axios = require('axios').default;
const mkdirp = require('mkdirp');
const yauzl = require('yauzl');
const urls = {
fira: 'https://github.com/tonsky/FiraCode/raw/d42e7276fa925e5f82748f3ec9ea429736611b48/distr/otf/FiraCode-Regular.otf',
iosevka: 'https://github.com/be5invis/Iosevka/releases/download/v1.14.3/01-iosevka-1.14.3.zip'
};
const writeFile = util.promisify(fs.writeFile);
const fontsFolder = path.join(__dirname, '../fonts');
async function download() {
await mkdirp(fontsFolder);
await downloadFiraCode();
await downloadIosevka();
console.log('Loaded all fonts for testing')
}
async function downloadFiraCode() {
const file = path.join(fontsFolder, 'firaCode.otf');
if (await util.promisify(fs.exists)(file)) {
console.log('Fira Code already loaded');
} else {
console.log('Downloading Fira Code...');
await writeFile(
file,
(await axios.get(urls.fira, { responseType: 'arraybuffer' })).data
);
}
}
async function downloadIosevka() {
const file = path.join(fontsFolder, 'iosevka.ttf');
if (await util.promisify(fs.exists)(file)) {
console.log('Iosevka already loaded');
} else {
console.log('Downloading Iosevka...');
const iosevkaContents = (await axios.get(urls.iosevka, { responseType: 'arraybuffer' })).data;
const iosevkaZipfile = await util.promisify(yauzl.fromBuffer)(iosevkaContents);
await new Promise((resolve, reject) => {
iosevkaZipfile.on('entry', entry => {
if (entry.fileName === 'ttf/iosevka-regular.ttf') {
iosevkaZipfile.openReadStream(entry, (err, stream) => {
if (err) {
return reject(err);
}
const writeStream = fs.createWriteStream(file);
stream.pipe(writeStream);
writeStream.on('close', () => resolve());
});
}
});
});
}
}
download();
process.on('unhandledRejection', e => {
console.error(e);
process.exit(1);
});
+47
View File
@@ -0,0 +1,47 @@
{
"name": "xterm-addon-ligatures",
"version": "0.3.0",
"description": "Add support for programming ligatures to xterm.js",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/xterm-addon-ligatures.js",
"types": "typings/xterm-addon-ligatures.d.ts",
"repository": "https://github.com/xtermjs/xterm.js",
"engines": {
"node": ">8.0.0"
},
"scripts": {
"prepare": "node bin/download-fonts.js",
"build": "tsc -p src",
"watch": "tsc -w -p src",
"prepackage": "npm run build",
"package": "webpack",
"pretest": "npm run build",
"test": "nyc mocha out/**/*.test.js",
"prepublish": "npm run package"
},
"keywords": [
"font",
"ligature",
"xterm",
"xterm.js",
"terminal"
],
"license": "MIT",
"dependencies": {
"font-finder": "^1.0.4",
"font-ligatures": "^1.3.3"
},
"devDependencies": {
"@types/sinon": "^5.0.1",
"axios": "^0.18.0",
"mkdirp": "0.5.5",
"sinon": "6.3.5",
"yauzl": "^2.10.0"
},
"peerDependencies": {
"xterm": "^4.0.0"
}
}
@@ -0,0 +1,23 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { Terminal } from 'xterm';
import { enableLigatures } from '.';
export interface ITerminalAddon {
activate(terminal: Terminal): void;
dispose(): void;
}
export class LigaturesAddon implements ITerminalAddon {
constructor() {}
public activate(terminal: Terminal): void {
enableLigatures(terminal);
}
public dispose(): void {}
}
+53
View File
@@ -0,0 +1,53 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import * as fontFinder from 'font-finder';
import * as fontLigatures from 'font-ligatures';
import parse from './parse';
let fontsPromise: Promise<fontFinder.FontList> | undefined = undefined;
/**
* Loads the font ligature wrapper for the specified font family if it could be
* resolved, throwing if it is unable to find a suitable match.
* @param fontFamily The CSS font family definition to resolve
* @param cacheSize The size of the ligature cache to maintain if the font is resolved
*/
export default async function load(fontFamily: string, cacheSize: number): Promise<fontLigatures.Font | undefined> {
if (!fontsPromise) {
fontsPromise = fontFinder.list();
}
const fonts = await fontsPromise;
for (const family of parse(fontFamily)) {
// If we reach one of the generic font families, the font resolution
// will end for the browser and we can't determine the specific font
// used. Throw.
if (genericFontFamilies.includes(family)) {
return undefined;
}
if (fonts.hasOwnProperty(family) && fonts[family].length > 0) {
return await fontLigatures.loadFile(fonts[family][0].path, { cacheSize });
}
}
// If none of the fonts could resolve, throw an error
return undefined;
}
// https://drafts.csswg.org/css-fonts-4/#generic-font-families
const genericFontFamilies = [
'serif',
'sans-serif',
'cursive',
'fantasy',
'monospace',
'system-ui',
'emoji',
'math',
'fangsong'
];
@@ -0,0 +1,222 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import * as path from 'path';
import * as sinon from 'sinon';
import { assert } from 'chai';
import * as fontFinder from 'font-finder';
import * as fontLigatures from 'font-ligatures';
import * as ligatureSupport from '.';
describe('xterm-addon-ligatures', () => {
let onRefresh: sinon.SinonStub;
let term: MockTerminal;
// -> forms a ligature in Fira Code and Iosevka, but www only forms a ligature
// in Fira Code
const input = 'a -> b www c';
before(() => {
sinon.stub(fontFinder, 'list').returns(Promise.resolve({
// eslint-disable-next-line @typescript-eslint/naming-convention
'Fira Code': [{
path: path.join(__dirname, '../fonts/firaCode.otf'),
style: fontFinder.Style.Regular,
type: fontFinder.Type.Monospace,
weight: 400
}],
// eslint-disable-next-line @typescript-eslint/naming-convention
'Iosevka': [{
path: path.join(__dirname, '../fonts/iosevka.ttf'),
style: fontFinder.Style.Regular,
type: fontFinder.Type.Monospace,
weight: 400
}],
// eslint-disable-next-line @typescript-eslint/naming-convention
'Nonexistant Font': [{
path: path.join(__dirname, '../fonts/nonexistant.ttf'),
style: fontFinder.Style.Regular,
type: fontFinder.Type.Monospace,
weight: 400
}]
} as fontFinder.FontList));
});
beforeEach(() => {
onRefresh = sinon.stub();
term = new MockTerminal(onRefresh);
ligatureSupport.enableLigatures(term as any);
});
it('registers itself correctly', () => {
const term = new MockTerminal(sinon.spy());
assert.isUndefined(term.joiner);
ligatureSupport.enableLigatures(term as any);
assert.isFunction(term.joiner);
});
it('registers itself correctly when called directly', () => {
const term = new MockTerminal(sinon.spy());
assert.isUndefined(term.joiner);
ligatureSupport.enableLigatures(term as any);
assert.isFunction(term.joiner);
});
it('returns an empty set of ranges on the first call while the font is loading', () => {
assert.deepEqual(term.joiner!(input), []);
});
it('returns the correct set of ranges once the font has loaded', done => {
assert.deepEqual(term.joiner!(input), []);
onRefresh.callsFake(() => {
assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]);
done();
});
});
it('handles quoted font names', done => {
term.setOption('fontFamily', '"Fira Code", monospace');
assert.deepEqual(term.joiner!(input), []);
onRefresh.callsFake(() => {
assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]);
done();
});
});
it('falls back to later fonts if earlier ones are not present', done => {
term.setOption('fontFamily', 'notinstalled, Fira Code, monospace');
assert.deepEqual(term.joiner!(input), []);
onRefresh.callsFake(() => {
assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]);
done();
});
});
it('uses the current font value', done => {
// The first three calls are all synchronous so that we don't allow time for
// any fonts to load while we're switching things around
term.setOption('fontFamily', 'Fira Code');
assert.deepEqual(term.joiner!(input), []);
term.setOption('fontFamily', 'notinstalled');
assert.deepEqual(term.joiner!(input), []);
term.setOption('fontFamily', 'Iosevka');
assert.deepEqual(term.joiner!(input), []);
onRefresh.callsFake(() => {
assert.deepEqual(term.joiner!(input), [[2, 4]]);
// And switch it back to Fira Code for good measure
term.setOption('fontFamily', 'Fira Code');
// At this point, we haven't loaded the new font, so the result reverts
// back to empty until that happens
assert.deepEqual(term.joiner!(input), []);
onRefresh.callsFake(() => {
assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]);
done();
});
});
});
it('allows multiple terminal instances that use different fonts', done => {
const onRefresh2 = sinon.stub();
const term2 = new MockTerminal(onRefresh2);
term2.setOption('fontFamily', 'Iosevka');
ligatureSupport.enableLigatures(term2 as any);
assert.deepEqual(term.joiner!(input), []);
onRefresh.callsFake(() => {
assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]);
assert.deepEqual(term2.joiner!(input), []);
onRefresh2.callsFake(() => {
assert.deepEqual(term2.joiner!(input), [[2, 4]]);
assert.deepEqual(term.joiner!(input), [[2, 4], [7, 10]]);
done();
});
});
});
it('fails if it finds but cannot load the font', async () => {
term.setOption('fontFamily', 'Nonexistant Font, monospace');
assert.deepEqual(term.joiner!(input), []);
await delay(500);
assert.isTrue(onRefresh.notCalled);
assert.throws(() => term.joiner!(input));
});
it('returns nothing if the font is not present on the system', async () => {
term.setOption('fontFamily', 'notinstalled');
assert.deepEqual(term.joiner!(input), []);
await delay(500);
assert.isTrue(onRefresh.notCalled);
assert.deepEqual(term.joiner!(input), []);
});
it('returns nothing if no specific font is specified', async () => {
term.setOption('fontFamily', 'monospace');
assert.deepEqual(term.joiner!(input), []);
await delay(500);
assert.isTrue(onRefresh.notCalled);
assert.deepEqual(term.joiner!(input), []);
});
it('returns nothing if no fonts are provided', async () => {
term.setOption('fontFamily', '');
assert.deepEqual(term.joiner!(input), []);
await delay(500);
assert.isTrue(onRefresh.notCalled);
assert.deepEqual(term.joiner!(input), []);
});
it('fails when given malformed inputs', async () => {
term.setOption('fontFamily', {} as any);
assert.deepEqual(term.joiner!(input), []);
await delay(500);
assert.isTrue(onRefresh.notCalled);
assert.throws(() => term.joiner!(input));
});
it('ensures no empty errors are thrown', async () => {
sinon.stub(fontLigatures, 'loadFile').callsFake(async () => { throw undefined; });
term.setOption('fontFamily', 'Iosevka');
assert.deepEqual(term.joiner!(input), []);
await delay(500);
assert.isTrue(onRefresh.notCalled);
assert.throws(() => term.joiner!(input), 'Failure while loading font');
(fontLigatures.loadFile as sinon.SinonStub).restore();
});
});
class MockTerminal {
private _options: { [name: string]: string | number } = {
fontFamily: 'Fira Code, monospace',
rows: 50
};
public joiner?: (text: string) => [number, number][];
public refresh: (start: number, end: number) => void;
constructor(onRefresh: (start: number, end: number) => void) {
this.refresh = onRefresh;
}
public registerCharacterJoiner(handler: (text: string) => [number, number][]): number {
this.joiner = handler;
return 1;
}
public deregisterCharacterJoiner(id: number): void {
this.joiner = undefined;
}
public setOption(name: string, value: string | number): void {
this._options[name] = value;
}
public getOption(name: string): string | number {
return this._options[name];
}
}
function delay(delayMs: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, delayMs));
}
+85
View File
@@ -0,0 +1,85 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { Terminal } from 'xterm';
import { Font } from 'font-ligatures';
import load from './font';
const enum LoadingState {
UNLOADED,
LOADING,
LOADED,
FAILED
}
// Caches 100K characters worth of ligatures. In practice this works out to
// about 650 KB worth of cache, when a moderate number of ligatures are present.
const CACHE_SIZE = 100000;
/**
* Enable ligature support for the provided Terminal instance. To function
* properly, this must be called after `open()` is called on the therminal. If
* the font currently in use supports ligatures, the terminal will automatically
* start to render them.
* @param term Terminal instance from xterm.js
*/
export function enableLigatures(term: Terminal): void {
let currentFontName: string | undefined = undefined;
let font: Font | undefined = undefined;
let loadingState: LoadingState = LoadingState.UNLOADED;
let loadError: any | undefined = undefined;
term.registerCharacterJoiner((text: string): [number, number][] => {
// If the font hasn't been loaded yet, load it and return an empty result
const termFont = term.getOption('fontFamily');
if (
termFont &&
(loadingState === LoadingState.UNLOADED || currentFontName !== termFont)
) {
font = undefined;
loadingState = LoadingState.LOADING;
currentFontName = termFont;
const currentCallFontName = currentFontName;
load(currentCallFontName, CACHE_SIZE)
.then(f => {
// Another request may have come in while we were waiting, so make
// sure our font is still vaild.
if (currentCallFontName === term.getOption('fontFamily')) {
loadingState = LoadingState.LOADED;
font = f;
// Only refresh things if we actually found a font
if (f) {
term.refresh(0, term.getOption('rows') - 1);
}
}
})
.catch(e => {
// Another request may have come in while we were waiting, so make
// sure our font is still vaild.
if (currentCallFontName === term.getOption('fontFamily')) {
loadingState = LoadingState.FAILED;
font = undefined;
loadError = e;
}
});
}
if (font && loadingState === LoadingState.LOADED) {
// We clone the entries to avoid the internal cache of the ligature finder
// getting messed up.
return font.findLigatureRanges(text).map<[number, number]>(
range => [range[0], range[1]]
);
}
if (loadingState === LoadingState.FAILED) {
throw loadError || new Error('Failure while loading font');
}
return [];
});
}
@@ -0,0 +1,75 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { assert } from 'chai';
import parse from './parse';
// TODO: integrate tests from http://test.csswg.org/suites/css-fonts-4_dev/nightly-unstable/
describe('parse', () => {
it('parses individual families', () => {
assert.deepEqual(parse('monospace'), ['monospace']);
});
it('parses multiple families', () => {
assert.deepEqual(parse('Arial, Verdana, serif'), ['Arial', 'Verdana', 'serif']);
});
it('parses quoted families', () => {
assert.deepEqual(parse('"Times New Roman", serif'), ['Times New Roman', 'serif']);
});
it('parses single quoted families', () => {
assert.deepEqual(parse('\'Times New Roman\', serif'), ['Times New Roman', 'serif']);
});
it('parses families with spaces in their names', () => {
assert.deepEqual(parse('Times New Roman, serif'), ['Times New Roman', 'serif']);
});
it('collapses multiple spaces together in identifiers', () => {
assert.deepEqual(parse('Times New Roman, serif'), ['Times New Roman', 'serif']);
});
it('does not collapse multiple spaces together in quoted strings', () => {
assert.deepEqual(parse('"Times New Roman", serif'), ['Times New Roman', 'serif']);
});
it('handles escaped characters in strings', () => {
assert.deepEqual(parse('"quote \\" slash \\\\ slashquote \\\\\\"", serif'), ['quote " slash \\ slashquote \\"', 'serif']);
});
it('fails if a family has an unterminated string', () => {
assert.throws(() => parse('"Unterminated, serif'));
});
it('handles unicode escape sequences', () => {
assert.deepEqual(parse('"space\\20 between", serif'), ['space between', 'serif']);
});
it('swallows only the first space after a unicode escape', () => {
assert.deepEqual(parse('"two-space\\20 between", serif'), ['two-space between', 'serif']);
});
it('automatically ends the unicode escape after six digits', () => {
assert.deepEqual(parse('space\\000020between, serif'), ['space between', 'serif']);
});
it('handles unicode escapes at the end of the family', () => {
assert.deepEqual(parse('endswithbrace \\7b, serif'), ['endswithbrace {', 'serif']);
});
it('handles unicode escapes at the end of the input', () => {
assert.deepEqual(parse('endswithbrace \\7b'), ['endswithbrace {']);
});
it('handles other escaped characters in identifiers', () => {
assert.deepEqual(parse('has\\,comma'), ['has,comma']);
});
it('swallows escaped newlines in strings', () => {
assert.deepEqual(parse('"multi \\\nline", serif'), ['multi line', 'serif']);
});
});
+180
View File
@@ -0,0 +1,180 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*/
interface IParseContext {
input: string;
offset: number;
}
/**
* Parses a CSS font family value, returning the component font families
* contained within.
*
* @param family The CSS font family input string to parse
*/
export default function parse(family: string): string[] {
if (typeof family !== 'string') {
throw new Error('Font family must be a string');
}
const context: IParseContext = {
input: family,
offset: 0
};
const families = [];
let currentFamily = '';
// Work through the input character by character until there are none left.
// This lexing and parsing in one pass.
while (context.offset < context.input.length) {
const char = context.input[context.offset++];
switch (char) {
// String
case '\'':
case '"':
currentFamily += parseString(context, char);
break;
// End of family
case ',':
families.push(currentFamily);
currentFamily = '';
break;
default:
// Identifiers (whitespace between families is swallowed)
if (!/\s/.test(char)) {
context.offset--;
currentFamily += parseIdentifier(context);
families.push(currentFamily);
currentFamily = '';
}
}
}
return families;
}
/**
* Parse a CSS string.
*
* @param context Parsing input and offset
* @param quoteChar The quote character for the string (' or ")
*/
function parseString(context: IParseContext, quoteChar: '\'' | '"'): string {
let str = '';
let escaped = false;
while (context.offset < context.input.length) {
const char = context.input[context.offset++];
if (escaped) {
if (/[0-9a-fA-F]/.test(char)) {
// Unicode escape
context.offset--;
str += parseUnicode(context);
} else if (char !== '\n') {
// Newlines are ignored if escaped. Other characters are used as is.
str += char;
}
escaped = false;
} else {
switch (char) {
// Terminated quote
case quoteChar:
return str;
// Begin escape
case '\\':
escaped = true;
break;
// Add character to string
default:
str += char;
}
}
}
throw new Error('Unterminated string');
}
/**
* Parse a CSS custom identifier.
*
* @param context Parsing input and offset
*/
function parseIdentifier(context: IParseContext): string {
let str = '';
let escaped = false;
while (context.offset < context.input.length) {
const char = context.input[context.offset++];
if (escaped) {
if (/[0-9a-fA-F]/.test(char)) {
// Unicode escape
context.offset--;
str += parseUnicode(context);
} else {
// Everything else is used as is
str += char;
}
escaped = false;
} else {
switch (char) {
// Begin escape
case '\\':
escaped = true;
break;
// Terminate identifier
case ',':
return str;
default:
if (/\s/.test(char)) {
// Whitespace is collapsed into a single space within an identifier
if (!str.endsWith(' ')) {
str += ' ';
}
} else {
// Add other characters directly
str += char;
}
}
}
}
return str;
}
/**
* Parse a CSS unicode escape.
*
* @param context Parsing input and offset
*/
function parseUnicode(context: IParseContext): string {
let str = '';
while (context.offset < context.input.length) {
const char = context.input[context.offset++];
if (/\s/.test(char)) {
// The first whitespace character after a unicode escape indicates the end
// of the escape and is swallowed.
return unicodeToString(str);
}
if (str.length >= 6 || !/[0-9a-fA-F]/.test(char)) {
// If the next character is not a valid hex digit or we have reached the
// maximum of 6 digits in the escape, terminate the escape.
context.offset--;
return unicodeToString(str);
}
// Otherwise, just add it to the escape
str += char;
}
return unicodeToString(str);
}
/**
* Convert a unicode code point from a hex string to a utf8 string.
*
* @param codePoint Unicode code point represented as a hex string
*/
function unicodeToString(codePoint: string): string {
return String.fromCodePoint(parseInt(codePoint, 16));
}
@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"sourceMap": true,
"outDir": "../out",
"rootDir": ".",
"strict": true,
"noUnusedLocals": true,
"preserveWatchOutput": true
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
]
}
@@ -0,0 +1,34 @@
/**
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
* @license MIT
*
* This contains the type declarations for the xterm-addon-ligatures library.
* Note that some interfaces may differ between this file and the actual
* implementation in src/, that's because this file declares the *public* API
* which is intended to be stable and consumed by external programs.
*/
import { Terminal, ITerminalAddon } from 'xterm';
declare module 'xterm-addon-ligatures' {
/**
* An xterm.js addon that enables web links.
*/
export class LigaturesAddon implements ITerminalAddon {
/**
* Creates a new ligatures addon.
*/
constructor();
/**
* Activates the addon
* @param terminal The terminal the addon is being loaded in.
*/
public activate(terminal: Terminal): void;
/**
* Disposes the addon.
*/
public dispose(): void;
}
}
@@ -0,0 +1,36 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
const path = require('path');
const addonName = 'LigaturesAddon';
const mainFile = 'xterm-addon-ligatures.js';
module.exports = {
entry: `./out/${addonName}.js`,
devtool: 'source-map',
target: 'electron-renderer',
module: {
rules: [
{
test: /\.js$/,
use: ["source-map-loader"],
enforce: "pre",
exclude: /node_modules/
}
]
},
output: {
filename: mainFile,
path: path.resolve('./lib'),
library: addonName,
libraryTarget: 'umd'
},
mode: 'production',
externals: {
'font-finder':'font-finder',
'font-ligatures':'font-ligatures'
}
};
+236
View File
@@ -0,0 +1,236 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@sinonjs/commons@^1", "@sinonjs/commons@^1.0.2", "@sinonjs/commons@^1.3.0", "@sinonjs/commons@^1.7.0":
version "1.8.0"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.0.tgz#c8d68821a854c555bba172f3b06959a0039b236d"
integrity sha512-wEj54PfsZ5jGSwMX68G8ZXFawcSglQSXqCftWX3ec8MDUzQdHgcKvw97awHbY0efQEL5iKUOAmmVtoYgmrSG4Q==
dependencies:
type-detect "4.0.8"
"@sinonjs/formatio@^3.0.0", "@sinonjs/formatio@^3.2.1":
version "3.2.2"
resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-3.2.2.tgz#771c60dfa75ea7f2d68e3b94c7e888a78781372c"
integrity sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==
dependencies:
"@sinonjs/commons" "^1"
"@sinonjs/samsam" "^3.1.0"
"@sinonjs/samsam@^2.1.2":
version "2.1.3"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-2.1.3.tgz#62cf2a9b624edc795134135fe37fc2ae8ea36be3"
integrity sha512-8zNeBkSKhU9a5cRNbpCKau2WWPfan+Q2zDlcXvXyhn9EsMqgYs4qzo0XHNVlXC6ABQL8fT6nV+zzo5RTHJzyXw==
"@sinonjs/samsam@^3.1.0":
version "3.3.3"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-3.3.3.tgz#46682efd9967b259b81136b9f120fd54585feb4a"
integrity sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==
dependencies:
"@sinonjs/commons" "^1.3.0"
array-from "^2.1.1"
lodash "^4.17.15"
"@sinonjs/text-encoding@^0.7.1":
version "0.7.1"
resolved "https://registry.yarnpkg.com/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz#8da5c6530915653f3a1f38fd5f101d8c3f8079c5"
integrity sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==
"@types/sinon@^5.0.1":
version "5.0.1"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-5.0.1.tgz#a15b36ec42f1f53166617491feabd1734cb03e21"
array-from@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/array-from/-/array-from-2.1.1.tgz#cfe9d8c26628b9dc5aecc62a9f5d8f1f352c1195"
integrity sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=
axios@^0.18.0:
version "0.18.1"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.18.1.tgz#ff3f0de2e7b5d180e757ad98000f1081b87bcea3"
dependencies:
follow-redirects "1.5.10"
is-buffer "^2.0.2"
buffer-crc32@~0.2.3:
version "0.2.13"
resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"
debug@=3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
dependencies:
ms "2.0.0"
diff@^3.5.0:
version "3.5.0"
resolved "https://registry.yarnpkg.com/diff/-/diff-3.5.0.tgz#800c0dd1e0a8bfbc95835c202ad220fe317e5a12"
fd-slicer@~1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e"
dependencies:
pend "~1.2.0"
follow-redirects@1.5.10:
version "1.5.10"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.5.10.tgz#7b7a9f9aea2fdff36786a94ff643ed07f4ff5e2a"
dependencies:
debug "=3.1.0"
font-finder@^1.0.3, font-finder@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/font-finder/-/font-finder-1.0.4.tgz#2ca944954dd8d0e1b5bdc4c596cc08607761d89b"
dependencies:
get-system-fonts "^2.0.0"
promise-stream-reader "^1.0.1"
font-ligatures@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/font-ligatures/-/font-ligatures-1.3.3.tgz#63fff18dc8adb3a11fe5eec1f4e8d7edfa8075b9"
integrity sha512-NSGpHgVNX81M7AWS1XylK1UZbN3QllfUIDAAuPv6TUcl5O2b781JcKS5L2RopAU0AqlTyX3ZuX/04eaMpbVrHA==
dependencies:
font-finder "^1.0.3"
lru-cache "^4.1.3"
opentype.js "^0.8.0"
get-system-fonts@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/get-system-fonts/-/get-system-fonts-2.0.0.tgz#a43b9a33f05c0715a60176d2aad5ce6e98f0a3c6"
has-flag@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd"
is-buffer@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.3.tgz#4ecf3fcf749cbd1e472689e109ac66261a25e725"
isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
just-extend@^4.0.2:
version "4.1.0"
resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-4.1.0.tgz#7278a4027d889601640ee0ce0e5a00b992467da4"
integrity sha512-ApcjaOdVTJ7y4r08xI5wIqpvwS48Q0PBG4DJROcEkH1f8MdAiNFyFxz3xoL0LWAVwjrwPYZdVHHxhRHcx/uGLA==
lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
lodash@^4.17.15:
version "4.17.19"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
lolex@^2.7.5:
version "2.7.5"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.5.tgz#113001d56bfc7e02d56e36291cc5c413d1aa0733"
integrity sha512-l9x0+1offnKKIzYVjyXU2SiwhXDLekRzKyhnbyldPHvC7BvLPVpdNUNR2KeMAiCN2D/kLNttZgQD5WjSxuBx3Q==
lolex@^5.0.1:
version "5.1.2"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367"
integrity sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==
dependencies:
"@sinonjs/commons" "^1.7.0"
lru-cache@^4.1.3:
version "4.1.3"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.3.tgz#a1175cf3496dfc8436c156c334b4955992bce69c"
dependencies:
pseudomap "^1.0.2"
yallist "^2.1.2"
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
mkdirp@0.5.5:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
dependencies:
minimist "^1.2.5"
ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
nise@^1.4.5:
version "1.5.3"
resolved "https://registry.yarnpkg.com/nise/-/nise-1.5.3.tgz#9d2cfe37d44f57317766c6e9408a359c5d3ac1f7"
integrity sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==
dependencies:
"@sinonjs/formatio" "^3.2.1"
"@sinonjs/text-encoding" "^0.7.1"
just-extend "^4.0.2"
lolex "^5.0.1"
path-to-regexp "^1.7.0"
opentype.js@^0.8.0:
version "0.8.0"
resolved "https://registry.yarnpkg.com/opentype.js/-/opentype.js-0.8.0.tgz#acabcfa1642fbe894a3e4d759e43ba694e02bd35"
dependencies:
tiny-inflate "^1.0.2"
path-to-regexp@^1.7.0:
version "1.7.0"
resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d"
dependencies:
isarray "0.0.1"
pend@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50"
promise-stream-reader@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/promise-stream-reader/-/promise-stream-reader-1.0.1.tgz#4e793a79c9d49a73ccd947c6da9c127f12923649"
pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
sinon@6.3.5:
version "6.3.5"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.3.5.tgz#0f6d6a5b4ebaad1f6e8e019395542d1d02c144a0"
integrity sha512-xgoZ2gKjyVRcF08RrIQc+srnSyY1JDJtxu3Nsz07j1ffjgXoY6uPLf/qja6nDBZgzYYEovVkFryw2+KiZz11xQ==
dependencies:
"@sinonjs/commons" "^1.0.2"
"@sinonjs/formatio" "^3.0.0"
"@sinonjs/samsam" "^2.1.2"
diff "^3.5.0"
lodash.get "^4.4.2"
lolex "^2.7.5"
nise "^1.4.5"
supports-color "^5.5.0"
type-detect "^4.0.8"
supports-color@^5.5.0:
version "5.5.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f"
integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==
dependencies:
has-flag "^3.0.0"
tiny-inflate@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/tiny-inflate/-/tiny-inflate-1.0.2.tgz#93d9decffc8805bd57eae4310f0b745e9b6fb3a7"
type-detect@4.0.8, type-detect@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
yallist@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52"
yauzl@^2.10.0:
version "2.10.0"
resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"
dependencies:
buffer-crc32 "~0.2.3"
fd-slicer "~1.1.0"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-search",
"version": "0.4.0",
"version": "0.7.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -3,31 +3,29 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { assert } from 'chai';
import { ITerminalOptions } from 'xterm';
import { readFile } from 'fs';
import { resolve } from 'path';
import { openTerminal, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 800;
const height = 600;
describe('Search Tests', function (): void {
this.timeout(20000);
before(async function (): Promise<any> {
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
describe('Search Tests', function(): void {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
await page.goto(APP);
await openTerminal();
await openTerminal(page);
await page.evaluate(`window.search = new SearchAddon();`);
await page.evaluate(`window.term.loadAddon(window.search);`);
});
@@ -41,7 +39,7 @@ describe('Search Tests', function (): void {
});
it('Simple Search', async () => {
await writeSync('dafhdjfldshafhldsahfkjhldhjkftestlhfdsakjfhdjhlfdsjkafhjdlk');
await writeSync(page, 'dafhdjfldshafhldsahfkjhldhjkftestlhfdsakjfhdjhlfdsjkafhjdlk');
assert.deepEqual(await page.evaluate(`window.search.findNext('test')`), true);
assert.deepEqual(await page.evaluate(`window.term.getSelection()`), 'test');
});
@@ -54,16 +52,16 @@ describe('Search Tests', function (): void {
}
dataString += makeData(50);
}
await writeSync(dataString);
await writeSync(page, dataString);
assert.deepEqual(await page.evaluate(`window.search.findNext('$^1_3{}test$#')`), true);
assert.deepEqual(await page.evaluate(`window.term.getSelection()`), '$^1_3{}test$#');
});
it ('Incremental Find Previous', async () => {
it('Incremental Find Previous', async () => {
await page.evaluate(`window.term.writeln('package.jsonc\\n')`);
await writeSync('package.json pack package.lock');
await writeSync(page, 'package.json pack package.lock');
await page.evaluate(`window.search.findPrevious('pack', {incremental: true})`);
let line: string = await page.evaluate(`window.term.buffer.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
let selectionPosition: {startColumn: number, startRow: number, endColumn: number, endRow: number} = await page.evaluate(`window.term.getSelectionPosition()`);
let line: string = await page.evaluate(`window.term.buffer.active.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
let selectionPosition: { startColumn: number, startRow: number, endColumn: number, endRow: number } = await page.evaluate(`window.term.getSelectionPosition()`);
// We look further ahead in the line to ensure that pack was selected from package.lock
assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn + 8), 'package.lock');
await page.evaluate(`window.search.findPrevious('package.j', {incremental: true})`);
@@ -71,16 +69,16 @@ describe('Search Tests', function (): void {
assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn + 3), 'package.json');
await page.evaluate(`window.search.findPrevious('package.jsonc', {incremental: true})`);
// We have to reevaluate line because it should have switched starting rows at this point
line = await page.evaluate(`window.term.buffer.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
line = await page.evaluate(`window.term.buffer.active.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
selectionPosition = await page.evaluate(`window.term.getSelectionPosition()`);
assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn), 'package.jsonc');
});
it ('Incremental Find Next', async () => {
it('Incremental Find Next', async () => {
await page.evaluate(`window.term.writeln('package.lock pack package.json package.ups\\n')`);
await writeSync('package.jsonc');
await writeSync(page, 'package.jsonc');
await page.evaluate(`window.search.findNext('pack', {incremental: true})`);
let line: string = await page.evaluate(`window.term.buffer.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
let selectionPosition: {startColumn: number, startRow: number, endColumn: number, endRow: number} = await page.evaluate(`window.term.getSelectionPosition()`);
let line: string = await page.evaluate(`window.term.buffer.active.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
let selectionPosition: { startColumn: number, startRow: number, endColumn: number, endRow: number } = await page.evaluate(`window.term.getSelectionPosition()`);
// We look further ahead in the line to ensure that pack was selected from package.lock
assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn + 8), 'package.lock');
await page.evaluate(`window.search.findNext('package.j', {incremental: true})`);
@@ -88,12 +86,12 @@ describe('Search Tests', function (): void {
assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn + 3), 'package.json');
await page.evaluate(`window.search.findNext('package.jsonc', {incremental: true})`);
// We have to reevaluate line because it should have switched starting rows at this point
line = await page.evaluate(`window.term.buffer.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
line = await page.evaluate(`window.term.buffer.active.getLine(window.term.getSelectionPosition().startRow).translateToString()`);
selectionPosition = await page.evaluate(`window.term.getSelectionPosition()`);
assert.deepEqual(line.substring(selectionPosition.startColumn, selectionPosition.endColumn), 'package.jsonc');
});
it('Simple Regex', async () => {
await writeSync('abc123defABCD');
await writeSync(page, 'abc123defABCD');
await page.evaluate(`window.search.findNext('[a-z]+', {regex: true})`);
assert.deepEqual(await page.evaluate(`window.term.getSelection()`), 'abc');
await page.evaluate(`window.search.findNext('[A-Z]+', {regex: true, caseSensitive: true})`);
@@ -101,7 +99,7 @@ describe('Search Tests', function (): void {
});
it('Search for single result twice should not unselect it', async () => {
await writeSync('abc def');
await writeSync(page, 'abc def');
assert.deepEqual(await page.evaluate(`window.search.findNext('abc')`), true);
assert.deepEqual(await page.evaluate(`window.term.getSelection()`), 'abc');
assert.deepEqual(await page.evaluate(`window.search.findNext('abc')`), true);
@@ -118,7 +116,7 @@ describe('Search Tests', function (): void {
.replace(/'/g, '\\\'');
});
it('should find all occurrences using findNext', async () => {
await writeSync(fixture);
await writeSync(page, fixture);
assert.deepEqual(await page.evaluate(`window.search.findNext('opencv')`), true);
let selectionPosition = await page.evaluate(`window.term.getSelectionPosition()`);
assert.deepEqual(selectionPosition, { startColumn: 24, startRow: 53, endColumn: 30, endRow: 53 });
@@ -152,7 +150,7 @@ describe('Search Tests', function (): void {
assert.deepEqual(selectionPosition, { startColumn: 24, startRow: 53, endColumn: 30, endRow: 53 });
});
it('should find all occurrences using findPrevious', async () => {
await writeSync(fixture);
await writeSync(page, fixture);
assert.deepEqual(await page.evaluate(`window.search.findPrevious('opencv')`), true);
let selectionPosition = await page.evaluate(`window.term.getSelectionPosition()`);
assert.deepEqual(selectionPosition, { startColumn: 11, startRow: 136, endColumn: 17, endRow: 136 });
@@ -189,20 +187,6 @@ describe('Search Tests', function (): void {
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
async function writeSync(data: string): Promise<void> {
return page.evaluate(`new Promise(resolve => window.term.write('${data}', resolve))`);
}
function makeData(length: number): string {
let result = '';
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
+17 -13
View File
@@ -87,7 +87,7 @@ export class SearchAddon implements ITerminalAddon {
// Search from startRow + 1 to end
if (!result) {
for (let y = startRow + 1; y < this._terminal.buffer.baseY + this._terminal.rows; y++) {
for (let y = startRow + 1; y < this._terminal.buffer.active.baseY + this._terminal.rows; y++) {
searchPosition.startRow = y;
searchPosition.startCol = 0;
// If the current line is wrapped line, increase index of column to ignore the previous scan
@@ -110,8 +110,12 @@ export class SearchAddon implements ITerminalAddon {
}
}
// If there is only one result, return true.
if (!result && currentSelection) return true;
// If there is only one result, wrap back and return selection if it exists.
if (!result && currentSelection) {
searchPosition.startRow = currentSelection.startRow;
searchPosition.startCol = 0;
result = this._findInLine(term, searchPosition, searchOptions);
}
// Set selection and scroll if a result was found
return this._selectResult(result);
@@ -135,7 +139,7 @@ export class SearchAddon implements ITerminalAddon {
}
const isReverseSearch = true;
let startRow = this._terminal.buffer.baseY + this._terminal.rows;
let startRow = this._terminal.buffer.active.baseY + this._terminal.rows;
let startCol = this._terminal.cols;
let result: ISearchResult | undefined;
const incremental = searchOptions ? searchOptions.incremental : false;
@@ -174,8 +178,8 @@ export class SearchAddon implements ITerminalAddon {
}
}
// If we hit the top and didn't search from the very bottom wrap back down
if (!result && startRow !== (this._terminal.buffer.baseY + this._terminal.rows)) {
for (let y = (this._terminal.buffer.baseY + this._terminal.rows); y > startRow; y--) {
if (!result && startRow !== (this._terminal.buffer.active.baseY + this._terminal.rows)) {
for (let y = (this._terminal.buffer.active.baseY + this._terminal.rows); y >= startRow; y--) {
searchPosition.startRow = y;
result = this._findInLine(term, searchPosition, searchOptions, isReverseSearch);
if (result) {
@@ -197,7 +201,7 @@ export class SearchAddon implements ITerminalAddon {
private _initLinesCache(): void {
const terminal = this._terminal!;
if (!this._linesCache) {
this._linesCache = new Array(terminal.buffer.length);
this._linesCache = new Array(terminal.buffer.active.length);
this._cursorMoveListener = terminal.onCursorMove(() => this._destroyLinesCache());
this._resizeListener = terminal.onResize(() => this._destroyLinesCache());
}
@@ -249,7 +253,7 @@ export class SearchAddon implements ITerminalAddon {
const col = searchPosition.startCol;
// Ignore wrapped lines, only consider on unwrapped line (first row of command string).
const firstLine = terminal.buffer.getLine(row);
const firstLine = terminal.buffer.active.getLine(row);
if (firstLine && firstLine.isWrapped) {
if (isReverseSearch) {
searchPosition.startCol += terminal.cols;
@@ -311,7 +315,7 @@ export class SearchAddon implements ITerminalAddon {
return;
}
const line = terminal.buffer.getLine(row);
const line = terminal.buffer.active.getLine(row);
if (line) {
for (let i = 0; i < resultIndex; i++) {
@@ -354,9 +358,9 @@ export class SearchAddon implements ITerminalAddon {
let lineWrapsToNext: boolean;
do {
const nextLine = terminal.buffer.getLine(lineIndex + 1);
const nextLine = terminal.buffer.active.getLine(lineIndex + 1);
lineWrapsToNext = nextLine ? nextLine.isWrapped : false;
const line = terminal.buffer.getLine(lineIndex);
const line = terminal.buffer.active.getLine(lineIndex);
if (!line) {
break;
}
@@ -380,8 +384,8 @@ export class SearchAddon implements ITerminalAddon {
}
terminal.select(result.col, result.row, result.term.length);
// If it is not in the viewport then we scroll else it just gets selected
if (result.row >= (terminal.buffer.viewportY + terminal.rows) || result.row < terminal.buffer.viewportY) {
let scroll = result.row - terminal.buffer.viewportY;
if (result.row >= (terminal.buffer.active.viewportY + terminal.rows) || result.row < terminal.buffer.active.viewportY) {
let scroll = result.row - terminal.buffer.active.viewportY;
scroll = scroll - Math.floor(terminal.rows / 2);
terminal.scrollLines(scroll);
}
+5 -1
View File
@@ -10,7 +10,11 @@
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
@@ -7,12 +7,12 @@ import { perfContext, before, ThroughputRuntimeCase } from 'xterm-benchmark';
import { spawn } from 'node-pty';
import { Utf8ToUtf32, stringFromCodePoint } from 'common/input/TextDecoder';
import { Terminal } from 'public/Terminal';
import { Terminal } from 'browser/public/Terminal';
import { SerializeAddon } from 'SerializeAddon';
class TestTerminal extends Terminal {
writeSync(data: string): void {
(<any>this)._core.writeSync(data);
public writeSync(data: string): void {
(this as any)._core.writeSync(data);
}
}
@@ -11,8 +11,6 @@
"paths": {
"common/*": ["../../../src/common/*"],
"browser/*": ["../../../src/browser/*"],
"public/*": ["../../../src/public/*"],
"Terminal": ["../../../src/Terminal"],
"SerializeAddon": ["../src/SerializeAddon"]
}
},
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-serialize",
"version": "0.1.1",
"version": "0.4.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -18,6 +18,6 @@
"benchmark-eval": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --eval out-benchmark/addons/xterm-addon-serialize/benchmark/*benchmark.js"
},
"peerDependencies": {
"xterm": "^3.14.0"
"xterm": "^4.0.0"
}
}
@@ -3,27 +3,27 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { assert } from 'chai';
import { ITerminalOptions } from 'xterm';
import { openTerminal, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 800;
const height = 600;
describe('SerializeAddon', () => {
before(async function (): Promise<any> {
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`]
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
await page.goto(APP);
await openTerminal({ rows: 10, cols: 10, rendererType: 'dom' });
await openTerminal(page, { rows: 10, cols: 10, rendererType: 'dom' });
await page.evaluate(`
window.serializeAddon = new SerializeAddon();
window.term.loadAddon(window.serializeAddon);
@@ -33,13 +33,13 @@ describe('SerializeAddon', () => {
after(async () => await browser.close());
beforeEach(async () => await page.evaluate(`window.term.reset()`));
it('empty content', async function (): Promise<any> {
it('empty content', async function(): Promise<any> {
const rows = 10;
const cols = 10;
assert.equal(await page.evaluate(`serializeAddon.serialize();`), '');
});
it('trim last empty lines', async function (): Promise<any> {
it('trim last empty lines', async function(): Promise<any> {
const cols = 10;
const lines = [
'',
@@ -58,7 +58,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.slice(0, 8).join('\r\n'));
});
it('digits content', async function (): Promise<any> {
it('digits content', async function(): Promise<any> {
const rows = 10;
const cols = 10;
const digitsLine = digitsString(cols);
@@ -67,7 +67,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize half rows of content', async function (): Promise<any> {
it('serialize half rows of content', async function(): Promise<any> {
const rows = 10;
const halfRows = rows >> 1;
const cols = 10;
@@ -76,7 +76,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize(${halfRows});`), lines.slice(halfRows, 2 * halfRows).join('\r\n'));
});
it('serialize 0 rows of content', async function (): Promise<any> {
it('serialize 0 rows of content', async function(): Promise<any> {
const rows = 10;
const cols = 10;
const lines = newArray<string>((index: number) => digitsString(cols, index), rows);
@@ -84,7 +84,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize(0);`), '');
});
it('serialize all rows of content with color16', async function (): Promise<any> {
it('serialize all rows of content with color16', async function(): Promise<any> {
const cols = 10;
const color16 = [
30, 31, 32, 33, 34, 35, 36, 37, // Set foreground color
@@ -101,7 +101,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with fg/bg flags', async function (): Promise<any> {
it('serialize all rows of content with fg/bg flags', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -122,7 +122,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with color256', async function (): Promise<any> {
it('serialize all rows of content with color256', async function(): Promise<any> {
const rows = 32;
const cols = 10;
const lines = newArray<string>(
@@ -133,7 +133,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with color16 and style separately', async function (): Promise<any> {
it('serialize all rows of content with color16 and style separately', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -152,7 +152,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with color16 and style together', async function (): Promise<any> {
it('serialize all rows of content with color16 and style together', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -174,7 +174,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with color256 and style separately', async function (): Promise<any> {
it('serialize all rows of content with color256 and style separately', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -193,7 +193,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with color256 and style together', async function (): Promise<any> {
it('serialize all rows of content with color256 and style together', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -215,7 +215,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with colorRGB and style separately', async function (): Promise<any> {
it('serialize all rows of content with colorRGB and style separately', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -234,7 +234,7 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize all rows of content with colorRGB and style together', async function (): Promise<any> {
it('serialize all rows of content with colorRGB and style together', async function(): Promise<any> {
const cols = 10;
const line = '+'.repeat(cols);
const lines: string[] = [
@@ -270,17 +270,36 @@ describe('SerializeAddon', () => {
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), expected.join('\r\n'));
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
it('serialize CJK correctly', async () => {
const lines = [
'中文中文',
'12中文',
'中文12',
'1中文中文中' // this line is going to be wrapped at last character because it has line length of 11 (1+2*5)
];
const expected = [
'中文中文',
'12中文',
'中文12',
'1中文中文',
'中'
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), expected.join('\r\n'));
});
it('serialize CJK Mixed with tab correctly', async () => {
const lines = [
'中文\t12' // CJK mixed with tab
];
const expected = [
'中文\x1b[4C12'
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), expected.join('\r\n'));
});
});
function newArray<T>(initial: T | ((index: number) => T), count: number): T[] {
const array: T[] = new Array<T>(count);
@@ -348,23 +367,3 @@ const DIM = '2';
const NO_ITALIC = '23';
const NO_DIM = '22';
async function writeSync(page: puppeteer.Page, data: string): Promise<void> {
await page.evaluate(`
window.ready = false;
window.term.write('${data}', () => window.ready = true);
`);
await pollFor(page, 'window.ready', true);
}
async function pollFor(page: puppeteer.Page, fn: string, val: any, preFn?: () => Promise<void>): Promise<void> {
if (preFn) {
await preFn();
}
const result = await page.evaluate(fn);
if (result !== val) {
return new Promise<void>(r => {
setTimeout(() => r(pollFor(page, fn, val, preFn)), 10);
});
}
}
@@ -15,7 +15,7 @@ function constrain(value: number, low: number, high: number): number {
abstract class BaseSerializeHandler {
constructor(private _buffer: IBuffer) { }
serialize(startRow: number, endRow: number): string {
public serialize(startRow: number, endRow: number): string {
// we need two of them to flip between old and new cell
const cell1 = this._buffer.getNullCell();
const cell2 = this._buffer.getNullCell();
@@ -138,7 +138,7 @@ class StringSerializeHandler extends BaseSerializeHandler {
// Count number of null cells encountered after the last non-null cell and move the cursor
// if a non-null cell is found (eg. \t or cursor move)
if (cell.getChars() === '') {
this._nullCellCount++;
this._nullCellCount += cell.getWidth();
} else if (this._nullCellCount > 0) {
this._currentRow += `\x1b[${this._nullCellCount}C`;
this._nullCellCount = 0;
@@ -175,8 +175,8 @@ export class SerializeAddon implements ITerminalAddon {
throw new Error('Cannot use addon until it has been loaded');
}
const maxRows = this._terminal.buffer.length;
const handler = new StringSerializeHandler(this._terminal.buffer);
const maxRows = this._terminal.buffer.active.length;
const handler = new StringSerializeHandler(this._terminal.buffer.active);
rows = (rows === undefined) ? maxRows : constrain(rows, 0, maxRows);
+11 -3
View File
@@ -12,15 +12,23 @@
"removeComments": true,
"baseUrl": ".",
"paths": {
"common/*": [ "../../../src/common/*" ]
"common/*": [
"../../../src/common/*"
]
},
"strict": true
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{ "path": "../../../src/common" }
{
"path": "../../../src/common"
}
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-unicode11",
"version": "0.1.1",
"version": "0.2.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -3,26 +3,25 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { ITerminalOptions } from 'xterm';
import { assert } from 'chai';
import { openTerminal, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 800;
const height = 600;
describe('Unicode11Addon', () => {
before(async function(): Promise<any> {
this.timeout(20000);
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
});
after(async () => {
@@ -30,9 +29,8 @@ describe('Unicode11Addon', () => {
});
beforeEach(async function(): Promise<any> {
this.timeout(20000);
await page.goto(APP);
await openTerminal();
await openTerminal(page);
});
it('wcwidth V11 emoji test', async () => {
@@ -49,13 +47,3 @@ describe('Unicode11Addon', () => {
assert.deepEqual(await page.evaluate(`window.term._core.unicodeService.getStringCellWidth('🤣🤣🤣🤣🤣🤣🤣🤣🤣🤣')`), 20);
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
+10 -2
View File
@@ -13,14 +13,22 @@
"strict": true,
"baseUrl": ".",
"paths": {
"common/*": [ "../../../src/common/*" ]
"common/*": [
"../../../src/common/*"
]
},
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{ "path": "../../../src/common" }
{
"path": "../../../src/common"
}
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-web-links",
"version": "0.2.1",
"version": "0.4.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -0,0 +1,117 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { ILinkProvider, IBufferCellPosition, ILink, Terminal } from 'xterm';
export class WebLinkProvider implements ILinkProvider {
constructor(
private readonly _terminal: Terminal,
private readonly _regex: RegExp,
private readonly _handler: (event: MouseEvent, uri: string) => void
) {
}
public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {
callback(LinkComputer.computeLink(y, this._regex, this._terminal, this._handler));
}
}
export class LinkComputer {
public static computeLink(y: number, regex: RegExp, terminal: Terminal, handler: (event: MouseEvent, uri: string) => void): ILink[] {
const rex = new RegExp(regex.source, (regex.flags || '') + 'g');
const [line, startLineIndex] = LinkComputer._translateBufferLineToStringWithWrap(y - 1, false, terminal);
let match;
let stringIndex = -1;
const result: ILink[] = [];
while ((match = rex.exec(line)) !== null) {
const text = match[1];
if (!text) {
// something matched but does not comply with the given matchIndex
// since this is most likely a bug the regex itself we simply do nothing here
console.log('match found without corresponding matchIndex');
break;
}
// Get index, match.index is for the outer match which includes negated chars
// therefore we cannot use match.index directly, instead we search the position
// of the match group in text again
// also correct regex and string search offsets for the next loop run
stringIndex = line.indexOf(text, stringIndex + 1);
rex.lastIndex = stringIndex + text.length;
if (stringIndex < 0) {
// invalid stringIndex (should not have happened)
break;
}
let endX = stringIndex + text.length;
let endY = startLineIndex + 1;
while (endX > terminal.cols) {
endX -= terminal.cols;
endY++;
}
const range = {
start: {
x: stringIndex + 1,
y: startLineIndex + 1
},
end: {
x: endX,
y: endY
}
};
result.push({ range, text, activate: handler });
}
return result;
}
/**
* Gets the entire line for the buffer line
* @param line The line being translated.
* @param trimRight Whether to trim whitespace to the right.
* @param terminal The terminal
*/
private static _translateBufferLineToStringWithWrap(lineIndex: number, trimRight: boolean, terminal: Terminal): [string, number] {
let lineString = '';
let lineWrapsToNext: boolean;
let prevLinesToWrap: boolean;
do {
const line = terminal.buffer.active.getLine(lineIndex);
if (!line) {
break;
}
if (line.isWrapped) {
lineIndex--;
}
prevLinesToWrap = line.isWrapped;
} while (prevLinesToWrap);
const startLineIndex = lineIndex;
do {
const nextLine = terminal.buffer.active.getLine(lineIndex + 1);
lineWrapsToNext = nextLine ? nextLine.isWrapped : false;
const line = terminal.buffer.active.getLine(lineIndex);
if (!line) {
break;
}
lineString += line.translateToString(!lineWrapsToNext && trimRight).substring(0, terminal.cols);
lineIndex++;
} while (lineWrapsToNext);
return [lineString, startLineIndex];
}
}
@@ -3,55 +3,45 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { assert } from 'chai';
import { ITerminalOptions } from 'xterm';
import { openTerminal, pollFor, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 800;
const height = 600;
describe('WebLinksAddon', () => {
before(async function(): Promise<any> {
this.timeout(10000);
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
});
after(async () => {
await browser.close();
});
beforeEach(async function(): Promise<any> {
this.timeout(5000);
await page.goto(APP);
});
after(async () => await browser.close());
beforeEach(async () => await page.goto(APP));
it('.com', async function(): Promise<any> {
this.timeout(20000);
await testHostName('foo.com');
});
it('.com.au', async function(): Promise<any> {
this.timeout(20000);
await testHostName('foo.com.au');
});
it('.io', async function(): Promise<any> {
this.timeout(20000);
await testHostName('foo.io');
});
});
async function testHostName(hostname: string): Promise<void> {
await openTerminal({ rendererType: 'dom' });
await openTerminal(page, { rendererType: 'dom', cols: 40 });
await page.evaluate(`window.term.loadAddon(new window.WebLinksAddon())`);
const data = ` http://${hostname} \\r\\n` +
` http://${hostname}/a~b#c~d?e~f \\r\\n` +
@@ -70,16 +60,6 @@ async function testHostName(hostname: string): Promise<void> {
await pollForLinkAtCell(1, 7, `http://${hostname}/subpath/+/id`);
}
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
async function pollForLinkAtCell(col: number, row: number, value: string): Promise<void> {
const rowSelector = `.xterm-rows > :nth-child(${row})`;
// Ensure the hover element exists before trying to hover it
@@ -87,23 +67,3 @@ async function pollForLinkAtCell(col: number, row: number, value: string): Promi
await pollFor(page, `document.querySelectorAll('${rowSelector} > span[style]').length >= ${value.length}`, true, async () => page.hover(`${rowSelector} > :nth-child(${col})`));
assert.equal(await page.evaluate(`Array.prototype.reduce.call(document.querySelectorAll('${rowSelector} > span[style]'), (a, b) => a + b.textContent, '');`), value);
}
async function pollFor(page: puppeteer.Page, fn: string, val: any, preFn?: () => Promise<void>): Promise<void> {
if (preFn) {
await preFn();
}
const result = await page.evaluate(fn);
if (result !== val) {
return new Promise<void>(r => {
setTimeout(() => r(pollFor(page, fn, val, preFn)), 10);
});
}
}
async function writeSync(page: puppeteer.Page, data: string): Promise<void> {
await page.evaluate(`
window.ready = false;
window.term.write('${data}', () => window.ready = true);
`);
await pollFor(page, 'window.ready', true);
}
@@ -1,9 +1,10 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { Terminal, ILinkMatcherOptions, ITerminalAddon } from 'xterm';
import { Terminal, ILinkMatcherOptions, ITerminalAddon, IDisposable } from 'xterm';
import { WebLinkProvider } from './WebLinkProvider';
const protocolClause = '(https?:\\/\\/)';
const domainCharacterSet = '[\\da-z\\.-]+';
@@ -14,7 +15,7 @@ const ipClause = '((\\d{1,3}\\.){3}\\d{1,3})';
const localHostClause = '(localhost)';
const portClause = '(:\\d{1,5})';
const hostClause = '((' + domainBodyClause + '\\.' + tldClause + ')|' + ipClause + '|' + localHostClause + ')' + portClause + '?';
const pathCharacterSet = '(\\/[\\/\\w\\.\\-%~:+]*)*([^:"\'\\s])';
const pathCharacterSet = '(\\/[\\/\\w\\.\\-%~:+@]*)*([^:"\'\\s])';
const pathClause = '(' + pathCharacterSet + ')?';
const queryStringHashFragmentCharacterSet = '[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&\'*+,:;~\\=\\.\\-]*';
const queryStringClause = '(\\?' + queryStringHashFragmentCharacterSet + ')?';
@@ -38,22 +39,32 @@ function handleLink(event: MouseEvent, uri: string): void {
export class WebLinksAddon implements ITerminalAddon {
private _linkMatcherId: number | undefined;
private _terminal: Terminal | undefined;
private _linkProvider: IDisposable | undefined;
constructor(
private _handler: (event: MouseEvent, uri: string) => void = handleLink,
private _options: ILinkMatcherOptions = {}
private _options: ILinkMatcherOptions = {},
private _useLinkProvider: boolean = false
) {
this._options.matchIndex = 1;
}
public activate(terminal: Terminal): void {
this._terminal = terminal;
this._linkMatcherId = this._terminal.registerLinkMatcher(strictUrlRegex, this._handler, this._options);
if (this._useLinkProvider && 'registerLinkProvider' in this._terminal) {
this._linkProvider = this._terminal.registerLinkProvider(new WebLinkProvider(this._terminal, strictUrlRegex, this._handler));
} else {
// TODO: This should be removed eventually
this._linkMatcherId = (this._terminal as Terminal).registerLinkMatcher(strictUrlRegex, this._handler, this._options);
}
}
public dispose(): void {
if (this._linkMatcherId !== undefined && this._terminal !== undefined) {
this._terminal.deregisterLinkMatcher(this._linkMatcherId);
}
this._linkProvider?.dispose();
}
}
@@ -10,7 +10,11 @@
"outDir": "../out",
"sourceMap": true,
"removeComments": true,
"strict": true
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
@@ -15,8 +15,12 @@ declare module 'xterm-addon-web-links' {
* Creates a new web links addon.
* @param handler The callback when the link is called.
* @param options Options for the link matcher.
* @param useLinkProvider Whether to use the new link provider API to create
* the links. This is an option because use of both link matcher (old) and
* link provider (new) may cause issues. Link provider will eventually be
* the default and only option.
*/
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions);
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions, useLinkProvider?: boolean);
/**
* Activates the addon
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-webgl",
"version": "0.5.0",
"version": "0.9.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -213,14 +213,14 @@ export class GlyphRenderer {
// a_cellpos only changes on resize
}
public updateSelection(model: IRenderModel, columnSelectMode: boolean): void {
public updateSelection(model: IRenderModel): void {
const terminal = this._terminal;
this._vertices.selectionAttributes = slice(this._vertices.attributes, 0);
const bg = (this._colors.selectionOpaque.rgba >>> 8) | Attributes.CM_RGB;
if (columnSelectMode) {
if (model.selection.columnSelectMode) {
const startCol = model.selection.startCol;
const width = model.selection.endCol - startCol;
const height = model.selection.viewportCappedEndRow - model.selection.viewportCappedStartRow + 1;
@@ -250,7 +250,7 @@ export class GlyphRenderer {
private _updateSelectionRange(startCol: number, endCol: number, y: number, model: IRenderModel, bg: number): void {
const terminal = this._terminal;
const row = y + terminal.buffer.viewportY;
const row = y + terminal.buffer.active.viewportY;
let line: IBufferLine | undefined;
for (let x = startCol; x < endCol; x++) {
const offset = (y * this._terminal.cols + x) * RENDER_MODEL_INDICIES_PER_CELL;
@@ -281,7 +281,7 @@ export class GlyphRenderer {
}
if (code & COMBINED_CHAR_BIT_MASK) {
if (!line) {
line = terminal.buffer.getLine(row);
line = terminal.buffer.active.getLine(row);
}
const chars = line!.getCell(x)!.getChars();
this._updateCell(this._vertices.selectionAttributes, x, y, model.cells[offset], bg, fg, chars);
@@ -171,7 +171,7 @@ export class RectangleRenderer {
);
}
public updateSelection(model: ISelectionRenderModel, columnSelectMode: boolean): void {
public updateSelection(model: ISelectionRenderModel): void {
const terminal = this._terminal;
if (!model.hasSelection) {
@@ -179,7 +179,7 @@ export class RectangleRenderer {
return;
}
if (columnSelectMode) {
if (model.columnSelectMode) {
const startCol = model.startCol;
const width = model.endCol - startCol;
const height = model.viewportCappedEndRow - model.viewportCappedStartRow + 1;
@@ -196,7 +196,7 @@ export class RectangleRenderer {
} else {
// Draw first row
const startCol = model.viewportStartRow === model.viewportCappedStartRow ? model.startCol : 0;
const startRowEndCol = model.viewportCappedStartRow === model.viewportCappedEndRow ? model.endCol : terminal.cols;
const startRowEndCol = model.viewportCappedStartRow === model.viewportEndRow ? model.endCol : terminal.cols;
this._addRectangleFloat(
this._vertices.selection,
0,
+1 -1
View File
@@ -22,6 +22,7 @@ export class RenderModel implements IRenderModel {
this.lineLengths = new Uint32Array(0);
this.selection = {
hasSelection: false,
columnSelectMode: false,
viewportStartRow: 0,
viewportEndRow: 0,
viewportCappedStartRow: 0,
@@ -42,7 +43,6 @@ export class RenderModel implements IRenderModel {
public clear(): void {
fill(this.cells, 0, 0);
fill(this.lineLengths, 0, 0);
this.clearSelection();
}
public clearSelection(): void {
+13 -15
View File
@@ -5,9 +5,7 @@
import { assert } from 'chai';
import { sliceFallback } from './TypedArray';
type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray
| Int8Array | Int16Array | Int32Array
| Float32Array | Float64Array;
type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
function deepEquals(a: TypedArray, b: TypedArray): void {
assert.equal(a.length, b.length);
@@ -40,19 +38,19 @@ describe('polyfill conformance tests', function(): void {
deepEquals(sliceFallback(u321, -1), u322.slice(-1));
});
it('Int8Array', () => {
const i81 = new Int8Array(5);
const i82 = new Int8Array(5);
deepEquals(sliceFallback(i81, 2), i82.slice(2));
deepEquals(sliceFallback(i81, 65537), i82.slice(65537));
deepEquals(sliceFallback(i81, -1), i82.slice(-1));
});
const i81 = new Int8Array(5);
const i82 = new Int8Array(5);
deepEquals(sliceFallback(i81, 2), i82.slice(2));
deepEquals(sliceFallback(i81, 65537), i82.slice(65537));
deepEquals(sliceFallback(i81, -1), i82.slice(-1));
});
it('Int16Array', () => {
const i161 = new Int16Array(5);
const i162 = new Int16Array(5);
deepEquals(sliceFallback(i161, 2), i162.slice(2));
deepEquals(sliceFallback(i161, 65535), i162.slice(65535));
deepEquals(sliceFallback(i161, -1), i162.slice(-1));
});
const i161 = new Int16Array(5);
const i162 = new Int16Array(5);
deepEquals(sliceFallback(i161, 2), i162.slice(2));
deepEquals(sliceFallback(i161, 65535), i162.slice(65535));
deepEquals(sliceFallback(i161, -1), i162.slice(-1));
});
it('Int32Array', () => {
const i321 = new Int32Array(5);
const i322 = new Int32Array(5);
+1 -3
View File
@@ -3,9 +3,7 @@
* @license MIT
*/
export type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray
| Int8Array | Int16Array | Int32Array
| Float32Array | Float64Array;
export type TypedArray = Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
export function slice<T extends TypedArray>(array: T, start?: number, end?: number): T {
// all modern engines that support .slice
+1
View File
@@ -56,6 +56,7 @@ export interface IRenderModel {
export interface ISelectionRenderModel {
hasSelection: boolean;
columnSelectMode: boolean;
viewportStartRow: number;
viewportEndRow: number;
viewportCappedStartRow: number;
+7 -3
View File
@@ -21,7 +21,7 @@ export class WebglAddon implements ITerminalAddon {
throw new Error('Cannot activate WebglAddon before Terminal.open');
}
this._terminal = terminal;
const renderService: IRenderService = (<any>terminal)._core._renderService;
const renderService: IRenderService = (<any>terminal)._core._renderService;
const colors: IColorSet = (<any>terminal)._core._colorManager.colors;
this._renderer = new WebglRenderer(terminal, colors, this._preserveDrawingBuffer);
renderService.setRenderer(this._renderer);
@@ -31,8 +31,8 @@ export class WebglAddon implements ITerminalAddon {
if (!this._terminal) {
throw new Error('Cannot dispose WebglAddon because it is activated');
}
const renderService: IRenderService = (<any>this._terminal)._core._renderService;
renderService.setRenderer((<any>this._terminal)._core._createRenderer());
const renderService: IRenderService = (this._terminal as any)._core._renderService;
renderService.setRenderer((this._terminal as any)._core._createRenderer());
renderService.onResize(this._terminal.cols, this._terminal.rows);
this._renderer = undefined;
}
@@ -40,4 +40,8 @@ export class WebglAddon implements ITerminalAddon {
public get textureAtlas(): HTMLCanvasElement | undefined {
return this._renderer?.textureAtlas;
}
public clearTextureAtlas(): void {
this._renderer?.clearCharAtlas();
}
}
+114 -130
View File
@@ -3,21 +3,27 @@
* @license MIT
*/
import * as puppeteer from 'puppeteer';
import { ITerminalOptions } from '../../../src/Types';
import { ITerminalOptions } from '../../../src/common/Types';
import { ITheme } from 'xterm';
import { assert } from 'chai';
import deepEqual = require('deep-equal');
import { openTerminal, pollFor, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
const APP = 'http://127.0.0.1:3000/test';
let browser: puppeteer.Browser;
let page: puppeteer.Page;
let browser: Browser;
let page: Page;
const width = 800;
const height = 600;
describe('WebGL Renderer Integration Tests', function(): void {
it('dispose removes renderer canvases', async () => {
describe('WebGL Renderer Integration Tests', async () => {
const browserType = getBrowserType();
const isHeadless = process.argv.indexOf('--headless') !== -1;
// Firefox works only in non-headless mode https://github.com/microsoft/playwright/issues/1032
const areTestsEnabled = browserType.name() === 'chromium' || (browserType.name() === 'firefox' && !isHeadless);
const itWebgl = areTestsEnabled ? it : it.skip;
itWebgl('dispose removes renderer canvases', async function(): Promise<void> {
await setupBrowser();
assert.equal(await page.evaluate(`document.querySelectorAll('.xterm canvas').length`), 3);
await page.evaluate(`addon.dispose()`);
@@ -26,11 +32,13 @@ describe('WebGL Renderer Integration Tests', function(): void {
});
describe('colors', () => {
before(async () => setupBrowser());
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
if (areTestsEnabled) {
before(async () => setupBrowser());
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
}
it('foreground 0-15', async () => {
itWebgl('foreground 0-15', async () => {
const theme: ITheme = {
black: '#010203',
red: '#040506',
@@ -42,7 +50,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
white: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[30m█\\x1b[31m█\\x1b[32m█\\x1b[33m█\\x1b[34m█\\x1b[35m█\\x1b[36m█\\x1b[37m█`);
await writeSync(page, `\\x1b[30m█\\x1b[31m█\\x1b[32m█\\x1b[33m█\\x1b[34m█\\x1b[35m█\\x1b[36m█\\x1b[37m█`);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -53,7 +61,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('foreground 0-7 drawBoldTextInBrightColors', async () => {
itWebgl('foreground 0-7 drawBoldTextInBrightColors', async () => {
const theme: ITheme = {
brightBlack: '#010203',
brightRed: '#040506',
@@ -68,7 +76,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
window.term.setOption('theme', ${JSON.stringify(theme)});
window.term.setOption('drawBoldTextInBrightColors', true);
`);
await writeSync(`\\x1b[1;30m█\\x1b[1;31m█\\x1b[1;32m█\\x1b[1;33m█\\x1b[1;34m█\\x1b[1;35m█\\x1b[1;36m█\\x1b[1;37m█`);
await writeSync(page, `\\x1b[1;30m█\\x1b[1;31m█\\x1b[1;32m█\\x1b[1;33m█\\x1b[1;34m█\\x1b[1;35m█\\x1b[1;36m█\\x1b[1;37m█`);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -79,7 +87,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('background 0-15', async () => {
itWebgl('background 0-15', async () => {
const theme: ITheme = {
black: '#010203',
red: '#040506',
@@ -91,7 +99,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
white: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[40m \\x1b[41m \\x1b[42m \\x1b[43m \\x1b[44m \\x1b[45m \\x1b[46m \\x1b[47m `);
await writeSync(page, `\\x1b[40m \\x1b[41m \\x1b[42m \\x1b[43m \\x1b[44m \\x1b[45m \\x1b[46m \\x1b[47m `);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -102,7 +110,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('foreground 0-15 inverse', async () => {
itWebgl('foreground 0-15 inverse', async () => {
const theme: ITheme = {
black: '#010203',
red: '#040506',
@@ -114,7 +122,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
white: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[7;30m \\x1b[7;31m \\x1b[7;32m \\x1b[7;33m \\x1b[7;34m \\x1b[7;35m \\x1b[7;36m \\x1b[7;37m `);
await writeSync(page, `\\x1b[7;30m \\x1b[7;31m \\x1b[7;32m \\x1b[7;33m \\x1b[7;34m \\x1b[7;35m \\x1b[7;36m \\x1b[7;37m `);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -125,7 +133,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('background 0-15 inverse', async () => {
itWebgl('background 0-15 inverse', async () => {
const theme: ITheme = {
black: '#010203',
red: '#040506',
@@ -137,7 +145,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
white: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[7;40m█\\x1b[7;41m█\\x1b[7;42m█\\x1b[7;43m█\\x1b[7;44m█\\x1b[7;45m█\\x1b[7;46m█\\x1b[7;47m█`);
await writeSync(page, `\\x1b[7;40m█\\x1b[7;41m█\\x1b[7;42m█\\x1b[7;43m█\\x1b[7;44m█\\x1b[7;45m█\\x1b[7;46m█\\x1b[7;47m█`);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -148,7 +156,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('foreground 0-15 inivisible', async () => {
itWebgl('foreground 0-15 inivisible', async () => {
const theme: ITheme = {
black: '#010203',
red: '#040506',
@@ -160,7 +168,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
white: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[8;30m \\x1b[8;31m \\x1b[8;32m \\x1b[8;33m \\x1b[8;34m \\x1b[8;35m \\x1b[8;36m \\x1b[8;37m `);
await writeSync(page, `\\x1b[8;30m \\x1b[8;31m \\x1b[8;32m \\x1b[8;33m \\x1b[8;34m \\x1b[8;35m \\x1b[8;36m \\x1b[8;37m `);
await pollFor(page, () => getCellColor(1, 1), [0, 0, 0, 255]);
await pollFor(page, () => getCellColor(2, 1), [0, 0, 0, 255]);
await pollFor(page, () => getCellColor(3, 1), [0, 0, 0, 255]);
@@ -171,7 +179,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [0, 0, 0, 255]);
});
it('background 0-15 inivisible', async () => {
itWebgl('background 0-15 inivisible', async () => {
const theme: ITheme = {
black: '#010203',
red: '#040506',
@@ -183,7 +191,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
white: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[8;40m█\\x1b[8;41m█\\x1b[8;42m█\\x1b[8;43m█\\x1b[8;44m█\\x1b[8;45m█\\x1b[8;46m█\\x1b[8;47m█`);
await writeSync(page, `\\x1b[8;40m█\\x1b[8;41m█\\x1b[8;42m█\\x1b[8;43m█\\x1b[8;44m█\\x1b[8;45m█\\x1b[8;46m█\\x1b[8;47m█`);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -194,7 +202,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('foreground 0-15 bright', async () => {
itWebgl('foreground 0-15 bright', async () => {
const theme: ITheme = {
brightBlack: '#010203',
brightRed: '#040506',
@@ -206,7 +214,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
brightWhite: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[90m█\\x1b[91m█\\x1b[92m█\\x1b[93m█\\x1b[94m█\\x1b[95m█\\x1b[96m█\\x1b[97m█`);
await writeSync(page, `\\x1b[90m█\\x1b[91m█\\x1b[92m█\\x1b[93m█\\x1b[94m█\\x1b[95m█\\x1b[96m█\\x1b[97m█`);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -217,7 +225,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('background 0-15 bright', async () => {
itWebgl('background 0-15 bright', async () => {
const theme: ITheme = {
brightBlack: '#010203',
brightRed: '#040506',
@@ -229,7 +237,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
brightWhite: '#161718'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(`\\x1b[100m \\x1b[101m \\x1b[102m \\x1b[103m \\x1b[104m \\x1b[105m \\x1b[106m \\x1b[107m `);
await writeSync(page, `\\x1b[100m \\x1b[101m \\x1b[102m \\x1b[103m \\x1b[104m \\x1b[105m \\x1b[106m \\x1b[107m `);
await pollFor(page, () => getCellColor(1, 1), [1, 2, 3, 255]);
await pollFor(page, () => getCellColor(2, 1), [4, 5, 6, 255]);
await pollFor(page, () => getCellColor(3, 1), [7, 8, 9, 255]);
@@ -240,7 +248,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 1), [22, 23, 24, 255]);
});
it('foreground 16-255', async () => {
itWebgl('foreground 16-255', async () => {
let data = '';
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -248,7 +256,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
const cssColor = COLORS_16_TO_255[y * 16 + x];
@@ -260,7 +268,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background 16-255', async () => {
itWebgl('background 16-255', async () => {
let data = '';
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -268,7 +276,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
const cssColor = COLORS_16_TO_255[y * 16 + x];
@@ -280,7 +288,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground 16-255 inverse', async () => {
itWebgl('foreground 16-255 inverse', async () => {
let data = '';
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -288,7 +296,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
const cssColor = COLORS_16_TO_255[y * 16 + x];
@@ -300,7 +308,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background 16-255 inverse', async () => {
itWebgl('background 16-255 inverse', async () => {
let data = '';
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -308,7 +316,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
const cssColor = COLORS_16_TO_255[y * 16 + x];
@@ -320,7 +328,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground 16-255 invisible', async () => {
itWebgl('foreground 16-255 invisible', async () => {
let data = '';
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -328,19 +336,15 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
const cssColor = COLORS_16_TO_255[y * 16 + x];
const r = parseInt(cssColor.substr(1, 2), 16);
const g = parseInt(cssColor.substr(3, 2), 16);
const b = parseInt(cssColor.substr(5, 2), 16);
await pollFor(page, () => getCellColor(x + 1, y + 1), [0, 0, 0, 255]);
}
}
});
it('background 16-255 invisible', async () => {
itWebgl('background 16-255 invisible', async () => {
let data = '';
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -348,7 +352,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 240 / 16; y++) {
for (let x = 0; x < 16; x++) {
const cssColor = COLORS_16_TO_255[y * 16 + x];
@@ -360,7 +364,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color red', async () => {
itWebgl('foreground true color red', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -369,7 +373,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -378,7 +382,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color red', async () => {
itWebgl('background true color red', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -387,7 +391,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -396,7 +400,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color green', async () => {
itWebgl('foreground true color green', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -405,7 +409,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -414,7 +418,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color green', async () => {
itWebgl('background true color green', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -423,7 +427,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -432,7 +436,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color blue', async () => {
itWebgl('foreground true color blue', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -441,7 +445,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -450,7 +454,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color blue', async () => {
itWebgl('background true color blue', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -459,7 +463,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -468,7 +472,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color grey', async () => {
itWebgl('foreground true color grey', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -477,7 +481,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -486,7 +490,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color grey', async () => {
itWebgl('background true color grey', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -495,7 +499,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -504,7 +508,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color red inverse', async function(): Promise<void> {
itWebgl('foreground true color red inverse', async function(): Promise<void> {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -513,7 +517,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -522,7 +526,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color red inverse', async function(): Promise<void> {
itWebgl('background true color red inverse', async function(): Promise<void> {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -531,7 +535,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -540,7 +544,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color green inverse', async () => {
itWebgl('foreground true color green inverse', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -549,7 +553,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -558,7 +562,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color green inverse', async () => {
itWebgl('background true color green inverse', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -567,7 +571,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -576,7 +580,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color blue inverse', async () => {
itWebgl('foreground true color blue inverse', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -585,7 +589,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -594,7 +598,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color blue inverse', async () => {
itWebgl('background true color blue inverse', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -603,7 +607,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -612,7 +616,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color grey inverse', async () => {
itWebgl('foreground true color grey inverse', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -621,7 +625,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -630,7 +634,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('background true color grey inverse', async () => {
itWebgl('background true color grey inverse', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -639,7 +643,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -648,7 +652,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
});
it('foreground true color grey invisible', async () => {
itWebgl('foreground true color grey invisible', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -657,16 +661,15 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
await pollFor(page, () => getCellColor(x + 1, y + 1), [0, 0, 0, 255]);
}
}
});
it('background true color grey invisible', async () => {
itWebgl('background true color grey invisible', async () => {
let data = '';
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
@@ -675,7 +678,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
}
data += '\\r\\n';
}
await writeSync(data);
await writeSync(page, data);
for (let y = 0; y < 16; y++) {
for (let x = 0; x < 16; x++) {
const i = y * 16 + x;
@@ -686,11 +689,13 @@ describe('WebGL Renderer Integration Tests', function(): void {
});
describe('minimumContrastRatio', async () => {
before(async () => setupBrowser());
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
if (areTestsEnabled) {
before(async () => setupBrowser());
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
}
it('should adjust 0-15 colors on black background', async () => {
itWebgl('should adjust 0-15 colors on black background', async () => {
const theme: ITheme = {
black: '#2e3436',
red: '#cc0000',
@@ -713,7 +718,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
window.term.setOption('theme', ${JSON.stringify(theme)});
window.term.setOption('minimumContrastRatio', 1);
`);
await writeSync(
await writeSync(page,
`\\x1b[30m█\\x1b[31m█\\x1b[32m█\\x1b[33m█\\x1b[34m█\\x1b[35m█\\x1b[36m█\\x1b[37m█\\r\\n` +
`\\x1b[90m█\\x1b[91m█\\x1b[92m█\\x1b[93m█\\x1b[94m█\\x1b[95m█\\x1b[96m█\\x1b[97m█`
);
@@ -757,7 +762,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
await pollFor(page, () => getCellColor(8, 2), [0xee, 0xee, 0xec, 255]);
});
it('should adjust 0-15 colors on white background', async () => {
itWebgl('should adjust 0-15 colors on white background', async () => {
const theme: ITheme = {
background: '#ffffff',
black: '#2e3436',
@@ -781,7 +786,7 @@ describe('WebGL Renderer Integration Tests', function(): void {
window.term.setOption('theme', ${JSON.stringify(theme)});
window.term.setOption('minimumContrastRatio', 1);
`);
await writeSync(
await writeSync(page,
`\\x1b[30m█\\x1b[31m█\\x1b[32m█\\x1b[33m█\\x1b[34m█\\x1b[35m█\\x1b[36m█\\x1b[37m█\\r\\n` +
`\\x1b[90m█\\x1b[91m█\\x1b[92m█\\x1b[93m█\\x1b[94m█\\x1b[95m█\\x1b[96m█\\x1b[97m█`
);
@@ -826,18 +831,20 @@ describe('WebGL Renderer Integration Tests', function(): void {
});
describe('selection', async () => {
before(async () => setupBrowser());
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
if (areTestsEnabled) {
before(async () => setupBrowser());
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
}
it('should resolve the inverse foreground color based on the original background color, not the selection', async () => {
itWebgl('should resolve the inverse foreground color based on the original background color, not the selection', async () => {
const theme: ITheme = {
foreground: '#FF0000',
background: '#00FF00',
selection: '#0000FF'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
await writeSync(` █\\x1b[7m█\\x1b[0m`);
await writeSync(page, ` █\\x1b[7m█\\x1b[0m`);
await pollFor(page, () => getCellColor(1, 1), [0, 255, 0, 255]);
await pollFor(page, () => getCellColor(2, 1), [255, 0, 0, 255]);
await pollFor(page, () => getCellColor(3, 1), [0, 255, 0, 255]);
@@ -850,36 +857,25 @@ describe('WebGL Renderer Integration Tests', function(): void {
});
describe('allowTransparency', async () => {
before(async () => setupBrowser({ rendererType: 'dom', allowTransparency: true}));
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
it('transparent background inverse', async () => {
if (areTestsEnabled) {
before(async () => setupBrowser({ rendererType: 'dom', allowTransparency: true }));
after(async () => browser.close());
beforeEach(async () => page.evaluate(`window.term.reset()`));
}
itWebgl('transparent background inverse', async () => {
const theme: ITheme = {
background: '#ff000080'
};
await page.evaluate(`window.term.setOption('theme', ${JSON.stringify(theme)});`);
const data = `\\x1b[7m█\x1b[0m`;
await writeSync(data);
await writeSync(page, data);
// Inverse background should be opaque
await pollFor(page, () => getCellColor(1, 1), [255, 0, 0, 255]);
});
});
});
async function openTerminal(options: ITerminalOptions = {}): Promise<void> {
await page.evaluate(`window.term = new Terminal(${JSON.stringify(options)})`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
if (options.rendererType === 'dom') {
await page.waitForSelector('.xterm-rows');
} else {
await page.waitForSelector('.xterm-text-layer');
}
}
async function writeSync(data: string): Promise<void> {
return page.evaluate(`new Promise(resolve => window.term.write('${data}', resolve))`);
}
async function getCellColor(col: number, row: number): Promise<number[]> {
await page.evaluate(`
window.gl = window.term._core._renderService._renderer._gl;
@@ -895,32 +891,20 @@ async function getCellColor(col: number, row: number): Promise<number[]> {
}
async function setupBrowser(options: ITerminalOptions = { rendererType: 'dom' }): Promise<void> {
browser = await puppeteer.launch({
headless: process.argv.indexOf('--headless') !== -1,
args: [`--window-size=${width},${height}`, `--no-sandbox`]
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
headless: process.argv.indexOf('--headless') !== -1
});
page = (await browser.pages())[0];
await page.setViewport({ width, height });
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
await page.goto(APP);
await openTerminal(options);
await openTerminal(page, options);
await page.evaluate(`
window.addon = new WebglAddon(true);
window.term.loadAddon(window.addon);
`);
}
export async function pollFor<T>(page: puppeteer.Page, evalOrFn: string | (() => Promise<T>), val: T, preFn?: () => Promise<void>): Promise<void> {
if (preFn) {
await preFn();
}
const result = typeof evalOrFn === 'string' ? await page.evaluate(evalOrFn) : await evalOrFn();
if (!deepEqual(result, val)) {
return new Promise<void>(r => {
setTimeout(() => r(pollFor(page, evalOrFn, val, preFn)), 1);
});
}
}
const COLORS_16_TO_255 = [
'#000000', '#00005f', '#000087', '#0000af', '#0000d7', '#0000ff', '#005f00', '#005f5f', '#005f87', '#005faf', '#005fd7', '#005fff', '#008700', '#00875f', '#008787', '#0087af',
'#0087d7', '#0087ff', '#00af00', '#00af5f', '#00af87', '#00afaf', '#00afd7', '#00afff', '#00d700', '#00d75f', '#00d787', '#00d7af', '#00d7d7', '#00d7ff', '#00ff00', '#00ff5f',
+40 -26
View File
@@ -3,7 +3,6 @@
* @license MIT
*/
import { ITerminal } from '../../../src/Types';
import { GlyphRenderer } from './GlyphRenderer';
import { LinkRenderLayer } from './renderLayer/LinkRenderLayer';
import { CursorRenderLayer } from './renderLayer/CursorRenderLayer';
@@ -16,8 +15,8 @@ import { Disposable } from 'common/Lifecycle';
import { NULL_CELL_CODE } from 'common/buffer/Constants';
import { Terminal, IEvent } from 'xterm';
import { IRenderLayer } from './renderLayer/Types';
import { IRenderDimensions, IRenderer, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
import { IColorSet } from 'browser/Types';
import { IRenderDimensions, IRenderer, IRequestRedrawEvent } from 'browser/renderer/Types';
import { ITerminal, IColorSet } from 'browser/Types';
import { EventEmitter } from 'common/EventEmitter';
import { CellData } from 'common/buffer/CellData';
@@ -39,8 +38,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
private _core: ITerminal;
private _isAttached: boolean;
private _onRequestRefreshRows = new EventEmitter<IRequestRefreshRowsEvent>();
public get onRequestRefreshRows(): IEvent<IRequestRefreshRowsEvent> { return this._onRequestRefreshRows.event; }
private _onRequestRedraw = new EventEmitter<IRequestRedrawEvent>();
public get onRequestRedraw(): IEvent<IRequestRedrawEvent> { return this._onRequestRedraw.event; }
constructor(
private _terminal: Terminal,
@@ -49,11 +48,11 @@ export class WebglRenderer extends Disposable implements IRenderer {
) {
super();
this._core = (<any>this._terminal)._core;
this._core = (this._terminal as any)._core;
this._renderLayers = [
new LinkRenderLayer(this._core.screenElement, 2, this._colors, this._core),
new CursorRenderLayer(this._core.screenElement, 3, this._colors, this._onRequestRefreshRows)
new LinkRenderLayer(this._core.screenElement!, 2, this._colors, this._core),
new CursorRenderLayer(this._core.screenElement!, 3, this._colors, this._onRequestRedraw)
];
this.dimensions = {
scaledCharWidth: 0,
@@ -81,9 +80,9 @@ export class WebglRenderer extends Disposable implements IRenderer {
};
this._gl = this._canvas.getContext('webgl2', contextAttributes) as IWebGL2RenderingContext;
if (!this._gl) {
throw new Error('WebGL2 not supported');
throw new Error('WebGL2 not supported ' + this._gl);
}
this._core.screenElement.appendChild(this._canvas);
this._core.screenElement!.appendChild(this._canvas);
this._rectangleRenderer = new RectangleRenderer(this._terminal, this._colors, this._gl, this.dimensions);
this._glyphRenderer = new GlyphRenderer(this._terminal, this._colors, this._gl, this.dimensions);
@@ -91,12 +90,12 @@ export class WebglRenderer extends Disposable implements IRenderer {
// Update dimensions and acquire char atlas
this.onCharSizeChanged();
this._isAttached = document.body.contains(this._core.screenElement);
this._isAttached = document.body.contains(this._core.screenElement!);
}
public dispose(): void {
this._renderLayers.forEach(l => l.dispose());
this._core.screenElement.removeChild(this._canvas);
this._core.screenElement!.removeChild(this._canvas);
super.dispose();
}
@@ -117,8 +116,12 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._refreshCharAtlas();
this._rectangleRenderer.updateSelection(this._model.selection);
this._glyphRenderer.updateSelection(this._model);
// Force a full refresh
this._model.clear();
this._model.clearSelection();
}
public onDevicePixelRatioChange(): void {
@@ -147,8 +150,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._canvas.style.height = `${this.dimensions.canvasHeight}px`;
// Resize the screen
this._core.screenElement.style.width = `${this.dimensions.canvasWidth}px`;
this._core.screenElement.style.height = `${this.dimensions.canvasHeight}px`;
this._core.screenElement!.style.width = `${this.dimensions.canvasWidth}px`;
this._core.screenElement!.style.height = `${this.dimensions.canvasHeight}px`;
this._glyphRenderer.setDimensions(this.dimensions);
this._glyphRenderer.onResize();
@@ -156,6 +159,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
// Force a full refresh
this._model.clear();
this._model.clearSelection();
}
public onCharSizeChanged(): void {
@@ -170,15 +174,15 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._renderLayers.forEach(l => l.onFocus(this._terminal));
}
public onSelectionChanged(start: [number, number], end: [number, number], columnSelectMode: boolean): void {
public onSelectionChanged(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {
this._renderLayers.forEach(l => l.onSelectionChanged(this._terminal, start, end, columnSelectMode));
this._updateSelectionModel(start, end);
this._updateSelectionModel(start, end, columnSelectMode);
this._rectangleRenderer.updateSelection(this._model.selection, columnSelectMode);
this._glyphRenderer.updateSelection(this._model, columnSelectMode);
this._rectangleRenderer.updateSelection(this._model.selection);
this._glyphRenderer.updateSelection(this._model);
this._onRequestRefreshRows.fire({ start: 0, end: this._terminal.rows - 1 });
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
}
public onCursorMove(): void {
@@ -212,6 +216,14 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._glyphRenderer.setAtlas(this._charAtlas);
}
public clearCharAtlas(): void {
this._charAtlas?.clearTexture();
this._model.clear();
this._updateModel(0, this._terminal.rows - 1);
this._glyphRenderer.updateSelection(this._model);
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
}
public clear(): void {
this._renderLayers.forEach(l => l.reset(this._terminal));
}
@@ -226,7 +238,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
public renderRows(start: number, end: number): void {
if (!this._isAttached) {
if (document.body.contains(this._core.screenElement) && (<any>this._core)._charSizeService.width && (<any>this._core)._charSizeService.height) {
if (document.body.contains(this._core.screenElement!) && (this._core as any)._charSizeService.width && (this._core as any)._charSizeService.height) {
this._updateDimensions();
this._refreshCharAtlas();
this._isAttached = true;
@@ -241,6 +253,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
// Tell renderer the frame is beginning
if (this._glyphRenderer.beginFrame()) {
this._model.clear();
this._model.clearSelection();
}
// Update model to reflect what's drawn
@@ -292,7 +305,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._rectangleRenderer.updateBackgrounds(this._model);
}
private _updateSelectionModel(start: [number, number], end: [number, number]): void {
private _updateSelectionModel(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {
const terminal = this._terminal;
// Selection does not exist
@@ -302,8 +315,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
}
// Translate from buffer position to viewport position
const viewportStartRow = start[1] - terminal.buffer.viewportY;
const viewportEndRow = end[1] - terminal.buffer.viewportY;
const viewportStartRow = start[1] - terminal.buffer.active.viewportY;
const viewportEndRow = end[1] - terminal.buffer.active.viewportY;
const viewportCappedStartRow = Math.max(viewportStartRow, 0);
const viewportCappedEndRow = Math.min(viewportEndRow, terminal.rows - 1);
@@ -314,6 +327,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
}
this._model.selection.hasSelection = true;
this._model.selection.columnSelectMode = columnSelectMode;
this._model.selection.viewportStartRow = viewportStartRow;
this._model.selection.viewportEndRow = viewportEndRow;
this._model.selection.viewportCappedStartRow = viewportCappedStartRow;
@@ -329,7 +343,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
// TODO: Acquire CharSizeService properly
// Perform a new measure if the CharMeasure dimensions are not yet available
if (!(<any>this._core)._charSizeService.width || !(<any>this._core)._charSizeService.height) {
if (!(this._core as any)._charSizeService.width || !(this._core as any)._charSizeService.height) {
return;
}
@@ -340,12 +354,12 @@ export class WebglRenderer extends Disposable implements IRenderer {
// NOTE: ceil fixes sometime, floor does others :s
this.dimensions.scaledCharWidth = Math.floor((<any>this._core)._charSizeService.width * this._devicePixelRatio);
this.dimensions.scaledCharWidth = Math.floor((this._core as any)._charSizeService.width * this._devicePixelRatio);
// Calculate the scaled character height. Height is ceiled in case
// devicePixelRatio is a floating point number in order to ensure there is
// enough space to draw the character to the cell.
this.dimensions.scaledCharHeight = Math.ceil((<any>this._core)._charSizeService.height * this._devicePixelRatio);
this.dimensions.scaledCharHeight = Math.ceil((this._core as any)._charSizeService.height * this._devicePixelRatio);
// Calculate the scaled cell height, if lineHeight is not 1 then the value
// will be floored because since lineHeight can never be lower then 1, there
@@ -20,7 +20,7 @@ export function generateConfig(scaledCharWidth: number, scaledCharHeight: number
background: colors.background,
cursor: NULL_COLOR,
cursorAccent: NULL_COLOR,
selection: NULL_COLOR,
selectionTransparent: NULL_COLOR,
selectionOpaque: NULL_COLOR,
// For the static char atlas, we only use the first 16 colors, but we need all 256 for the
// dynamic character atlas.
@@ -101,7 +101,7 @@ export class WebglCharAtlas implements IDisposable {
}
}
protected _doWarmUp(): void {
private _doWarmUp(): void {
// Pre-fill with ASCII 33-126
for (let i = 33; i < 126; i++) {
const rasterizedGlyph = this._drawToCache(i, DEFAULT_COLOR, DEFAULT_COLOR);
@@ -115,17 +115,26 @@ export class WebglCharAtlas implements IDisposable {
public beginFrame(): boolean {
if (this._currentRowY > TEXTURE_CAPACITY) {
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT);
this._cacheMap = {};
this._currentRowHeight = 0;
this._currentRowX = 0;
this._currentRowY = 0;
this._doWarmUp();
this.clearTexture();
this.warmUp();
return true;
}
return false;
}
public clearTexture(): void {
if (this._currentRowX === 0 && this._currentRowY === 0) {
return;
}
this._cacheCtx.clearRect(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT);
this._cacheMap = {};
this._cacheMapCombined = {};
this._currentRowHeight = 0;
this._currentRowX = 0;
this._currentRowY = 0;
this._didWarmUp = false;
}
public getRasterizedGlyphCombinedChar(chars: string, bg: number, fg: number): IRasterizedGlyph {
let rasterizedGlyphSet = this._cacheMapCombined[chars];
if (!rasterizedGlyphSet) {
@@ -349,7 +358,7 @@ export class WebglCharAtlas implements IDisposable {
const fontStyle = italic ? 'italic' : '';
this._tmpCtx.font =
`${fontStyle} ${fontWeight} ${this._config.fontSize * this._config.devicePixelRatio}px ${this._config.fontFamily}`;
this._tmpCtx.textBaseline = 'top';
this._tmpCtx.textBaseline = 'middle';
this._tmpCtx.fillStyle = this._getForegroundCss(bg, bgColorMode, bgColor, fg, fgColorMode, fgColor, inverse, bold);
@@ -359,7 +368,7 @@ export class WebglCharAtlas implements IDisposable {
}
// Draw the character
this._tmpCtx.fillText(chars, TMP_CANVAS_GLYPH_PADDING, TMP_CANVAS_GLYPH_PADDING);
this._tmpCtx.fillText(chars, TMP_CANVAS_GLYPH_PADDING, TMP_CANVAS_GLYPH_PADDING + this._config.scaledCharHeight / 2);
this._tmpCtx.restore();
// clear the background from the character to avoid issues with drawing over the previous
@@ -58,7 +58,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
public onFocus(terminal: Terminal): void {}
public onCursorMove(terminal: Terminal): void {}
public onGridChanged(terminal: Terminal, startRow: number, endRow: number): void {}
public onSelectionChanged(terminal: Terminal, start: [number, number], end: [number, number], columnSelectMode: boolean = false): void {}
public onSelectionChanged(terminal: Terminal, start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {}
public setColors(terminal: Terminal, colorSet: IColorSet): void {
this._refreshCharAtlas(terminal, colorSet);
@@ -74,7 +74,7 @@ export abstract class BaseRenderLayer implements IRenderLayer {
const oldCanvas = this._canvas;
this._alpha = alpha;
// Cloning preserves properties
this._canvas = <HTMLCanvasElement>this._canvas.cloneNode();
this._canvas = this._canvas.cloneNode() as HTMLCanvasElement;
this._initCanvas();
this._container.replaceChild(this._canvas, oldCanvas);
@@ -127,10 +127,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
*/
protected _fillCells(x: number, y: number, width: number, height: number): void {
this._ctx.fillRect(
x * this._scaledCellWidth,
y * this._scaledCellHeight,
width * this._scaledCellWidth,
height * this._scaledCellHeight);
x * this._scaledCellWidth,
y * this._scaledCellHeight,
width * this._scaledCellWidth,
height * this._scaledCellHeight);
}
/**
@@ -141,10 +141,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
*/
protected _fillBottomLineAtCells(x: number, y: number, width: number = 1): void {
this._ctx.fillRect(
x * this._scaledCellWidth,
(y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */,
width * this._scaledCellWidth,
window.devicePixelRatio);
x * this._scaledCellWidth,
(y + 1) * this._scaledCellHeight - window.devicePixelRatio - 1 /* Ensure it's drawn within the cell */,
width * this._scaledCellWidth,
window.devicePixelRatio);
}
/**
@@ -155,10 +155,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
*/
protected _fillLeftLineAtCell(x: number, y: number, width: number): void {
this._ctx.fillRect(
x * this._scaledCellWidth,
y * this._scaledCellHeight,
window.devicePixelRatio * width,
this._scaledCellHeight);
x * this._scaledCellWidth,
y * this._scaledCellHeight,
window.devicePixelRatio * width,
this._scaledCellHeight);
}
/**
@@ -170,10 +170,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
protected _strokeRectAtCell(x: number, y: number, width: number, height: number): void {
this._ctx.lineWidth = window.devicePixelRatio;
this._ctx.strokeRect(
x * this._scaledCellWidth + window.devicePixelRatio / 2,
y * this._scaledCellHeight + (window.devicePixelRatio / 2),
width * this._scaledCellWidth - window.devicePixelRatio,
(height * this._scaledCellHeight) - window.devicePixelRatio);
x * this._scaledCellWidth + window.devicePixelRatio / 2,
y * this._scaledCellHeight + (window.devicePixelRatio / 2),
width * this._scaledCellWidth - window.devicePixelRatio,
(height * this._scaledCellHeight) - window.devicePixelRatio);
}
/**
@@ -198,17 +198,17 @@ export abstract class BaseRenderLayer implements IRenderLayer {
protected _clearCells(x: number, y: number, width: number, height: number): void {
if (this._alpha) {
this._ctx.clearRect(
x * this._scaledCellWidth,
y * this._scaledCellHeight,
width * this._scaledCellWidth,
height * this._scaledCellHeight);
x * this._scaledCellWidth,
y * this._scaledCellHeight,
width * this._scaledCellWidth,
height * this._scaledCellHeight);
} else {
this._ctx.fillStyle = this._colors.background.css;
this._ctx.fillRect(
x * this._scaledCellWidth,
y * this._scaledCellHeight,
width * this._scaledCellWidth,
height * this._scaledCellHeight);
x * this._scaledCellWidth,
y * this._scaledCellHeight,
width * this._scaledCellWidth,
height * this._scaledCellHeight);
}
}
@@ -227,9 +227,9 @@ export abstract class BaseRenderLayer implements IRenderLayer {
this._ctx.textBaseline = 'middle';
this._clipRow(terminal, y);
this._ctx.fillText(
cell.getChars(),
x * this._scaledCellWidth + this._scaledCharLeft,
y * this._scaledCellHeight + this._scaledCharTop + this._scaledCharHeight / 2);
cell.getChars(),
x * this._scaledCellWidth + this._scaledCharLeft,
y * this._scaledCellHeight + this._scaledCharTop + this._scaledCharHeight / 2);
}
/**
@@ -240,10 +240,10 @@ export abstract class BaseRenderLayer implements IRenderLayer {
private _clipRow(terminal: Terminal, y: number): void {
this._ctx.beginPath();
this._ctx.rect(
0,
y * this._scaledCellHeight,
terminal.cols * this._scaledCellWidth,
this._scaledCellHeight);
0,
y * this._scaledCellHeight,
terminal.cols * this._scaledCellWidth,
this._scaledCellHeight);
this._ctx.clip();
}
@@ -8,7 +8,7 @@ import { BaseRenderLayer } from './BaseRenderLayer';
import { ICellData } from 'common/Types';
import { CellData } from 'common/buffer/CellData';
import { IColorSet } from 'browser/Types';
import { IRenderDimensions, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
import { IRenderDimensions, IRequestRedrawEvent } from 'browser/renderer/Types';
import { IEventEmitter } from 'common/EventEmitter';
interface ICursorState {
@@ -34,7 +34,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
container: HTMLElement,
zIndex: number,
colors: IColorSet,
private _onRequestRefreshRowsEvent: IEventEmitter<IRequestRefreshRowsEvent>
private _onRequestRefreshRowsEvent: IEventEmitter<IRequestRedrawEvent>
) {
super(container, 'cursor', zIndex, true, colors);
this._state = {
@@ -76,14 +76,14 @@ export class CursorRenderLayer extends BaseRenderLayer {
if (this._cursorBlinkStateManager) {
this._cursorBlinkStateManager.pause();
}
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.cursorY, end: terminal.buffer.cursorY });
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY });
}
public onFocus(terminal: Terminal): void {
if (this._cursorBlinkStateManager) {
this._cursorBlinkStateManager.resume(terminal);
} else {
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.cursorY, end: terminal.buffer.cursorY });
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY });
}
}
@@ -100,7 +100,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
}
// Request a refresh from the terminal as management of rendering is being
// moved back to the terminal
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.cursorY, end: terminal.buffer.cursorY });
this._onRequestRefreshRowsEvent.fire({ start: terminal.buffer.active.cursorY, end: terminal.buffer.active.cursorY });
}
public onCursorMove(terminal: Terminal): void {
@@ -125,8 +125,11 @@ export class CursorRenderLayer extends BaseRenderLayer {
return;
}
const cursorY = terminal.buffer.baseY + terminal.buffer.cursorY;
const viewportRelativeCursorY = cursorY - terminal.buffer.viewportY;
const cursorY = terminal.buffer.active.baseY + terminal.buffer.active.cursorY;
const viewportRelativeCursorY = cursorY - terminal.buffer.active.viewportY;
// in case cursor.x == cols adjust visual cursor to cols - 1
const cursorX = Math.min(terminal.buffer.active.cursorX, terminal.cols - 1);
// Don't draw the cursor if it's off-screen
if (viewportRelativeCursorY < 0 || viewportRelativeCursorY >= terminal.rows) {
@@ -135,7 +138,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
}
// TODO: Need fast buffer API for loading cell
(terminal as any)._core.buffer.lines.get(cursorY).loadCell(terminal.buffer.cursorX, this._cell);
(terminal as any)._core.buffer.lines.get(cursorY).loadCell(cursorX, this._cell);
if (this._cell.content === undefined) {
return;
}
@@ -146,12 +149,12 @@ export class CursorRenderLayer extends BaseRenderLayer {
this._ctx.fillStyle = this._colors.cursor.css;
const cursorStyle = terminal.getOption('cursorStyle');
if (cursorStyle && cursorStyle !== 'block') {
this._cursorRenderers[cursorStyle](terminal, terminal.buffer.cursorX, viewportRelativeCursorY, this._cell);
this._cursorRenderers[cursorStyle](terminal, cursorX, viewportRelativeCursorY, this._cell);
} else {
this._renderBlurCursor(terminal, terminal.buffer.cursorX, viewportRelativeCursorY, this._cell);
this._renderBlurCursor(terminal, cursorX, viewportRelativeCursorY, this._cell);
}
this._ctx.restore();
this._state.x = terminal.buffer.cursorX;
this._state.x = cursorX;
this._state.y = viewportRelativeCursorY;
this._state.isFocused = false;
this._state.style = cursorStyle;
@@ -167,7 +170,7 @@ export class CursorRenderLayer extends BaseRenderLayer {
if (this._state) {
// The cursor is already in the correct spot, don't redraw
if (this._state.x === terminal.buffer.cursorX &&
if (this._state.x === cursorX &&
this._state.y === viewportRelativeCursorY &&
this._state.isFocused === isTerminalFocused(terminal) &&
this._state.style === terminal.getOption('cursorStyle') &&
@@ -178,10 +181,10 @@ export class CursorRenderLayer extends BaseRenderLayer {
}
this._ctx.save();
this._cursorRenderers[terminal.getOption('cursorStyle') || 'block'](terminal, terminal.buffer.cursorX, viewportRelativeCursorY, this._cell);
this._cursorRenderers[terminal.getOption('cursorStyle') || 'block'](terminal, cursorX, viewportRelativeCursorY, this._cell);
this._ctx.restore();
this._state.x = terminal.buffer.cursorX;
this._state.x = cursorX;
this._state.y = viewportRelativeCursorY;
this._state.isFocused = false;
this._state.style = terminal.getOption('cursorStyle');
@@ -299,7 +302,7 @@ class CursorBlinkStateManager {
// the regular interval is setup in order to support restarting the blink
// animation in a lightweight way (without thrashing clearInterval and
// setInterval).
this._blinkStartTimeout = <number><any>setTimeout(() => {
this._blinkStartTimeout = window.setTimeout(() => {
// Check if another animation restart was requested while this was being
// started
if (this._animationTimeRestarted) {
@@ -319,7 +322,7 @@ class CursorBlinkStateManager {
});
// Setup the blink interval
this._blinkInterval = <number><any>setInterval(() => {
this._blinkInterval = window.setInterval(() => {
// Adjust the animation time if it was restarted
if (this._animationTimeRestarted) {
// calc time diff
@@ -357,6 +360,9 @@ class CursorBlinkStateManager {
}
public resume(terminal: Terminal): void {
// Clear out any existing timers just in case
this.pause();
this._animationTimeRestarted = undefined;
this._restartInterval();
this.restartBlinkAnimation(terminal);
@@ -3,21 +3,23 @@
* @license MIT
*/
import { ILinkifierAccessor } from '../../../../src/Types';
import { Terminal } from 'xterm';
import { BaseRenderLayer } from './BaseRenderLayer';
import { INVERTED_DEFAULT_COLOR } from 'browser/renderer/atlas/Constants';
import { is256Color } from '../atlas/CharAtlasUtils';
import { IColorSet, ILinkifierEvent } from 'browser/Types';
import { ITerminal, IColorSet, ILinkifierEvent } from 'browser/Types';
import { IRenderDimensions } from 'browser/renderer/Types';
export class LinkRenderLayer extends BaseRenderLayer {
private _state: ILinkifierEvent | undefined;
constructor(container: HTMLElement, zIndex: number, colors: IColorSet, terminal: ILinkifierAccessor) {
constructor(container: HTMLElement, zIndex: number, colors: IColorSet, terminal: ITerminal) {
super(container, 'link', zIndex, true, colors);
terminal.linkifier.onLinkHover(e => this._onLinkHover(e));
terminal.linkifier.onLinkLeave(e => this._onLinkLeave(e));
terminal.linkifier.onShowLinkUnderline(e => this._onShowLinkUnderline(e));
terminal.linkifier.onHideLinkUnderline(e => this._onHideLinkUnderline(e));
terminal.linkifier2.onShowLinkUnderline(e => this._onShowLinkUnderline(e));
terminal.linkifier2.onHideLinkUnderline(e => this._onHideLinkUnderline(e));
}
public resize(terminal: Terminal, dim: IRenderDimensions): void {
@@ -42,7 +44,7 @@ export class LinkRenderLayer extends BaseRenderLayer {
}
}
private _onLinkHover(e: ILinkifierEvent): void {
private _onShowLinkUnderline(e: ILinkifierEvent): void {
if (e.fg === INVERTED_DEFAULT_COLOR) {
this._ctx.fillStyle = this._colors.background.css;
} else if (e.fg !== undefined && is256Color(e.fg)) {
@@ -66,7 +68,7 @@ export class LinkRenderLayer extends BaseRenderLayer {
this._state = e;
}
private _onLinkLeave(e: ILinkifierEvent): void {
private _onHideLinkUnderline(e: ILinkifierEvent): void {
this._clearCurrentLink();
}
}
@@ -42,7 +42,7 @@ export interface IRenderLayer extends IDisposable {
/**
* Calls when the selection changes.
*/
onSelectionChanged(terminal: Terminal, start: [number, number], end: [number, number], columnSelectMode: boolean): void;
onSelectionChanged(terminal: Terminal, start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void;
/**
* Registers a handler to join characters to render as a group
+17 -5
View File
@@ -12,17 +12,29 @@
"removeComments": true,
"baseUrl": ".",
"paths": {
"common/*": [ "../../../src/common/*" ],
"browser/*": [ "../../../src/browser/*" ]
"common/*": [
"../../../src/common/*"
],
"browser/*": [
"../../../src/browser/*"
]
},
"strict": true
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{ "path": "../../../src/common" },
{ "path": "../../../src/browser" }
{
"path": "../../../src/common"
},
{
"path": "../../../src/browser"
}
]
}
+7 -2
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { Terminal, IDisposable, ITerminalAddon } from 'xterm';
import { Terminal, ITerminalAddon } from 'xterm';
declare module 'xterm-addon-webgl' {
/**
@@ -15,7 +15,7 @@ declare module 'xterm-addon-webgl' {
constructor(preserveDrawingBuffer?: boolean);
/**
* Activates the addon
* Activates the addon.
* @param terminal The terminal the addon is being loaded in.
*/
public activate(terminal: Terminal): void;
@@ -24,5 +24,10 @@ declare module 'xterm-addon-webgl' {
* Disposes the addon.
*/
public dispose(): void;
/**
* Clears the terminal's texture atlas and triggers a redraw.
*/
public clearTextureAtlas(): void;
}
}
+41 -22
View File
@@ -6,13 +6,11 @@
jobs:
- job: Linux
pool:
vmImage: 'ubuntu-16.04'
variables:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
vmImage: 'ubuntu-18.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: YarnInstaller@3
inputs:
@@ -41,13 +39,11 @@ jobs:
- job: macOS
pool:
vmImage: 'xcode9-macos10.13'
variables:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
vmImage: 'macOS-10.15'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: CacheBeta@1
inputs:
@@ -64,12 +60,10 @@ jobs:
- job: Windows
pool:
vmImage: 'vs2017-win2016'
variables:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: CacheBeta@1
inputs:
@@ -85,39 +79,66 @@ jobs:
- job: Linux_IntegrationTests
pool:
vmImage: 'ubuntu-16.04'
vmImage: 'ubuntu-18.04'
steps:
- script: |
# source: https://github.com/microsoft/playwright/issues/1041
sudo apt update
sudo apt install libwoff1 libopus0 libwebp6 libwebpdemux2 libenchant1c2a libgudev-1.0-0 libsecret-1-0 libhyphen0 libgdk-pixbuf2.0-0 libegl1 libnotify4 libxslt1.1 libevent-2.1-6 libgles2 libgl1 libegl1 libvpx5
# for chromium
sudo apt install libnss3 libxss1 libasound2
# for firefox
sudo apt install libdbus-glib-1-2 libxt6
displayName: Install required packages
- task: NodeTool@0
inputs:
versionSpec: '8.x'
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: YarnInstaller@3
inputs:
versionSpec: '1.x'
displayName: 'Install Yarn'
- task: CacheBeta@1
inputs:
key: yarn2 | $(Agent.OS) | yarn.lock
path: node_modules
displayName: Cache node modules
- script: yarn --frozen-lockfile
displayName: 'Install dependencies and build'
- script: |
yarn start &
sleep 10
yarn test-api --headless --forbid-only
displayName: 'Linux Integration tests'
displayName: 'Start test server'
- script: yarn test-api-chromium --headless --forbid-only
displayName: 'Integration tests (Chromium)'
- script: xvfb-run --auto-servernum -- bash -c "yarn test-api-firefox --headless --forbid-only"
displayName: 'Integration tests (Firefox)'
- job: macOS_IntegrationTests
pool:
vmImage: 'xcode9-macos10.13'
vmImage: 'macOS-10.15'
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: CacheBeta@1
inputs:
key: yarn2 | $(Agent.OS) | yarn.lock
path: node_modules
displayName: Cache node modules
- script: yarn --frozen-lockfile
displayName: 'Install dependencies and build'
- script: |
yarn start &
sleep 10
yarn test-api --headless --forbid-only
displayName: 'MacOS Integration tests'
displayName: 'Start test server'
- script: yarn test-api-chromium --headless --forbid-only
displayName: 'Integration tests (Chromium)'
- script: yarn test-api-firefox --headless --forbid-only
displayName: 'Integration tests (Firefox)'
- script: yarn test-api-webkit --headless --forbid-only
displayName: 'Integration tests (Webkit)'
- job: Release
dependsOn:
@@ -129,12 +150,10 @@ jobs:
condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['FORCE_RELEASE'], 'true')))
pool:
vmImage: 'ubuntu-16.04'
variables:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
versionSpec: '10.x'
displayName: 'Install Node.js'
- task: YarnInstaller@3
inputs:
+23
View File
@@ -0,0 +1,23 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
const playwright = require('playwright-core');
const fs = require('fs');
// Default to chromium
let browserType = playwright['chromium'];
const index = process.argv.indexOf('--browser');
if (index !== -1 && process.argv.length > index + 1 && typeof process.argv[index + 1] === 'string') {
const string = process.argv[index + 1];
if (string === 'firefox' || string === 'webkit') {
browserType = playwright[string];
}
}
const exists = fs.existsSync(browserType.executablePath());
if (!exists) {
console.log(`Downloading ${browserType.name()}`);
browserType.downloadBrowserIfNeeded().then(() => process.exit(0));
}
+14 -8
View File
@@ -1,7 +1,7 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*
*
* Script to extract vt features documented in docstrings.
*/
const fs = require('fs');
@@ -32,9 +32,15 @@ const TYPES = [
'SOS'
];
const MARKDOWN_TMPL = `
const MARKDOWN_TMPL = `---
title: Supported Terminal Sequences
category: API
---
{::options parse_block_html="true" /}
# Supported Terminal Sequences
xterm.js version: {{version}}
## Table of Contents
@@ -259,7 +265,7 @@ To denote the sequences the tables use the same abbreviations as xterm does:
function hideDetailSections() {
for (let section of document.getElementsByClassName('sequence-details')) section.style.display = 'none';
}
function decorateDetailLinks() {
for (let link of document.getElementsByClassName('link-details')) {
link.addEventListener("click", toggleDetails, false);
@@ -338,11 +344,11 @@ function applyMacros(s) {
return s;
}
function replaceStatus(s) {
if (s === 'supported') return '<span title="supported">✓</span>';
if (s === 'unsupported') return '<span title="unsupported">✗</span>';
return s;
}
// function replaceStatus(s) {
// if (s === 'supported') return '<span title="supported">✓</span>';
// if (s === 'unsupported') return '<span title="unsupported">✗</span>';
// return s;
// }
function createAnchorSlug(s) {
return s.toLowerCase().split(' ').join('-');
+1
View File
@@ -28,6 +28,7 @@ if (changedFiles.some(e => e.search(/^addons\//) === -1)) {
const addonPackageDirs = [
path.resolve(__dirname, '../addons/xterm-addon-attach'),
path.resolve(__dirname, '../addons/xterm-addon-fit'),
path.resolve(__dirname, '../addons/xterm-addon-ligatures'),
path.resolve(__dirname, '../addons/xterm-addon-search'),
path.resolve(__dirname, '../addons/xterm-addon-serialize'),
path.resolve(__dirname, '../addons/xterm-addon-unicode11'),
-1
View File
@@ -13,7 +13,6 @@ const env = { ...process.env };
env.NODE_PATH = path.resolve(__dirname, '../out');
let testFiles = [
'./out/*test.js',
'./out/**/*test.js',
'./addons/**/out/*test.js',
];
+52
View File
@@ -0,0 +1,52 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
const cp = require('child_process');
const path = require('path');
// Add `out` to the NODE_PATH so absolute paths can be resolved.
const env = { ...process.env };
env.NODE_PATH = path.resolve(__dirname, '../out');
let testFiles = [
'./addons/**/out/*api.js',
'./out-test/**/*api.js',
];
let flagArgs = [];
if (process.argv.length > 2) {
const args = process.argv.slice(2);
flagArgs = args.filter(e => e.startsWith('--')).map(arg => arg.split('=')).reduce((arr, val) => arr.concat([...val], []));
console.info(flagArgs);
// ability to inject particular test files via
// yarn test [testFileA testFileB ...]
files = args.filter(e => !e.startsWith('--'));
if (files.length) {
testFiles = files;
}
}
env.DEBUG = flagArgs.indexOf('--debug') >= 0 ? 'debug' : '';
const run = cp.spawnSync(
npmBinScript('mocha'),
[...testFiles, ...flagArgs],
{
cwd: path.resolve(__dirname, '..'),
env,
stdio: 'inherit'
}
);
function npmBinScript(script) {
return path.resolve(__dirname, `../node_modules/.bin/` + (process.platform === 'win32' ? `${script}.cmd` : script));
}
process.exit(run.status);
+4 -4
View File
@@ -59,10 +59,10 @@
}
.xterm .xterm-helper-textarea {
/*
* HACK: to fix IE's blinking cursor
* Move textarea out of the screen to the far left, so that the cursor is not visible.
*/
padding: 0;
border: 0;
margin: 0;
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
position: absolute;
opacity: 0;
left: -9999em;
+15 -6
View File
@@ -8,7 +8,7 @@
/// <reference path="../typings/xterm.d.ts"/>
// Use tsc version (yarn watch)
import { Terminal } from '../out/public/Terminal';
import { Terminal } from '../out/browser/public/Terminal';
import { AttachAddon } from '../addons/xterm-addon-attach/out/AttachAddon';
import { FitAddon } from '../addons/xterm-addon-fit/out/FitAddon';
import { SearchAddon, ISearchOptions } from '../addons/xterm-addon-search/out/SearchAddon';
@@ -112,9 +112,15 @@ const disposeRecreateButtonHandler = () => {
term = null;
window.term = null;
socket = null;
addons.attach.instance = undefined;
addons.fit.instance = undefined;
addons.search.instance = undefined;
addons.serialize.instance = undefined;
addons.unicode11.instance = undefined;
addons['web-links'].instance = undefined;
addons.webgl.instance = undefined;
document.getElementById('dispose').innerHTML = 'Recreate Terminal';
}
else {
} else {
createTerminal();
document.getElementById('dispose').innerHTML = 'Dispose terminal';
}
@@ -152,7 +158,8 @@ function createTerminal(): void {
addons.serialize.instance = new SerializeAddon();
addons.fit.instance = new FitAddon();
addons.unicode11.instance = new Unicode11Addon();
addons['web-links'].instance = new WebLinksAddon();
// TODO: Remove arguments when link provider API is the default
addons['web-links'].instance = new WebLinksAddon(undefined, undefined, true);
typedTerm.loadAddon(addons.fit.instance);
typedTerm.loadAddon(addons.search.instance);
typedTerm.loadAddon(addons.serialize.instance);
@@ -356,7 +363,7 @@ function initAddons(term: TerminalType): void {
if (!addon.canChange) {
checkbox.disabled = true;
}
checkbox.addEventListener('change', () => {
addDomListener(checkbox, 'change', () => {
if (checkbox.checked) {
addon.instance = new addon.ctor();
term.loadAddon(addon.instance);
@@ -385,7 +392,9 @@ function initAddons(term: TerminalType): void {
wrapper.appendChild(label);
fragment.appendChild(wrapper);
});
document.getElementById('addons-container').appendChild(fragment);
const container = document.getElementById('addons-container');
container.innerHTML = '';
container.appendChild(fragment);
}
function addDomListener(element: HTMLElement, type: string, handler: (...args: any[]) => any): void {
+6 -2
View File
@@ -2,6 +2,11 @@
<html>
<head>
<title>xterm.js demo</title>
<!--
WARNING: This demo is a barebones implementation designed for development and evaluation
purposes only. It is definitely NOT production ready and does not aim to be so. Exposing the
demo to the public as is would introduce security risks for the host.
-->
<link rel="shortcut icon" type="image/png" href="/logo.png">
<link rel="stylesheet" href="/xterm.css" />
<link rel="stylesheet" href="/style.css" />
@@ -13,7 +18,7 @@
<div id="terminal-container"></div>
<div>
<h3>Options</h3>
<p>These options can be set in the <code>Terminal</code> constructor or using the <code>Terminal.setOption</code> function.</p>
<p>These options can be set in the <code>Terminal</code> constructor or by using the <code>Terminal.setOption</code> function.</p>
<div id="options-container"></div>
</div>
<div>
@@ -44,7 +49,6 @@
</div>
</div>
<hr/>
<p><strong>Attention:</strong> The demo is a barebones implementation and is designed for the development and evaluation of xterm.js only. Exposing the demo to the public as is would introduce security risks for the host.</p>
<button id="dispose" title="This is used to testing memory leaks">Dispose terminal</button>
<script src="dist/client-bundle.js" defer ></script>
</body>
+6
View File
@@ -1,3 +1,9 @@
/**
* WARNING: This demo is a barebones implementation designed for development and evaluation
* purposes only. It is definitely NOT production ready and does not aim to be so. Exposing the
* demo to the public as is would introduce security risks for the host.
**/
var express = require('express');
var expressWs = require('express-ws');
var os = require('os');
-17
View File
@@ -1,17 +0,0 @@
version: "3"
services:
web:
image: xtermjs/xterm.js:latest
build: .
volumes:
- ./:/usr/src/app
ports:
- ${XTERMJS_PORT:-3000}:3000
command: ["npm", "start"]
watch:
build: .
volumes:
- ./:/usr/src/app
command: ["npm", "run", "watch"]
+33 -26
View File
@@ -1,7 +1,7 @@
{
"name": "xterm",
"description": "Full xterm terminal, in your browser",
"version": "4.4.0",
"version": "4.9.0",
"main": "lib/xterm.js",
"style": "css/xterm.css",
"types": "typings/xterm.d.ts",
@@ -11,10 +11,16 @@
"prepackage": "npm run build",
"package": "webpack",
"start": "node demo/start",
"lint": "tslint 'src/**/*.ts' 'addons/*/src/**/*.ts'",
"lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/",
"test": "npm run test-unit",
"posttest": "npm run lint",
"test-api": "mocha \"**/*.api.js\"",
"test-api": "npm run test-api-chromium",
"test-api-chromium": "node ./bin/test_api.js --browser=chromium --timeout=20000",
"test-api-firefox": "node ./bin/test_api.js --browser=firefox --timeout=20000",
"test-api-webkit": "node ./bin/test_api.js --browser=webkit --timeout=20000",
"pretest-api-chromium": "node ./bin/download_browser.js --browser chromium",
"pretest-api-firefox": "node ./bin/download_browser.js --browser firefox",
"pretest-api-webkit": "node ./bin/download_browser.js --browser webkit",
"test-unit": "node ./bin/test.js",
"test-unit-coverage": "node ./bin/test.js --coverage",
"build": "tsc -b ./tsconfig.all.json",
@@ -30,36 +36,37 @@
"vtfeatures": "node bin/extract_vtfeatures.js src/**/*.ts src/*.ts"
},
"devDependencies": {
"@types/chai": "^3.4.34",
"@types/chai": "^4.2.12",
"@types/debug": "^4.1.5",
"@types/deep-equal": "^1.0.1",
"@types/glob": "^5.0.35",
"@types/jsdom": "11.0.1",
"@types/mocha": "^2.2.33",
"@types/node": "6.0.108",
"@types/puppeteer": "^1.12.4",
"@types/glob": "^7.1.3",
"@types/jsdom": "^16.2.4",
"@types/mocha": "^8.0.3",
"@types/node": "^10.17.17",
"@types/utf8": "^2.1.6",
"@types/webpack": "^4.4.11",
"@types/ws": "^6.0.1",
"chai": "3.5.0",
"deep-equal": "^1.1.0",
"@types/webpack": "^4.41.22",
"@types/ws": "^7.2.6",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^3.10.1",
"chai": "^4.2.0",
"deep-equal": "^2.0.3",
"eslint": "^7.8.1",
"express": "^4.17.1",
"express-ws": "^4.0.0",
"glob": "^7.0.5",
"jsdom": "^11.11.0",
"mocha": "^6.1.4",
"mustache": "^3.0.1",
"jsdom": "^16.4.0",
"mocha": "^8.1.3",
"mustache": "^4.0.1",
"node-pty": "^0.9.0",
"nyc": "13",
"puppeteer": "^1.15.0",
"source-map-loader": "^0.2.4",
"ts-loader": "^6.0.4",
"tslint": "^5.18.0",
"tslint-consistent-codestyle": "^1.13.0",
"typescript": "3.7",
"nyc": "^15.1.0",
"playwright-core": "^0.11.1",
"source-map-loader": "^1.1.0",
"ts-loader": "^8.0.3",
"typescript": "4.0",
"utf8": "^3.0.0",
"webpack": "^4.35.3",
"webpack-cli": "^3.1.0",
"ws": "^7.0.0",
"webpack": "^4.44.1",
"webpack-cli": "^3.3.12",
"ws": "^7.3.1",
"xterm-benchmark": "^0.1.3"
}
}
File diff suppressed because it is too large Load Diff
-356
View File
@@ -1,356 +0,0 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { IRenderer, IRenderDimensions, CharacterJoinerHandler, IRequestRefreshRowsEvent } from 'browser/renderer/Types';
import { IInputHandlingTerminal, ICompositionHelper, ITerminal, IBrowser, ITerminalOptions } from './Types';
import { IBuffer, IBufferStringIterator, IBufferSet } from 'common/buffer/Types';
import { IBufferLine, ICellData, IAttributeData, ICircularList, XtermListener, ICharset } from 'common/Types';
import { Buffer } from 'common/buffer/Buffer';
import * as Browser from 'common/Platform';
import { IDisposable, IMarker, IEvent, ISelectionPosition } from 'xterm';
import { Terminal } from './Terminal';
import { AttributeData } from 'common/buffer/AttributeData';
import { IColorManager, IColorSet, ILinkMatcherOptions, ILinkifier, IViewport } from 'browser/Types';
import { IOptionsService, IUnicodeService } from 'common/services/Services';
import { EventEmitter } from 'common/EventEmitter';
import { IParams, IFunctionIdentifier } from 'common/parser/Types';
import { ISelectionService } from 'browser/services/Services';
export class TestTerminal extends Terminal {
get curAttrData(): IAttributeData { return (this as any)._inputHandler._curAttrData; }
keyDown(ev: any): boolean { return this._keyDown(ev); }
keyPress(ev: any): boolean { return this._keyPress(ev); }
}
export class MockTerminal implements ITerminal {
onBlur: IEvent<void>;
onFocus: IEvent<void>;
onA11yChar: IEvent<string>;
onA11yTab: IEvent<number>;
onCursorMove: IEvent<void>;
onLineFeed: IEvent<void>;
onSelectionChange: IEvent<void>;
onData: IEvent<string>;
onBinary: IEvent<string>;
onTitleChange: IEvent<string>;
onScroll: IEvent<number>;
onKey: IEvent<{ key: string; domEvent: KeyboardEvent; }>;
onRender: IEvent<{ start: number; end: number; }>;
onResize: IEvent<{ cols: number; rows: number; }>;
markers: IMarker[];
optionsService: IOptionsService;
unicodeService: IUnicodeService;
addMarker(cursorYOffset: number): IMarker {
throw new Error('Method not implemented.');
}
selectLines(start: number, end: number): void {
throw new Error('Method not implemented.');
}
scrollToLine(line: number): void {
throw new Error('Method not implemented.');
}
static string: any;
setOption(key: any, value: any): void {
throw new Error('Method not implemented.');
}
blur(): void {
throw new Error('Method not implemented.');
}
focus(): void {
throw new Error('Method not implemented.');
}
resize(columns: number, rows: number): void {
throw new Error('Method not implemented.');
}
writeln(data: string): void {
throw new Error('Method not implemented.');
}
paste(data: string): void {
throw new Error('Method not implemented.');
}
open(parent: HTMLElement): void {
throw new Error('Method not implemented.');
}
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void {
throw new Error('Method not implemented.');
}
addCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean): IDisposable {
throw new Error('Method not implemented.');
}
addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean): IDisposable {
throw new Error('Method not implemented.');
}
addEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable {
throw new Error('Method not implemented.');
}
addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable {
throw new Error('Method not implemented.');
}
registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => boolean | void, options?: ILinkMatcherOptions): number {
throw new Error('Method not implemented.');
}
deregisterLinkMatcher(matcherId: number): void {
throw new Error('Method not implemented.');
}
hasSelection(): boolean {
throw new Error('Method not implemented.');
}
getSelection(): string {
throw new Error('Method not implemented.');
}
getSelectionPosition(): ISelectionPosition | undefined {
throw new Error('Method not implemented.');
}
clearSelection(): void {
throw new Error('Method not implemented.');
}
select(column: number, row: number, length: number): void {
throw new Error('Method not implemented.');
}
selectAll(): void {
throw new Error('Method not implemented.');
}
dispose(): void {
throw new Error('Method not implemented.');
}
scrollPages(pageCount: number): void {
throw new Error('Method not implemented.');
}
scrollToTop(): void {
throw new Error('Method not implemented.');
}
scrollToBottom(): void {
throw new Error('Method not implemented.');
}
clear(): void {
throw new Error('Method not implemented.');
}
write(data: string): void {
throw new Error('Method not implemented.');
}
writeUtf8(data: Uint8Array): void {
throw new Error('Method not implemented.');
}
bracketedPasteMode: boolean;
renderer: IRenderer;
linkifier: ILinkifier;
isFocused: boolean;
options: ITerminalOptions = {};
element: HTMLElement;
screenElement: HTMLElement;
rowContainer: HTMLElement;
selectionContainer: HTMLElement;
selectionService: ISelectionService;
textarea: HTMLTextAreaElement;
rows: number;
cols: number;
browser: IBrowser = <any>Browser;
writeBuffer: string[];
children: HTMLElement[];
cursorHidden: boolean;
cursorState: number;
scrollback: number;
buffers: IBufferSet;
buffer: IBuffer;
viewport: IViewport;
applicationCursor: boolean;
handler(data: string): void {
throw new Error('Method not implemented.');
}
on(event: string, callback: (...args: any[]) => void): void {
throw new Error('Method not implemented.');
}
off(type: string, listener: XtermListener): void {
throw new Error('Method not implemented.');
}
addDisposableListener(type: string, handler: XtermListener): IDisposable {
throw new Error('Method not implemented.');
}
scrollLines(disp: number, suppressScrollEvent: boolean): void {
throw new Error('Method not implemented.');
}
scrollToRow(absoluteRow: number): number {
throw new Error('Method not implemented.');
}
cancel(ev: Event, force?: boolean): void {
throw new Error('Method not implemented.');
}
log(text: string): void {
throw new Error('Method not implemented.');
}
emit(event: string, data: any): void {
throw new Error('Method not implemented.');
}
reset(): void {
throw new Error('Method not implemented.');
}
showCursor(): void {
throw new Error('Method not implemented.');
}
refresh(start: number, end: number): void {
throw new Error('Method not implemented.');
}
registerCharacterJoiner(handler: CharacterJoinerHandler): number { return 0; }
deregisterCharacterJoiner(joinerId: number): void { }
}
export class MockInputHandlingTerminal implements IInputHandlingTerminal {
onA11yCharEmitter: EventEmitter<string>;
onA11yTabEmitter: EventEmitter<number>;
insertMode: boolean;
bracketedPasteMode: boolean;
sendFocus: boolean;
buffers: IBufferSet;
buffer: IBuffer = new MockBuffer();
viewport: IViewport;
scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void {
throw new Error('Method not implemented.');
}
is(term: string): boolean {
throw new Error('Method not implemented.');
}
resize(x: number, y: number): void {
throw new Error('Method not implemented.');
}
showCursor(): void {
throw new Error('Method not implemented.');
}
handler(data: string): void {
throw new Error('Method not implemented.');
}
handleTitle(title: string): void {
throw new Error('Method not implemented.');
}
}
export class MockBuffer implements IBuffer {
markers: IMarker[];
addMarker(y: number): IMarker {
throw new Error('Method not implemented.');
}
isCursorInViewport: boolean;
lines: ICircularList<IBufferLine>;
ydisp: number;
ybase: number;
hasScrollback: boolean;
y: number;
x: number;
tabs: any;
scrollBottom: number;
scrollTop: number;
savedY: number;
savedX: number;
savedCharset: ICharset | null;
savedCurAttrData = new AttributeData();
translateBufferLineToString(lineIndex: number, trimRight: boolean, startCol?: number, endCol?: number): string {
return Buffer.prototype.translateBufferLineToString.apply(this, arguments);
}
getWrappedRangeForLine(y: number): { first: number; last: number; } {
return Buffer.prototype.getWrappedRangeForLine.apply(this, arguments);
}
nextStop(x?: number): number {
throw new Error('Method not implemented.');
}
prevStop(x?: number): number {
throw new Error('Method not implemented.');
}
setLines(lines: ICircularList<IBufferLine>): void {
this.lines = lines;
}
getBlankLine(attr: IAttributeData, isWrapped?: boolean): IBufferLine {
return Buffer.prototype.getBlankLine.apply(this, arguments);
}
stringIndexToBufferIndex(lineIndex: number, stringIndex: number): number[] {
return Buffer.prototype.stringIndexToBufferIndex.apply(this, arguments);
}
iterator(trimRight: boolean, startIndex?: number, endIndex?: number): IBufferStringIterator {
return Buffer.prototype.iterator.apply(this, arguments);
}
getNullCell(attr?: IAttributeData): ICellData {
throw new Error('Method not implemented.');
}
getWhitespaceCell(attr?: IAttributeData): ICellData {
throw new Error('Method not implemented.');
}
}
export class MockRenderer implements IRenderer {
onRequestRefreshRows: IEvent<IRequestRefreshRowsEvent>;
onCanvasResize: IEvent<{ width: number; height: number; }>;
onRender: IEvent<{ start: number; end: number; }>;
dispose(): void {
throw new Error('Method not implemented.');
}
colorManager: IColorManager;
on(type: string, listener: XtermListener): void {
throw new Error('Method not implemented.');
}
off(type: string, listener: XtermListener): void {
throw new Error('Method not implemented.');
}
emit(type: string, data?: any): void {
throw new Error('Method not implemented.');
}
addDisposableListener(type: string, handler: XtermListener): IDisposable {
throw new Error('Method not implemented.');
}
dimensions: IRenderDimensions;
setColors(colors: IColorSet): void {
throw new Error('Method not implemented.');
}
onResize(cols: number, rows: number): void {}
onCharSizeChanged(): void {}
onBlur(): void {}
onFocus(): void {}
onSelectionChanged(start: [number, number], end: [number, number]): void {}
onCursorMove(): void {}
onOptionsChanged(): void {}
onDevicePixelRatioChange(): void {}
clear(): void {}
renderRows(start: number, end: number): void {}
registerCharacterJoiner(handler: CharacterJoinerHandler): number { return 0; }
deregisterCharacterJoiner(): boolean { return true; }
}
export class MockViewport implements IViewport {
dispose(): void {
throw new Error('Method not implemented.');
}
scrollBarWidth: number = 0;
onThemeChange(colors: IColorSet): void {
throw new Error('Method not implemented.');
}
onWheel(ev: WheelEvent): boolean {
throw new Error('Method not implemented.');
}
onTouchStart(ev: TouchEvent): void {
throw new Error('Method not implemented.');
}
onTouchMove(ev: TouchEvent): boolean {
throw new Error('Method not implemented.');
}
syncScrollArea(): void { }
getLinesScrolled(ev: WheelEvent): number {
throw new Error('Method not implemented.');
}
}
export class MockCompositionHelper implements ICompositionHelper {
compositionstart(): void {
throw new Error('Method not implemented.');
}
compositionupdate(ev: CompositionEvent): void {
throw new Error('Method not implemented.');
}
compositionend(): void {
throw new Error('Method not implemented.');
}
updateCompositionElements(dontRecurse?: boolean): void {
throw new Error('Method not implemented.');
}
keydown(ev: KeyboardEvent): boolean {
return true;
}
}
-234
View File
@@ -1,234 +0,0 @@
/**
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { ITerminalOptions as IPublicTerminalOptions, IDisposable, IMarker, ISelectionPosition } from 'xterm';
import { ICharset, IAttributeData, CharData, CoreMouseEventType } from 'common/Types';
import { IEvent, IEventEmitter } from 'common/EventEmitter';
import { IColorSet, ILinkifier, ILinkMatcherOptions, IViewport } from 'browser/Types';
import { IOptionsService, IUnicodeService } from 'common/services/Services';
import { IBuffer, IBufferSet } from 'common/buffer/Types';
import { IParams, IFunctionIdentifier } from 'common/parser/Types';
export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
export type LineData = CharData[];
/**
* This interface encapsulates everything needed from the Terminal by the
* InputHandler. This cleanly separates the large amount of methods needed by
* InputHandler cleanly from the ITerminal interface.
*/
export interface IInputHandlingTerminal {
insertMode: boolean;
bracketedPasteMode: boolean;
sendFocus: boolean;
buffers: IBufferSet;
buffer: IBuffer;
viewport: IViewport;
onA11yCharEmitter: IEventEmitter<string>;
onA11yTabEmitter: IEventEmitter<number>;
scroll(eraseAttr: IAttributeData, isWrapped?: boolean): void;
is(term: string): boolean;
resize(x: number, y: number): void;
showCursor(): void;
handleTitle(title: string): void;
}
export interface ICompositionHelper {
compositionstart(): void;
compositionupdate(ev: CompositionEvent): void;
compositionend(): void;
updateCompositionElements(dontRecurse?: boolean): void;
keydown(ev: KeyboardEvent): boolean;
}
/**
* Calls the parser and handles actions generated by the parser.
*/
export interface IInputHandler {
parse(data: string | Uint8Array): void;
print(data: Uint32Array, start: number, end: number): void;
/** C0 BEL */ bell(): void;
/** C0 LF */ lineFeed(): void;
/** C0 CR */ carriageReturn(): void;
/** C0 BS */ backspace(): void;
/** C0 HT */ tab(): void;
/** C0 SO */ shiftOut(): void;
/** C0 SI */ shiftIn(): void;
/** CSI @ */ insertChars(params: IParams): void;
/** CSI SP @ */ scrollLeft(params: IParams): void;
/** CSI A */ cursorUp(params: IParams): void;
/** CSI SP A */ scrollRight(params: IParams): void;
/** CSI B */ cursorDown(params: IParams): void;
/** CSI C */ cursorForward(params: IParams): void;
/** CSI D */ cursorBackward(params: IParams): void;
/** CSI E */ cursorNextLine(params: IParams): void;
/** CSI F */ cursorPrecedingLine(params: IParams): void;
/** CSI G */ cursorCharAbsolute(params: IParams): void;
/** CSI H */ cursorPosition(params: IParams): void;
/** CSI I */ cursorForwardTab(params: IParams): void;
/** CSI J */ eraseInDisplay(params: IParams): void;
/** CSI K */ eraseInLine(params: IParams): void;
/** CSI L */ insertLines(params: IParams): void;
/** CSI M */ deleteLines(params: IParams): void;
/** CSI P */ deleteChars(params: IParams): void;
/** CSI S */ scrollUp(params: IParams): void;
/** CSI T */ scrollDown(params: IParams, collect?: string): void;
/** CSI X */ eraseChars(params: IParams): void;
/** CSI Z */ cursorBackwardTab(params: IParams): void;
/** CSI ` */ charPosAbsolute(params: IParams): void;
/** CSI a */ hPositionRelative(params: IParams): void;
/** CSI b */ repeatPrecedingCharacter(params: IParams): void;
/** CSI c */ sendDeviceAttributesPrimary(params: IParams): void;
/** CSI > c */ sendDeviceAttributesSecondary(params: IParams): void;
/** CSI d */ linePosAbsolute(params: IParams): void;
/** CSI e */ vPositionRelative(params: IParams): void;
/** CSI f */ hVPosition(params: IParams): void;
/** CSI g */ tabClear(params: IParams): void;
/** CSI h */ setMode(params: IParams, collect?: string): void;
/** CSI l */ resetMode(params: IParams, collect?: string): void;
/** CSI m */ charAttributes(params: IParams): void;
/** CSI n */ deviceStatus(params: IParams, collect?: string): void;
/** CSI p */ softReset(params: IParams, collect?: string): void;
/** CSI q */ setCursorStyle(params: IParams, collect?: string): void;
/** CSI r */ setScrollRegion(params: IParams, collect?: string): void;
/** CSI s */ saveCursor(params: IParams): void;
/** CSI u */ restoreCursor(params: IParams): void;
/** CSI ' } */ insertColumns(params: IParams): void;
/** CSI ' ~ */ deleteColumns(params: IParams): void;
/** OSC 0
OSC 2 */ setTitle(data: string): void;
/** ESC E */ nextLine(): void;
/** ESC = */ keypadApplicationMode(): void;
/** ESC > */ keypadNumericMode(): void;
/** ESC % G
ESC % @ */ selectDefaultCharset(): void;
/** ESC ( C
ESC ) C
ESC * C
ESC + C
ESC - C
ESC . C
ESC / C */ selectCharset(collectAndFlag: string): void;
/** ESC D */ index(): void;
/** ESC H */ tabSet(): void;
/** ESC M */ reverseIndex(): void;
/** ESC c */ fullReset(): void;
/** ESC n
ESC o
ESC |
ESC }
ESC ~ */ setgLevel(level: number): void;
/** ESC # 8 */ screenAlignmentPattern(): void;
}
export interface ITerminal extends IPublicTerminal, IElementAccessor, IBufferAccessor, ILinkifierAccessor {
screenElement: HTMLElement;
browser: IBrowser;
buffer: IBuffer;
buffers: IBufferSet;
viewport: IViewport;
bracketedPasteMode: boolean;
optionsService: IOptionsService;
// TODO: We should remove options once components adopt optionsService
options: ITerminalOptions;
unicodeService: IUnicodeService;
onBlur: IEvent<void>;
onFocus: IEvent<void>;
onA11yChar: IEvent<string>;
onA11yTab: IEvent<number>;
scrollLines(disp: number, suppressScrollEvent?: boolean): void;
cancel(ev: Event, force?: boolean): boolean | void;
showCursor(): void;
}
// Portions of the public API that are required by the internal Terminal
export interface IPublicTerminal extends IDisposable {
textarea: HTMLTextAreaElement | undefined;
rows: number;
cols: number;
buffer: IBuffer;
markers: IMarker[];
onCursorMove: IEvent<void>;
onData: IEvent<string>;
onBinary: IEvent<string>;
onKey: IEvent<{ key: string, domEvent: KeyboardEvent }>;
onLineFeed: IEvent<void>;
onScroll: IEvent<number>;
onSelectionChange: IEvent<void>;
onRender: IEvent<{ start: number, end: number }>;
onResize: IEvent<{ cols: number, rows: number }>;
onTitleChange: IEvent<string>;
blur(): void;
focus(): void;
resize(columns: number, rows: number): void;
open(parent: HTMLElement): void;
attachCustomKeyEventHandler(customKeyEventHandler: (event: KeyboardEvent) => boolean): void;
addCsiHandler(id: IFunctionIdentifier, callback: (params: IParams) => boolean): IDisposable;
addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: IParams) => boolean): IDisposable;
addEscHandler(id: IFunctionIdentifier, callback: () => boolean): IDisposable;
addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
registerLinkMatcher(regex: RegExp, handler: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions): number;
deregisterLinkMatcher(matcherId: number): void;
registerCharacterJoiner(handler: (text: string) => [number, number][]): number;
deregisterCharacterJoiner(joinerId: number): void;
addMarker(cursorYOffset: number): IMarker;
hasSelection(): boolean;
getSelection(): string;
getSelectionPosition(): ISelectionPosition | undefined;
clearSelection(): void;
select(column: number, row: number, length: number): void;
selectAll(): void;
selectLines(start: number, end: number): void;
dispose(): void;
scrollLines(amount: number): void;
scrollPages(pageCount: number): void;
scrollToTop(): void;
scrollToBottom(): void;
scrollToLine(line: number): void;
clear(): void;
write(data: string | Uint8Array, callback?: () => void): void;
paste(data: string): void;
refresh(start: number, end: number): void;
reset(): void;
}
export interface IBufferAccessor {
buffer: IBuffer;
}
export interface IElementAccessor {
readonly element: HTMLElement | undefined;
}
export interface ILinkifierAccessor {
linkifier: ILinkifier;
}
// TODO: The options that are not in the public API should be reviewed
export interface ITerminalOptions extends IPublicTerminalOptions {
[key: string]: any;
cancelEvents?: boolean;
convertEol?: boolean;
termName?: string;
}
export interface IBrowser {
isNode: boolean;
userAgent: string;
platform: string;
isFirefox: boolean;
isMac: boolean;
isIpad: boolean;
isIphone: boolean;
isWindows: boolean;
}
@@ -3,8 +3,8 @@
* @license MIT
*/
import * as Strings from './browser/LocalizableStrings';
import { ITerminal } from './Types';
import * as Strings from 'browser/LocalizableStrings';
import { ITerminal } from 'browser/Types';
import { IBuffer } from 'common/buffer/Types';
import { isMac } from 'common/Platform';
import { RenderDebouncer } from 'browser/RenderDebouncer';
@@ -12,6 +12,7 @@ import { addDisposableDomListener } from 'browser/Lifecycle';
import { Disposable } from 'common/Lifecycle';
import { ScreenDprMonitor } from 'browser/ScreenDprMonitor';
import { IRenderService } from 'browser/services/Services';
import { removeElementFromParent } from 'browser/Dom';
const MAX_ROWS_TO_READ = 20;
@@ -56,6 +57,7 @@ export class AccessibilityManager extends Disposable {
this._rowContainer = document.createElement('div');
this._rowContainer.classList.add('xterm-accessibility-tree');
this._rowContainer.setAttribute('role', 'document');
this._rowElements = [];
for (let i = 0; i < this._terminal.rows; i++) {
this._rowElements[i] = this._createAccessibilityTreeNode();
@@ -78,6 +80,9 @@ export class AccessibilityManager extends Disposable {
this._liveRegion.setAttribute('aria-live', 'assertive');
this._accessibilityTreeRoot.appendChild(this._liveRegion);
if (!this._terminal.element) {
throw new Error('Cannot enable accessibility before Terminal.open');
}
this._terminal.element.insertAdjacentElement('afterbegin', this._accessibilityTreeRoot);
this.register(this._renderRowsDebouncer);
@@ -102,7 +107,7 @@ export class AccessibilityManager extends Disposable {
public dispose(): void {
super.dispose();
this._terminal.element.removeChild(this._accessibilityTreeRoot);
removeElementFromParent(this._accessibilityTreeRoot);
this._rowElements.length = 0;
}
@@ -236,9 +241,7 @@ export class AccessibilityManager extends Disposable {
// Only detach/attach on mac as otherwise messages can go unaccounced
if (isMac) {
if (this._liveRegion.parentNode) {
this._accessibilityTreeRoot.removeChild(this._liveRegion);
}
removeElementFromParent(this._liveRegion);
}
}
+4 -16
View File
@@ -42,17 +42,17 @@ export function copyHandler(ev: ClipboardEvent, selectionService: ISelectionServ
* @param ev The original paste event to be handled
* @param term The terminal on which to apply the handled paste event
*/
export function handlePasteEvent(ev: ClipboardEvent, textarea: HTMLTextAreaElement, bracketedPasteMode: boolean, coreService: ICoreService): void {
export function handlePasteEvent(ev: ClipboardEvent, textarea: HTMLTextAreaElement, coreService: ICoreService): void {
ev.stopPropagation();
if (ev.clipboardData) {
const text = ev.clipboardData.getData('text/plain');
paste(text, textarea, bracketedPasteMode, coreService);
paste(text, textarea, coreService);
}
}
export function paste(text: string, textarea: HTMLTextAreaElement, bracketedPasteMode: boolean, coreService: ICoreService): void {
export function paste(text: string, textarea: HTMLTextAreaElement, coreService: ICoreService): void {
text = prepareTextForTerminal(text);
text = bracketTextForPaste(text, bracketedPasteMode);
text = bracketTextForPaste(text, coreService.decPrivateModes.bracketedPasteMode);
coreService.triggerDataEvent(text, true);
textarea.value = '';
}
@@ -70,7 +70,6 @@ export function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextA
const top = ev.clientY - pos.top - 10;
// Bring textarea at the cursor position
textarea.style.position = 'absolute';
textarea.style.width = '20px';
textarea.style.height = '20px';
textarea.style.left = `${left}px`;
@@ -78,17 +77,6 @@ export function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextA
textarea.style.zIndex = '1000';
textarea.focus();
// Reset the terminal textarea's styling
// Timeout needs to be long enough for click event to be handled.
setTimeout(() => {
textarea.style.position = '';
textarea.style.width = '';
textarea.style.height = '';
textarea.style.left = '';
textarea.style.top = '';
textarea.style.zIndex = '';
}, 200);
}
/**
+52 -1
View File
@@ -117,11 +117,43 @@ describe('Color', () => {
assert.deepEqual(color.opaque({ css: '#ffffffff', rgba: 0xffffffff }), { css: '#ffffff', rgba: 0xffffffFF });
});
});
describe('isOpaque', () => {
it('should return true for opaque colors', () => {
assert.ok(color.isOpaque(css.toColor('#000000')));
assert.ok(color.isOpaque(css.toColor('#000000ff')));
assert.ok(color.isOpaque(css.toColor('#808080')));
assert.ok(color.isOpaque(css.toColor('#808080ff')));
assert.ok(color.isOpaque(css.toColor('#ffffff')));
assert.ok(color.isOpaque(css.toColor('#ffffffff')));
});
it('should return false for transparent colors', () => {
assert.ok(!color.isOpaque(css.toColor('#00000000')));
assert.ok(!color.isOpaque(css.toColor('#00000080')));
assert.ok(!color.isOpaque(css.toColor('#000000fe')));
assert.ok(!color.isOpaque(css.toColor('#80808000')));
assert.ok(!color.isOpaque(css.toColor('#80808080')));
assert.ok(!color.isOpaque(css.toColor('#808080fe')));
assert.ok(!color.isOpaque(css.toColor('#ffffff00')));
assert.ok(!color.isOpaque(css.toColor('#ffffff80')));
assert.ok(!color.isOpaque(css.toColor('#fffffffe')));
});
});
describe('opacity', () => {
it('should make the color transparent', () => {
assert.deepEqual(color.opacity(css.toColor('#000000'), 0), { css: '#00000000', rgba: 0x00000000 });
assert.deepEqual(color.opacity(css.toColor('#000000'), 0.25), { css: '#00000040', rgba: 0x00000040 });
assert.deepEqual(color.opacity(css.toColor('#000000'), 0.5), { css: '#00000080', rgba: 0x00000080 });
assert.deepEqual(color.opacity(css.toColor('#000000'), 0.75), { css: '#000000bf', rgba: 0x000000bf });
assert.deepEqual(color.opacity(css.toColor('#000000'), 1), { css: '#000000ff', rgba: 0x000000ff });
});
});
});
describe('css', () => {
describe('toColor', () => {
it('should covert a CSS string to an IColor', () => {
it('should convert the #rrggbb format to an IColor', () => {
assert.deepEqual(css.toColor('#000000'), { css: '#000000', rgba: 0x000000FF });
assert.deepEqual(css.toColor('#101010'), { css: '#101010', rgba: 0x101010FF });
assert.deepEqual(css.toColor('#202020'), { css: '#202020', rgba: 0x202020FF });
@@ -140,6 +172,25 @@ describe('Color', () => {
assert.deepEqual(css.toColor('#f0f0f0'), { css: '#f0f0f0', rgba: 0xf0f0f0FF });
assert.deepEqual(css.toColor('#ffffff'), { css: '#ffffff', rgba: 0xffffffFF });
});
it('should convert the #rrggbbaa format to an IColor', () => {
assert.deepEqual(css.toColor('#00000000'), { css: '#00000000', rgba: 0x00000000 });
assert.deepEqual(css.toColor('#10101010'), { css: '#10101010', rgba: 0x10101010 });
assert.deepEqual(css.toColor('#20202020'), { css: '#20202020', rgba: 0x20202020 });
assert.deepEqual(css.toColor('#30303030'), { css: '#30303030', rgba: 0x30303030 });
assert.deepEqual(css.toColor('#40404040'), { css: '#40404040', rgba: 0x40404040 });
assert.deepEqual(css.toColor('#50505050'), { css: '#50505050', rgba: 0x50505050 });
assert.deepEqual(css.toColor('#60606060'), { css: '#60606060', rgba: 0x60606060 });
assert.deepEqual(css.toColor('#70707070'), { css: '#70707070', rgba: 0x70707070 });
assert.deepEqual(css.toColor('#80808080'), { css: '#80808080', rgba: 0x80808080 });
assert.deepEqual(css.toColor('#90909090'), { css: '#90909090', rgba: 0x90909090 });
assert.deepEqual(css.toColor('#a0a0a0a0'), { css: '#a0a0a0a0', rgba: 0xa0a0a0a0 });
assert.deepEqual(css.toColor('#b0b0b0b0'), { css: '#b0b0b0b0', rgba: 0xb0b0b0b0 });
assert.deepEqual(css.toColor('#c0c0c0c0'), { css: '#c0c0c0c0', rgba: 0xc0c0c0c0 });
assert.deepEqual(css.toColor('#d0d0d0d0'), { css: '#d0d0d0d0', rgba: 0xd0d0d0d0 });
assert.deepEqual(css.toColor('#e0e0e0e0'), { css: '#e0e0e0e0', rgba: 0xe0e0e0e0 });
assert.deepEqual(css.toColor('#f0f0f0f0'), { css: '#f0f0f0f0', rgba: 0xf0f0f0f0 });
assert.deepEqual(css.toColor('#ffffffff'), { css: '#ffffffff', rgba: 0xffffffff });
});
});
});
+26 -4
View File
@@ -48,6 +48,10 @@ export namespace color {
return { css, rgba };
}
export function isOpaque(color: IColor): boolean {
return (color.rgba & 0xFF) === 0xFF;
}
export function ensureContrastRatio(bg: IColor, fg: IColor, ratio: number): IColor | undefined {
const result = rgba.ensureContrastRatio(bg.rgba, fg.rgba, ratio);
if (!result) {
@@ -68,6 +72,15 @@ export namespace color {
rgba: rgbaColor
};
}
export function opacity(color: IColor, opacity: number): IColor {
const a = Math.round(opacity * 0xFF);
const [r, g, b] = rgba.toChannels(color.rgba);
return {
css: channels.toCss(r, g, b, a),
rgba: channels.toRgba(r, g, b, a)
};
}
}
/**
@@ -75,10 +88,19 @@ export namespace color {
*/
export namespace css {
export function toColor(css: string): IColor {
return {
css,
rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0
};
switch (css.length) {
case 7: // #rrggbb
return {
css,
rgba: (parseInt(css.slice(1), 16) << 8 | 0xFF) >>> 0
};
case 9: // #rrggbbaa
return {
css,
rgba: parseInt(css.slice(1), 16) >>> 0
};
}
throw new Error('css.toColor: Unsupported css format');
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ describe('ColorManager', () => {
let cm: ColorManager;
let dom: jsdom.JSDOM;
let document: Document;
let window: Window;
let window: jsdom.DOMWindow;
beforeEach(() => {
dom = new jsdom.JSDOM('');
+12 -4
View File
@@ -92,7 +92,7 @@ export class ColorManager implements IColorManager {
background: DEFAULT_BACKGROUND,
cursor: DEFAULT_CURSOR,
cursorAccent: DEFAULT_CURSOR_ACCENT,
selection: DEFAULT_SELECTION,
selectionTransparent: DEFAULT_SELECTION,
selectionOpaque: color.blend(DEFAULT_BACKGROUND, DEFAULT_SELECTION),
ansi: DEFAULT_ANSI_COLORS.slice(),
contrastCache: this._contrastCache
@@ -115,8 +115,16 @@ export class ColorManager implements IColorManager {
this.colors.background = this._parseColor(theme.background, DEFAULT_BACKGROUND);
this.colors.cursor = this._parseColor(theme.cursor, DEFAULT_CURSOR, true);
this.colors.cursorAccent = this._parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT, true);
this.colors.selection = this._parseColor(theme.selection, DEFAULT_SELECTION, true);
this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selection);
this.colors.selectionTransparent = this._parseColor(theme.selection, DEFAULT_SELECTION, true);
this.colors.selectionOpaque = color.blend(this.colors.background, this.colors.selectionTransparent);
/**
* If selection color is opaque, blend it with background with 0.3 opacity
* Issue #2737
*/
if (color.isOpaque(this.colors.selectionTransparent)) {
const opacity = 0.3;
this.colors.selectionTransparent = color.opacity(this.colors.selectionTransparent, opacity);
}
this.colors.ansi[0] = this._parseColor(theme.black, DEFAULT_ANSI_COLORS[0]);
this.colors.ansi[1] = this._parseColor(theme.red, DEFAULT_ANSI_COLORS[1]);
this.colors.ansi[2] = this._parseColor(theme.green, DEFAULT_ANSI_COLORS[2]);
@@ -192,7 +200,7 @@ export class ColorManager implements IColorManager {
const rgba: number = channels.toRgba(r, g, b, alpha);
return {
rgba,
css: channels.toCss(r, g, b, alpha)
css
};
}
+41
View File
@@ -0,0 +1,41 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
import jsdom = require('jsdom');
import { removeElementFromParent } from 'browser/Dom';
import { strictEqual, doesNotThrow } from 'assert';
describe('Dom', () => {
const dom = new jsdom.JSDOM();
const document = dom.window.document;
describe('removeElementFromParent', () => {
it('should remove single child', () => {
const e = document.createElement('div');
document.body.appendChild(e);
strictEqual(e.parentElement, document.body);
removeElementFromParent(e);
strictEqual(e.parentElement, null);
});
it('should remove multiple elements', () => {
const e1 = document.createElement('div');
const e2 = document.createElement('div');
document.body.appendChild(e1);
document.body.appendChild(e2);
strictEqual(e1.parentElement, document.body);
strictEqual(e2.parentElement, document.body);
removeElementFromParent(e1, e2);
strictEqual(e1.parentElement, null);
strictEqual(e2.parentElement, null);
});
it('should not throw on undefined', () => {
const e = document.createElement('div');
document.body.appendChild(e);
strictEqual(e.parentElement, document.body);
doesNotThrow(() => removeElementFromParent(undefined, e));
strictEqual(e.parentElement, null);
});
});
});
+10
View File
@@ -0,0 +1,10 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
export function removeElementFromParent(...elements: (HTMLElement | undefined)[]): void {
for (const e of elements) {
e?.parentElement?.removeChild(e);
}
}
+40
View File
@@ -0,0 +1,40 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { assert } from 'chai';
import { addDisposableDomListener } from './Lifecycle';
import jsdom = require('jsdom');
describe('addDisposableDomListener', () => {
const dom = new jsdom.JSDOM();
const document = dom.window.document;
function createEvent(type: string): Event {
const event = document.createEvent('Event');
event.initEvent(type);
return event;
}
it('dispose', () => {
let calledTimes = 0;
const div = document.createElement('div');
const disposable = addDisposableDomListener(div, 'test', () => { calledTimes++; });
assert.equal(calledTimes, 0);
div.dispatchEvent(createEvent('test'));
assert.equal(calledTimes, 1);
disposable.dispose();
div.dispatchEvent(createEvent('test'));
assert.equal(calledTimes, 1);
disposable.dispose(); // double disposing
div.dispatchEvent(createEvent('test'));
assert.equal(calledTimes, 1);
});
});
+4 -4
View File
@@ -14,17 +14,17 @@ export function addDisposableDomListener(
node: Element | Window | Document,
type: string,
handler: (e: any) => void,
useCapture?: boolean
options?: boolean | AddEventListenerOptions
): IDisposable {
node.addEventListener(type, handler, useCapture);
node.addEventListener(type, handler, options);
let disposed = false;
return {
dispose: () => {
if (!disposed) {
if (disposed) {
return;
}
disposed = true;
node.removeEventListener(type, handler, useCapture);
node.removeEventListener(type, handler, options);
}
};
}
+7 -7
View File
@@ -9,13 +9,13 @@ import { IBufferLine } from 'common/Types';
import { Linkifier } from 'browser/Linkifier';
import { BufferLine } from 'common/buffer/BufferLine';
import { CellData } from 'common/buffer/CellData';
import { MockLogService, MockBufferService, MockOptionsService } from 'common/TestUtils.test';
import { MockLogService, MockBufferService } from 'common/TestUtils.test';
import { IBufferService } from 'common/services/Services';
import { UnicodeService } from 'common/services/UnicodeService';
class TestLinkifier extends Linkifier {
constructor(bufferService: IBufferService) {
super(bufferService, new MockLogService(), new MockOptionsService(), new UnicodeService());
super(bufferService, new MockLogService(), new UnicodeService());
Linkifier._timeBeforeLatency = 0;
}
@@ -24,14 +24,14 @@ class TestLinkifier extends Linkifier {
}
class TestMouseZoneManager implements IMouseZoneManager {
dispose(): void {
public dispose(): void {
}
public clears: number = 0;
public zones: IMouseZone[] = [];
add(zone: IMouseZone): void {
public add(zone: IMouseZone): void {
this.zones.push(zone);
}
clearAll(): void {
public clearAll(): void {
this.clears++;
}
}
@@ -59,7 +59,7 @@ describe('Linkifier', () => {
bufferService.buffer.lines.push(stringToRow(text));
}
function assertLinkifiesRow(rowText: string, linkMatcherRegex: RegExp, links: {x: number, length: number}[], done: MochaDone): void {
function assertLinkifiesRow(rowText: string, linkMatcherRegex: RegExp, links: {x: number, length: number}[], done: Mocha.Done): void {
addRow(rowText);
linkifier.registerLinkMatcher(linkMatcherRegex, () => {});
linkifier.linkifyRows();
@@ -76,7 +76,7 @@ describe('Linkifier', () => {
}, 0);
}
function assertLinkifiesMultiLineLink(rowText: string, linkMatcherRegex: RegExp, links: {x1: number, y1: number, x2: number, y2: number}[], done: MochaDone): void {
function assertLinkifiesMultiLineLink(rowText: string, linkMatcherRegex: RegExp, links: {x1: number, y1: number, x2: number, y2: number}[], done: Mocha.Done): void {
addRow(rowText);
linkifier.registerLinkMatcher(linkMatcherRegex, () => {});
linkifier.linkifyRows();
+9 -10
View File
@@ -35,18 +35,17 @@ export class Linkifier implements ILinkifier {
private _nextLinkMatcherId = 0;
private _rowsToLinkify: { start: number | undefined, end: number | undefined };
private _onLinkHover = new EventEmitter<ILinkifierEvent>();
public get onLinkHover(): IEvent<ILinkifierEvent> { return this._onLinkHover.event; }
private _onLinkLeave = new EventEmitter<ILinkifierEvent>();
public get onLinkLeave(): IEvent<ILinkifierEvent> { return this._onLinkLeave.event; }
private _onShowLinkUnderline = new EventEmitter<ILinkifierEvent>();
public get onShowLinkUnderline(): IEvent<ILinkifierEvent> { return this._onShowLinkUnderline.event; }
private _onHideLinkUnderline = new EventEmitter<ILinkifierEvent>();
public get onHideLinkUnderline(): IEvent<ILinkifierEvent> { return this._onHideLinkUnderline.event; }
private _onLinkTooltip = new EventEmitter<ILinkifierEvent>();
public get onLinkTooltip(): IEvent<ILinkifierEvent> { return this._onLinkTooltip.event; }
constructor(
protected readonly _bufferService: IBufferService,
private readonly _logService: ILogService,
private readonly _optionsService: IOptionsService,
private readonly _unicodeService: IUnicodeService
@IBufferService protected readonly _bufferService: IBufferService,
@ILogService private readonly _logService: ILogService,
@IUnicodeService private readonly _unicodeService: IUnicodeService
) {
this._rowsToLinkify = {
start: undefined,
@@ -307,7 +306,7 @@ export class Linkifier implements ILinkifier {
}
},
() => {
this._onLinkHover.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));
this._onShowLinkUnderline.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));
this._element!.classList.add('xterm-cursor-pointer');
},
e => {
@@ -319,7 +318,7 @@ export class Linkifier implements ILinkifier {
}
},
() => {
this._onLinkLeave.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));
this._onHideLinkUnderline.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));
this._element!.classList.remove('xterm-cursor-pointer');
if (matcher.hoverLeaveCallback) {
matcher.hoverLeaveCallback();
+90
View File
@@ -0,0 +1,90 @@
/**
* Copyright (c) 2020 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { assert } from 'chai';
import { IBufferService } from 'common/services/Services';
import { Linkifier2 } from 'browser/Linkifier2';
import { MockBufferService } from 'common/TestUtils.test';
import { ILink } from 'browser/Types';
class TestLinkifier2 extends Linkifier2 {
constructor(bufferService: IBufferService) {
super(bufferService);
}
public set currentLink(link: any) {
this._currentLink = link;
}
public linkHover(element: HTMLElement, link: ILink, event: MouseEvent): void {
this._linkHover(element, link, event);
}
public linkLeave(element: HTMLElement, link: ILink, event: MouseEvent): void {
this._linkLeave(element, link, event);
}
}
describe('Linkifier2', () => {
let bufferService: IBufferService;
let linkifier: TestLinkifier2;
const link: ILink = {
text: 'foo',
range: {
start: {
x: 5,
y: 1
},
end: {
x: 7,
y: 1
}
},
activate: () => { }
};
beforeEach(() => {
bufferService = new MockBufferService(100, 10);
linkifier = new TestLinkifier2(bufferService);
linkifier.currentLink = {
link,
state: {
decorations: {
underline: true,
pointerCursor: true
},
isHovered: true
}
};
});
it('onShowLinkUnderline event range is correct', done => {
linkifier.onShowLinkUnderline(e => {
assert.equal(link.range.start.x - 1, e.x1);
assert.equal(link.range.start.y - 1, e.y1);
assert.equal(link.range.end.x, e.x2);
assert.equal(link.range.end.y - 1, e.y2);
done();
});
linkifier.linkHover({ classList: { add: () => { } } } as any, link, {} as any);
});
it('onHideLinkUnderline event range is correct', done => {
linkifier.onHideLinkUnderline(e => {
assert.equal(link.range.start.x - 1, e.x1);
assert.equal(link.range.start.y - 1, e.y1);
assert.equal(link.range.end.x, e.x2);
assert.equal(link.range.end.y - 1, e.y2);
done();
});
linkifier.linkLeave({ classList: { add: () => { } } } as any, link, {} as any);
});
});
+401
View File
@@ -0,0 +1,401 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { ILinkifier2, ILinkProvider, IBufferCellPosition, ILink, ILinkifierEvent, ILinkDecorations } from 'browser/Types';
import { IDisposable } from 'common/Types';
import { IMouseService, IRenderService } from './services/Services';
import { IBufferService } from 'common/services/Services';
import { EventEmitter, IEvent } from 'common/EventEmitter';
import { Disposable, getDisposeArrayDisposable, disposeArray } from 'common/Lifecycle';
import { addDisposableDomListener } from 'browser/Lifecycle';
interface ILinkState {
decorations: ILinkDecorations;
isHovered: boolean;
}
interface ILinkWithState {
link: ILink;
state?: ILinkState;
}
export class Linkifier2 extends Disposable implements ILinkifier2 {
private _element: HTMLElement | undefined;
private _mouseService: IMouseService | undefined;
private _renderService: IRenderService | undefined;
private _linkProviders: ILinkProvider[] = [];
protected _currentLink: ILinkWithState | undefined;
private _lastMouseEvent: MouseEvent | undefined;
private _linkCacheDisposables: IDisposable[] = [];
private _lastBufferCell: IBufferCellPosition | undefined;
private _isMouseOut: boolean = true;
private _activeProviderReplies: Map<Number, ILinkWithState[] | undefined> | undefined;
private _activeLine: number = -1;
private _onShowLinkUnderline = this.register(new EventEmitter<ILinkifierEvent>());
public get onShowLinkUnderline(): IEvent<ILinkifierEvent> { return this._onShowLinkUnderline.event; }
private _onHideLinkUnderline = this.register(new EventEmitter<ILinkifierEvent>());
public get onHideLinkUnderline(): IEvent<ILinkifierEvent> { return this._onHideLinkUnderline.event; }
constructor(
@IBufferService private readonly _bufferService: IBufferService
) {
super();
this.register(getDisposeArrayDisposable(this._linkCacheDisposables));
}
public registerLinkProvider(linkProvider: ILinkProvider): IDisposable {
this._linkProviders.push(linkProvider);
return {
dispose: () => {
// Remove the link provider from the list
const providerIndex = this._linkProviders.indexOf(linkProvider);
if (providerIndex !== -1) {
this._linkProviders.splice(providerIndex, 1);
}
}
};
}
public attachToDom(element: HTMLElement, mouseService: IMouseService, renderService: IRenderService): void {
this._element = element;
this._mouseService = mouseService;
this._renderService = renderService;
this.register(addDisposableDomListener(this._element, 'mouseleave', () => {
this._isMouseOut = true;
this._clearCurrentLink();
}));
this.register(addDisposableDomListener(this._element, 'mousemove', this._onMouseMove.bind(this)));
this.register(addDisposableDomListener(this._element, 'click', this._onClick.bind(this)));
}
private _onMouseMove(event: MouseEvent): void {
this._lastMouseEvent = event;
if (!this._element || !this._mouseService) {
return;
}
const position = this._positionFromMouseEvent(event, this._element, this._mouseService);
if (!position) {
return;
}
this._isMouseOut = false;
// Ignore the event if it's an embedder created hover widget
const composedPath = event.composedPath() as HTMLElement[];
for (let i = 0; i < composedPath.length; i++) {
const target = composedPath[i];
// Hit Terminal.element, break and continue
if (target.classList.contains('xterm')) {
break;
}
// It's a hover, don't respect hover event
if (target.classList.contains('xterm-hover')) {
return;
}
}
if (!this._lastBufferCell || (position.x !== this._lastBufferCell.x || position.y !== this._lastBufferCell.y)) {
this._onHover(position);
this._lastBufferCell = position;
}
}
private _onHover(position: IBufferCellPosition): void {
// TODO: This currently does not cache link provider results across wrapped lines, activeLine should be something like `activeRange: {startY, endY}`
// Check if we need to clear the link
if (this._activeLine !== position.y) {
this._clearCurrentLink();
this._askForLink(position, false);
return;
}
// Check the if the link is in the mouse position
const isCurrentLinkInPosition = this._currentLink && this._linkAtPosition(this._currentLink.link, position);
if (!isCurrentLinkInPosition) {
this._clearCurrentLink();
this._askForLink(position, true);
}
}
private _askForLink(position: IBufferCellPosition, useLineCache: boolean): void {
if (!this._activeProviderReplies || !useLineCache) {
this._activeProviderReplies?.forEach(reply => {
reply?.forEach(linkWithState => {
if (linkWithState.link.dispose) {
linkWithState.link.dispose();
}
});
});
this._activeProviderReplies = new Map();
this._activeLine = position.y;
}
let linkProvided = false;
// There is no link cached, so ask for one
this._linkProviders.forEach((linkProvider, i) => {
if (useLineCache) {
const existingReply = this._activeProviderReplies?.get(i);
// If there isn't a reply, the provider hasn't responded yet.
// TODO: If there isn't a reply yet it means that the provider is still resolving. Ensuring
// provideLinks isn't triggered again saves ILink.hover firing twice though. This probably
// needs promises to get fixed
if (existingReply) {
linkProvided = this._checkLinkProviderResult(i, position, linkProvided);
}
} else {
linkProvider.provideLinks(position.y, (links: ILink[] | undefined) => {
if (this._isMouseOut) {
return;
}
const linksWithState: ILinkWithState[] | undefined = links?.map(link => ({ link }));
this._activeProviderReplies?.set(i, linksWithState);
linkProvided = this._checkLinkProviderResult(i, position, linkProvided);
// If all providers have responded, remove lower priority links that intersect ranges of
// higher priority links
if (this._activeProviderReplies?.size === this._linkProviders.length) {
this._removeIntersectingLinks(position.y, this._activeProviderReplies);
}
});
}
});
}
private _removeIntersectingLinks(y: number, replies: Map<Number, ILinkWithState[] | undefined>): void {
const occupiedCells = new Set<number>();
for (let i = 0; i < replies.size; i++) {
const providerReply = replies.get(i);
if (!providerReply) {
continue;
}
for (let i = 0; i < providerReply.length; i++) {
const linkWithState = providerReply[i];
const startX = linkWithState.link.range.start.y < y ? 0 : linkWithState.link.range.start.x;
const endX = linkWithState.link.range.end.y > y ? this._bufferService.cols : linkWithState.link.range.end.x;
for (let x = startX; x <= endX; x++) {
if (occupiedCells.has(x)) {
providerReply.splice(i--, 1);
break;
}
occupiedCells.add(x);
}
}
}
}
private _checkLinkProviderResult(index: number, position: IBufferCellPosition, linkProvided: boolean): boolean {
if (!this._activeProviderReplies) {
return linkProvided;
}
const links = this._activeProviderReplies.get(index);
// Check if every provider before this one has come back undefined
let hasLinkBefore = false;
for (let j = 0; j < index; j++) {
if (!this._activeProviderReplies.has(j) || this._activeProviderReplies.get(j)) {
hasLinkBefore = true;
}
}
// If all providers with higher priority came back undefined, then this provider's link for
// the position should be used
if (!hasLinkBefore && links) {
const linkAtPosition = links.find(link => this._linkAtPosition(link.link, position));
if (linkAtPosition) {
linkProvided = true;
this._handleNewLink(linkAtPosition);
}
}
// Check if all the providers have responded
if (this._activeProviderReplies.size === this._linkProviders.length && !linkProvided) {
// Respect the order of the link providers
for (let j = 0; j < this._activeProviderReplies.size; j++) {
const currentLink = this._activeProviderReplies.get(j)?.find(link => this._linkAtPosition(link.link, position));
if (currentLink) {
linkProvided = true;
this._handleNewLink(currentLink);
break;
}
}
}
return linkProvided;
}
private _onClick(event: MouseEvent): void {
if (!this._element || !this._mouseService || !this._currentLink) {
return;
}
const position = this._positionFromMouseEvent(event, this._element, this._mouseService);
if (!position) {
return;
}
if (this._linkAtPosition(this._currentLink.link, position)) {
this._currentLink.link.activate(event, this._currentLink.link.text);
}
}
private _clearCurrentLink(startRow?: number, endRow?: number): void {
if (!this._element || !this._currentLink || !this._lastMouseEvent) {
return;
}
// If we have a start and end row, check that the link is within it
if (!startRow || !endRow || (this._currentLink.link.range.start.y >= startRow && this._currentLink.link.range.end.y <= endRow)) {
this._linkLeave(this._element, this._currentLink.link, this._lastMouseEvent);
this._currentLink = undefined;
disposeArray(this._linkCacheDisposables);
}
}
private _handleNewLink(linkWithState: ILinkWithState): void {
if (!this._element || !this._lastMouseEvent || !this._mouseService) {
return;
}
const position = this._positionFromMouseEvent(this._lastMouseEvent, this._element, this._mouseService);
if (!position) {
return;
}
// Trigger hover if the we have a link at the position
if (this._linkAtPosition(linkWithState.link, position)) {
this._currentLink = linkWithState;
this._currentLink.state = {
decorations: {
underline: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.underline,
pointerCursor: linkWithState.link.decorations === undefined ? true : linkWithState.link.decorations.pointerCursor
},
isHovered: true
};
this._linkHover(this._element, linkWithState.link, this._lastMouseEvent);
// Add listener for tracking decorations changes
linkWithState.link.decorations = {} as ILinkDecorations;
Object.defineProperties(linkWithState.link.decorations, {
pointerCursor: {
get: () => this._currentLink?.state?.decorations.pointerCursor,
set: v => {
if (this._currentLink?.state && this._currentLink.state.decorations.pointerCursor !== v) {
this._currentLink.state.decorations.pointerCursor = v;
if (this._currentLink.state.isHovered) {
this._element?.classList.toggle('xterm-cursor-pointer', v);
}
}
}
},
underline: {
get: () => this._currentLink?.state?.decorations.underline,
set: v => {
if (this._currentLink?.state && this._currentLink?.state?.decorations.underline !== v) {
this._currentLink.state.decorations.underline = v;
if (this._currentLink.state.isHovered) {
this._fireUnderlineEvent(linkWithState.link, v);
}
}
}
}
});
// Add listener for rerendering
if (this._renderService) {
this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(e => {
// When start is 0 a scroll most likely occurred, make sure links above the fold also get
// cleared.
const start = e.start === 0 ? 0 : e.start + 1 + this._bufferService.buffer.ydisp;
this._clearCurrentLink(start, e.end + 1 + this._bufferService.buffer.ydisp);
}));
}
}
}
protected _linkHover(element: HTMLElement, link: ILink, event: MouseEvent): void {
if (this._currentLink?.state) {
this._currentLink.state.isHovered = true;
if (this._currentLink.state.decorations.underline) {
this._fireUnderlineEvent(link, true);
}
if (this._currentLink.state.decorations.pointerCursor) {
element.classList.add('xterm-cursor-pointer');
}
}
if (link.hover) {
link.hover(event, link.text);
}
}
private _fireUnderlineEvent(link: ILink, showEvent: boolean): void {
const range = link.range;
const scrollOffset = this._bufferService.buffer.ydisp;
const event = this._createLinkUnderlineEvent(range.start.x - 1, range.start.y - scrollOffset - 1, range.end.x, range.end.y - scrollOffset - 1, undefined);
const emitter = showEvent ? this._onShowLinkUnderline : this._onHideLinkUnderline;
emitter.fire(event);
}
protected _linkLeave(element: HTMLElement, link: ILink, event: MouseEvent): void {
if (this._currentLink?.state) {
this._currentLink.state.isHovered = false;
if (this._currentLink.state.decorations.underline) {
this._fireUnderlineEvent(link, false);
}
if (this._currentLink.state.decorations.pointerCursor) {
element.classList.remove('xterm-cursor-pointer');
}
}
if (link.leave) {
link.leave(event, link.text);
}
}
/**
* Check if the buffer position is within the link
* @param link
* @param position
*/
private _linkAtPosition(link: ILink, position: IBufferCellPosition): boolean {
const sameLine = link.range.start.y === link.range.end.y;
const wrappedFromLeft = link.range.start.y < position.y;
const wrappedToRight = link.range.end.y > position.y;
// If the start and end have the same y, then the position must be between start and end x
// If not, then handle each case seperately, depending on which way it wraps
return ((sameLine && link.range.start.x <= position.x && link.range.end.x >= position.x) ||
(wrappedFromLeft && link.range.end.x >= position.x) ||
(wrappedToRight && link.range.start.x <= position.x) ||
(wrappedFromLeft && wrappedToRight)) &&
link.range.start.y <= position.y &&
link.range.end.y >= position.y;
}
/**
* Get the buffer position from a mouse event
* @param event
*/
private _positionFromMouseEvent(event: MouseEvent, element: HTMLElement, mouseService: IMouseService): IBufferCellPosition | undefined {
const coords = mouseService.getCoords(event, element, this._bufferService.cols, this._bufferService.rows);
if (!coords) {
return;
}
return { x: coords[0], y: coords[1] + this._bufferService.buffer.ydisp };
}
private _createLinkUnderlineEvent(x1: number, y1: number, x2: number, y2: number, fg: number | undefined): ILinkifierEvent {
return { x1, y1, x2, y2, cols: this._bufferService.cols, fg };
}
}
+3
View File
@@ -3,5 +3,8 @@
* @license MIT
*/
// eslint-disable-next-line prefer-const
export let promptLabel = 'Terminal input';
// eslint-disable-next-line prefer-const
export let tooMuchOutput = 'Too much output to announce, navigate to rows manually to read';
+4 -5
View File
@@ -7,9 +7,7 @@ import { Disposable } from 'common/Lifecycle';
import { addDisposableDomListener } from 'browser/Lifecycle';
import { IMouseService, ISelectionService } from 'browser/services/Services';
import { IMouseZoneManager, IMouseZone } from 'browser/Types';
import { IBufferService } from 'common/services/Services';
const HOVER_DURATION = 500;
import { IBufferService, IOptionsService } from 'common/services/Services';
/**
* The MouseZoneManager allows components to register zones within the terminal
@@ -37,7 +35,8 @@ export class MouseZoneManager extends Disposable implements IMouseZoneManager {
private readonly _screenElement: HTMLElement,
@IBufferService private readonly _bufferService: IBufferService,
@IMouseService private readonly _mouseService: IMouseService,
@ISelectionService private readonly _selectionService: ISelectionService
@ISelectionService private readonly _selectionService: ISelectionService,
@IOptionsService private readonly _optionsService: IOptionsService
) {
super();
@@ -151,7 +150,7 @@ export class MouseZoneManager extends Disposable implements IMouseZoneManager {
}
// Restart the tooltip timeout
this._tooltipTimeout = <number><any>setTimeout(() => this._onTooltip(e), HOVER_DURATION);
this._tooltipTimeout = window.setTimeout(() => this._onTooltip(e), this._optionsService.options.linkTooltipHoverDuration);
}
private _onTooltip(e: MouseEvent): void {
+7 -7
View File
@@ -26,7 +26,7 @@ export class RenderDebouncer implements IDisposable {
}
}
public refresh(rowStart: number, rowEnd: number, rowCount: number): void {
public refresh(rowStart: number | undefined, rowEnd: number | undefined, rowCount: number): void {
this._rowCount = rowCount;
// Get the min/max row start/end for the arg values
rowStart = rowStart !== undefined ? rowStart : 0;
@@ -49,15 +49,15 @@ export class RenderDebouncer implements IDisposable {
}
// Clamp values
this._rowStart = Math.max(this._rowStart, 0);
this._rowEnd = Math.min(this._rowEnd, this._rowCount - 1);
const start = Math.max(this._rowStart, 0);
const end = Math.min(this._rowEnd, this._rowCount - 1);
// Run render callback
this._renderCallback(this._rowStart, this._rowEnd);
// Reset debouncer
// Reset debouncer (this happens before render callback as the render could trigger it again)
this._rowStart = undefined;
this._rowEnd = undefined;
this._animationFrame = undefined;
// Run render callback
this._renderCallback(start, end);
}
}
+2 -2
View File
@@ -44,12 +44,12 @@ export class ScreenDprMonitor extends Disposable {
}
private _updateDpr(): void {
if (!this._resolutionMediaMatchList || !this._outerListener) {
if (!this._outerListener) {
return;
}
// Clear listeners for old DPR
this._resolutionMediaMatchList.removeListener(this._outerListener);
this._resolutionMediaMatchList?.removeListener(this._outerListener);
// Add listeners for new DPR
this._currentDevicePixelRatio = window.devicePixelRatio;

Some files were not shown because too many files have changed in this diff Show More