Compare commits

...
393 Commits
Author SHA1 Message Date
Megan Rogge ee88fca8c0 Merge pull request #3249 from xtermjs/release
v 4.11.0
2021-03-09 10:21:03 -08:00
meganrogge 9b3fbc9b84 v 4.11.0 2021-03-09 10:18:14 -08:00
Daniel Imms 187f072f43 Merge pull request #3244 from nxshell/patch-1
feat: Add nxshell which use xtermjs
2021-02-16 04:42:09 -08:00
nxshell 3ab2376517 feat: Add nxshell which use xtermjs 2021-02-16 19:37:03 +08:00
Daniel Imms a73fe62b7a Merge pull request #3243 from jeanp413/measure-charsize-on-devicePixelRatioChange
Force char size measurement when devicePixelRatio changes
2021-02-05 11:39:31 -08:00
jeanp413 350f6cfea1 Fixes https://github.com/microsoft/vscode/issues/102194 2021-02-05 11:15:39 -05:00
Daniel Imms 2936f80013 Merge pull request #3233 from marvinthepa/3056_hover_callback_link_providers
Add hover and leave callbacks for linkprovider
2021-02-03 05:35:15 -08:00
Daniel Imms dec9f6d254 Merge branch 'master' into 3056_hover_callback_link_providers 2021-02-03 05:29:08 -08:00
Daniel Imms bd6676d3b6 Move options to addon and avoid recreating options 2021-02-03 05:28:23 -08:00
Daniel Imms d9309d33af Merge pull request #3232 from jeanp413/fix-3221
Fix webgl renderer does not render when writing if a selection exists
2021-02-03 05:17:18 -08:00
Daniel Imms bb9802e754 Merge branch 'master' into fix-3221 2021-02-03 05:10:48 -08:00
ew eec804dd7c Add hover and leave callbacks for linkprovider
Fixes #3056.
2021-02-03 10:25:33 +01:00
jeanp413 ff6d3a0768 Refresh selection on resize as dimensions changed 2021-02-03 01:29:39 -05:00
jeanp413 94d37bbe4c Keep selection on resize and when changing colors 2021-02-03 00:24:53 -05:00
Daniel Imms 36136a4c29 Merge pull request #3241 from mmis1000/fix/serialize-addon-typings
SerializeAddon: fix parameter name in typing
2021-02-02 19:58:01 -08:00
Mmis1000 8b273e6939 SerializeAddon: fix parameter name in typing 2021-02-03 11:01:55 +08:00
Daniel Imms 2340fa1c91 Merge branch 'master' into fix-3221 2021-02-02 11:57:57 -08:00
Daniel Imms 70051da2ab Merge pull request #3101 from mmis1000/feature/xterm-addon-serialize-restore-layout-and-cursor
Feature/xterm addon serialize restore layout and cursor
2021-02-01 09:46:52 -08:00
Daniel Imms 5659bf3283 Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2021-02-01 09:36:05 -08:00
Daniel Imms 8de8ac10d4 Merge pull request #3240 from Tyriar/debug
Fix Demo Server debug launch config
2021-02-01 09:35:48 -08:00
Daniel Imms 46c93f1b63 Move util function into page.evaluate 2021-02-01 09:34:38 -08:00
Daniel Imms e3a9d0d14f Merge branch 'master' into debug 2021-02-01 09:29:10 -08:00
Daniel Imms 0a4b403f6a Fix Demo Server debug launch config 2021-02-01 09:28:26 -08:00
Daniel Imms b94b4f5353 Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2021-02-01 09:01:09 -08:00
Daniel Imms d84576e160 Merge pull request #3239 from hantatsang/fix/2642-terminal-open-check-shadow-dom
Terminal.open: support WebComponent when checking DOM Node
2021-02-01 02:37:38 -08:00
hantatsang a0903fbf9b terminal.open: support webcomponent in dom node check 2021-01-31 11:43:59 +11:00
Daniel Imms 4b29b8a9c6 Merge pull request #3237 from Tyriar/r4_10
v4.10.0
2021-01-29 09:25:08 -08:00
Daniel Imms c994c67dd9 v4.10.0 2021-01-29 09:14:31 -08:00
jeanp413 0b09f0bafd Fixes #3221 2021-01-24 23:17:36 -05:00
Mmis1000 54bb0ee189 SerializeAddon: comment the intent of several check 2021-01-25 10:52:48 +08:00
jerch 28bcd88fb0 Merge pull request #3229 from jerch/replace_expect_testing
replace expect testing with assert
2021-01-23 19:07:26 +01:00
jerch bee4b0ff06 Merge branch 'master' into replace_expect_testing 2021-01-23 19:00:39 +01:00
Daniel Imms 559b3c1392 Merge pull request #3228 from nishant-d/master
added Devtron's usages
2021-01-23 09:12:47 -08:00
Jörg Breitbart d3c9f70bec replace expect testing with assert 2021-01-23 17:09:43 +01:00
jerch ff74caf50d Merge pull request #3200 from kena0ki/issue3032
Filter U+FEFF (BOM) when decoding input data
2021-01-23 13:03:57 +01:00
Ken Aoki 3d941f2fdf add BOM skip logic 2021-01-23 11:42:16 +00:00
Ken Aoki 93aab95f7b filter U+FEFF (BOM) when decoding input data 2021-01-23 04:39:57 +00:00
Mmis1000 079702282c SerializeAddon: move test util into seperate file 2021-01-23 12:26:30 +08:00
nishant-d db8e449a8a added Devtron's usages 2021-01-23 09:35:43 +05:30
Mmis1000 a2480bae51 Remove dummy buffer cell in favor of just remember the location 2021-01-23 11:57:08 +08:00
mmis1000andDaniel Imms cd501f9dcc Update addons/xterm-addon-serialize/src/MyBufferCell.ts
Co-authored-by: Daniel Imms <tyriar@tyriar.com>
2021-01-23 10:20:03 +08:00
mmis1000andDaniel Imms 354f3e03a2 Fix: inconsistent styles
Co-authored-by: Daniel Imms <tyriar@tyriar.com>
2021-01-23 10:19:03 +08:00
Daniel Imms 00ef60ebaf Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2021-01-22 09:13:07 -08:00
Daniel Imms 4da5d557a5 Merge pull request #3227 from marvinthepa/3225_onSelectionChange_on_clear
Store old selection when firing onSelectionChange
2021-01-22 08:37:36 -08:00
jerch a1dc85ee57 Merge pull request #3223 from jerch/simplify_handler_interface
cleanup parser handler interface
2021-01-22 17:17:48 +01:00
Martin Sander 554b4a8224 Store old selection when firing onSelectionChange 2021-01-22 16:41:57 +01:00
Jörg Breitbart 3f659a15da minor fixes:
- better perf for short DCS without params (8 times faster)
- test perf for class and string based interfaces of OSC and DCS
  separately
- undo wrong commit on parser
2021-01-21 15:58:03 +01:00
Jörg Breitbart dd5b295219 release active handler list on dispose in DcsHandler 2021-01-21 13:08:01 +01:00
Jörg Breitbart 9d0200252b fix possible OSC handler bug skipping the fallback handler 2021-01-21 13:05:57 +01:00
Jörg Breitbart d67faff92a simplify return eval 2021-01-21 11:38:47 +01:00
Jörg Breitbart c50c134e25 simplify parser handler interface:
- remove setHandler
- apply boolean return to ESC|CSI|OSC|DCS handlers
  (rewrite empty return defaulting to true)
- rename addHandler to registerHandler
2021-01-20 23:03:55 +01:00
Daniel Imms 74ea558bfc Merge pull request #3219 from marvinthepa/3216_onSelectionChange_on_right_click
fire onSelectionChange on right click select
2021-01-19 10:24:55 -08:00
Martin Sander c6f93701f5 fire onSelectionChange on right click select
fixes #3216.
2021-01-16 10:14:11 +01:00
Daniel Imms 8a4772ca39 Merge pull request #3215 from marvinthepa/3193_onSelectionChange_on_clear
fire onSelectionChange on empty selection
2021-01-15 10:17:21 -08:00
Daniel ImmsandMegan Rogge 66c80d8b78 Simplify checks
Co-authored-by: Megan Rogge <merogge@microsoft.com>
2021-01-15 09:39:34 -08:00
Martin Sander 0cb38cfdcb fire onSelectionChange on empty selection
Fire the onSelectionChange event when a selection is cleared by
single-clicking somewhere inside the terminal area.

fixes #3193.

This also slightly changes the behaviour when re-selecting the same area
in the terminal. Before, this fired onSelectionChange, but it does not
anymore, even when changing the direction of the selection.
2021-01-14 23:08:34 +01:00
Daniel Imms c669c3fba7 Merge pull request #3194 from kena0ki/issue3191
Prevent input characters using IME from being duplicated
2021-01-11 14:28:02 -08:00
Daniel Imms 8860726c68 Merge branch 'master' into issue3191 2021-01-11 09:51:02 -08:00
Daniel Imms f64724f54f Merge pull request #3187 from chenjigeng/fix/select-all
fix shift+cmd+a will Select all
2021-01-11 09:41:14 -08:00
Daniel Imms fd222b58b5 Merge branch 'master' into fix/select-all 2021-01-11 09:29:35 -08:00
Daniel Imms 83ba481e3d Merge pull request #3125 from kena0ki/issue#2734
Fix search addon not expanding selection to left when appropriate
2021-01-11 09:29:18 -08:00
Daniel Imms 7d5bbc341f Merge branch 'master' into issue#2734 2021-01-11 09:20:47 -08:00
Daniel ImmsandMegan Rogge 519e44d30e Clean up, improve comments
Co-authored-by: Megan Rogge <merogge@microsoft.com>
2021-01-11 09:19:53 -08:00
Daniel Imms 3bb2c158fd Merge pull request #3213 from Tyriar/update_yarn
Update yarn.lock for font-finder
2021-01-11 08:53:20 -08:00
Daniel Imms 5ada5f0c0c Update yarn.lock for font-finder
Previous update was likely done using npm, not yarn
2021-01-11 08:31:56 -08:00
Daniel Imms ea1fcc6a5f Merge pull request #3163 from slawekzachcial/add-osc-4
Add support for OSC 4 ; color ; color spec
2021-01-11 07:54:04 -08:00
Daniel Imms 19c14b076b Remove resolved TODO 2021-01-11 07:40:25 -08:00
Slawek Zachcial 676aabc3ed Merge branch 'master' into add-osc-4 2021-01-09 16:57:18 +01:00
Slawek Zachcial 5c33e4008d Make _parseAnsiColorChange available for tests in TestInputHandler 2021-01-09 14:30:24 +01:00
Daniel Imms 772e446192 Merge pull request #3210 from meganrogge/windows-git-bash
Get demo working for git bash on windows
2021-01-08 11:33:34 -08:00
meganroggeandPretaSOFT 66be7797cf Get demo working for git bash on windows
Co-authored-by: Megan Rogge merogge@microsoft.com
Co-authored-by: Daniel Imms daimms@microsoft.com
2021-01-08 11:02:34 -08:00
Daniel Imms 3261c53c08 Merge pull request #3209 from Nokel81/freeze-default-colours
freeze the default ANSI colours const
2021-01-08 07:10:12 -08:00
Sebastian Malton 5bab94730f freeze the default ANSI colours const 2021-01-08 09:46:12 -05:00
Daniel Imms 801aeb8462 Merge pull request #3207 from CyanSalt/commas
Add Commas to the Real-world uses List
2021-01-05 23:27:50 -08:00
Sun Xiaoran cbe5abcf27 Add Commas to the Real-world uses List 2021-01-06 14:10:10 +08:00
Daniel Imms 72dbd43be6 Merge pull request #3204 from meganrogge/master
set this._buffer to new buffer
2021-01-05 10:20:57 -08:00
Daniel ImmsandPretaSOFT 7145130835 Fix onBufferChange event not working after reset
Co-authored-by: Megan Rogge (megan.rogge@microsoft.com)
2021-01-05 09:32:09 -08:00
meganrogge b34289cc44 use reset 2021-01-05 07:10:27 -08:00
meganrogge fe2b1c0d43 set this._buffer to new buffer 2021-01-04 11:32:11 -08:00
Daniel Imms 4de6f1c255 Merge pull request #3203 from meganrogge/master
cache buffer to fix VS Code issue #111562
2021-01-04 10:35:46 -08:00
meganrogge 8baff9bade cache buffer 2021-01-04 08:31:22 -08:00
jerch f8f7e7e4c1 Merge pull request #3188 from UziTech/update-font-finder
fix: update font-finder to v1.1.0
2021-01-02 19:34:40 +01:00
jerch 7523505af1 Merge branch 'master' into update-font-finder 2021-01-02 19:23:35 +01:00
jerch d94b119e9d Merge pull request #3190 from jrieken/joh/trustedTypes
Avoid innerHTML usages
2021-01-02 19:21:55 +01:00
kena0ki 3cab8511e4 Prevent input characters using IME from being duplicated 2020-12-31 22:55:54 +09:00
Slawek Zachcial 7d3f5375a8 Implement OSC 4 for list of colors 2020-12-09 22:30:23 +01:00
Johannes Rieken b2c4ed638b fix bad none-breaking whitespace 2020-12-09 09:08:14 +00:00
Slawek Zachcial 2804bfa8b7 Make safe references to colorManager in _changeAnsiColor 2020-12-07 23:20:10 +01:00
Johannes Rieken 64ac67026a avoid innerHTML usages 2020-12-02 16:25:19 +00:00
Slawek Zachcial 5a74ce2e59 Add Ansi color change positive test 2020-11-30 22:00:04 +01:00
Slawek Zachcial f4a56389cd Fix quotes 2020-11-29 23:22:31 +01:00
Slawek Zachcial 52b64beefc Make InputHandler parseAnsiColorChange private 2020-11-29 16:30:05 +01:00
Tony Brix ec1234e8d8 fix: update font-finder to v1.1.0 2020-11-27 14:19:05 -06:00
condichen@tencent.com b7695d2fd6 fix shift+cmd+a will Select all 2020-11-28 00:56:45 +08:00
Slawek Zachcial 4c6dc45d20 Merge branch 'master' into add-osc-4 2020-11-24 22:54:26 +01:00
Daniel Imms 5cb048094e Merge pull request #3181 from awmottaz/master
Make alt+click behavior configurable
2020-11-24 09:04:21 -08:00
Daniel Imms e3cccd619b Update typings/xterm.d.ts 2020-11-24 09:03:59 -08:00
Tony Mottaz 88f0b91056 add altClickMovesCursor option to Services type 2020-11-22 10:01:02 -06:00
Tony Mottaz 78ddb9feba Add 'altClickMovesCursor' option to getOption/setOption in Terminal 2020-11-22 10:00:41 -06:00
Tony Mottaz f68ff2a455 Check for alt+click option sooner 2020-11-22 10:00:02 -06:00
Tony Mottaz 04e2bdd6ec Make alt+click behavior configurable 2020-11-20 19:50:03 -06:00
Daniel Imms 84fa6be370 Merge pull request #3175 from dsanders11/patch-1
use Array.includes
2020-11-11 12:50:07 -08:00
David Sanders af2f744186 use Array.includes 2020-11-11 09:43:17 -08:00
Daniel Imms 5f4b719444 Merge pull request #3172 from KKoukiou/a11y-fix
Fix a11y violation because of using role='listitem' without role='list' parent
2020-11-10 08:53:45 -08:00
Katerina Koukiou 9616851e52 Fix a11y violation because of using role='listitem' without role='list' parent 2020-11-10 16:36:59 +01:00
Daniel Imms 4645fda126 Merge pull request #3170 from blois/shadow_root
Incorporate shadowRoot in focus calculation.
2020-11-09 16:17:09 -08:00
Pete Blois 057a8f6f1b Incorporate shadowRoot in focus calculation.
This adds a call to getRootNode to get either the Document or the
ShadowRoot to use when calculating whether the textarea has focus.

getRootNode is guarded for older browser compatibility (IE).
2020-11-09 13:12:03 -08:00
Slawek Zachcial e6917d1933 Clarify color spec description 2020-11-08 22:07:24 +01:00
Slawek Zachcial 6535995753 Update OSC 4 description to match #3036 2020-11-08 22:05:25 +01:00
Slawek Zachcial 77ed5ba7ed Add terminal sequence doc 2020-11-08 10:19:12 +01:00
Slawek Zachcial bc86b7804c Use all and not only 16 Ansi colors in CharAtlas config 2020-11-07 21:36:05 +01:00
Slawek Zachcial d5f4ae53c9 Add IAnsiColorChangeEvent related tests 2020-11-07 21:36:05 +01:00
Slawek Zachcial b898e016f3 Add IAnsiColorChangeEvent type 2020-11-07 21:36:05 +01:00
Slawek Zachcial 712f0ae2a7 Merge branch 'master' into add-osc-4 2020-11-05 22:02:48 +01:00
Daniel Imms c553107d23 Merge pull request #3167 from xtermjs/dependabot/npm_and_yarn/webpack-cli-4.2.0
Bump webpack-cli from 4.1.0 to 4.2.0
2020-11-05 08:35:34 -08:00
Slawek Zachcial b127436cc4 Fix TODO comment 2020-11-05 08:51:01 +01:00
dependabot-preview[bot] b61ac11a76 Bump webpack-cli from 4.1.0 to 4.2.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.1.0 to 4.2.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.1.0...webpack-cli@4.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-05 07:38:01 +00:00
Slawek Zachcial b22d7f1140 Move color parsing from Terminal to InputHandler 2020-11-04 22:19:55 +01:00
Daniel Imms 925aaf18a1 Merge pull request #3165 from xtermjs/dependabot/npm_and_yarn/webpack-5.4.0
Bump webpack from 5.3.2 to 5.4.0
2020-11-04 06:46:09 -08:00
Daniel Imms 797ed47791 Merge pull request #3164 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.8
Bump ts-loader from 8.0.7 to 8.0.8
2020-11-04 06:45:49 -08:00
dependabot-preview[bot] 4128a6e2f1 Bump webpack from 5.3.2 to 5.4.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.3.2 to 5.4.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.3.2...v5.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-04 07:28:16 +00:00
dependabot-preview[bot] 69f34be4b8 Bump ts-loader from 8.0.7 to 8.0.8
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.7 to 8.0.8.
- [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.7...v8.0.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-04 07:27:51 +00:00
Slawek Zachcial 1c3da7e2e6 Merge branch 'master' into add-osc-4 2020-11-03 18:57:51 +01:00
Slawek Zachcial 5c7644adc0 Add rudimenatary and not fully working support of OSC 4 2020-11-03 18:36:28 +01:00
Daniel Imms f974010aa3 Merge pull request #3162 from xtermjs/dependabot/npm_and_yarn/mocha-8.2.1
Bump mocha from 8.2.0 to 8.2.1
2020-11-03 06:58:51 -08:00
dependabot-preview[bot] d4d18f741f Bump mocha from 8.2.0 to 8.2.1
Bumps [mocha](https://github.com/mochajs/mocha) from 8.2.0 to 8.2.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.2.0...v8.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-03 07:36:13 +00:00
Daniel Imms d97b54b9be Merge pull request #3161 from nasrob/update-to-webpack-5
fixes #3154 upgraded webpack to version 5.3.2
2020-11-02 06:09:21 -08:00
Daniel Imms a7b94fbe1a Revert "Reference tsc/webpack in root dir"
This reverts commit fd6bf6d667.
2020-11-02 05:40:18 -08:00
Daniel Imms 2ab9de91fe Format tsconfig.json 2020-11-02 05:37:31 -08:00
Daniel Imms fd6bf6d667 Reference tsc/webpack in root dir 2020-11-02 05:36:23 -08:00
Daniel Imms 38e81f053f Merge pull request #3133 from coderaiser/lint/putout
Using putout linter on xterm codebase part 2
2020-11-02 05:15:07 -08:00
coderaiser c6f1b456f5 feature: tsconfig: es2017 -> es2016.Array.Include 2020-11-01 09:46:31 +02:00
Nasser Boukehil 8484978ef0 fixes #3154 upgraded webpack to version 5.3.2 with types property in ligatures tsconfig 2020-10-31 21:03:01 +01:00
coderaiser c4919b9a6b feature: tsconfig: es2015 -> es2017 2020-10-31 15:13:12 +02:00
Daniel Imms 02e4db4c82 Merge pull request #3136 from kena0ki/termfit
Fix "term.fit is not a function" error when change padding value in the demo
2020-10-30 12:23:17 -07:00
Daniel Imms 5200766617 Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2020-10-30 09:38:33 -07:00
Daniel Imms 8d9badb588 Merge pull request #3089 from UziTech/rerender-hidden
Render initially hidden terminal when visible
2020-10-30 08:55:29 -07:00
Daniel Imms fc534a1067 Merge pull request #3158 from xtermjs/dependabot/npm_and_yarn/types/jsdom-16.2.5
Bump @types/jsdom from 16.2.4 to 16.2.5
2020-10-29 13:46:58 -07:00
Daniel Imms f68ef19868 Merge pull request #3157 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.24
Bump @types/webpack from 4.41.23 to 4.41.24
2020-10-29 13:46:46 -07:00
dependabot-preview[bot] 0a2e40502f Bump @types/jsdom from 16.2.4 to 16.2.5
Bumps [@types/jsdom](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jsdom) from 16.2.4 to 16.2.5.
- [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-10-29 20:34:06 +00:00
dependabot-preview[bot] e843a2f61e Bump @types/webpack from 4.41.23 to 4.41.24
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.23 to 4.41.24.
- [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-10-29 20:33:16 +00:00
Daniel Imms d95a633f16 Merge pull request #3149 from xtermjs/dependabot/npm_and_yarn/playwright-1.5.2
Bump playwright from 1.5.1 to 1.5.2
2020-10-28 19:16:51 -07:00
Daniel Imms 6f41aad2ef Merge pull request #3153 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.9
Bump @types/ws from 7.2.8 to 7.2.9
2020-10-28 17:00:10 -07:00
dependabot-preview[bot] e76cbd9c3f Bump @types/ws from 7.2.8 to 7.2.9
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.8 to 7.2.9.
- [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-10-28 23:50:58 +00:00
dependabot-preview[bot] 0c8b299996 Bump playwright from 1.5.1 to 1.5.2
Bumps [playwright](https://github.com/Microsoft/playwright) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.5.1...v1.5.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 23:50:40 +00:00
Daniel Imms 86420d2535 Merge pull request #3151 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.8
Bump @types/ws from 7.2.7 to 7.2.8
2020-10-28 06:22:40 -07:00
Daniel Imms 9e4dcdaf91 Merge pull request #3147 from xtermjs/dependabot/npm_and_yarn/source-map-loader-1.1.2
Bump source-map-loader from 1.1.1 to 1.1.2
2020-10-28 06:14:05 -07:00
Daniel Imms 45e7bf274a Merge pull request #3148 from xtermjs/dependabot/npm_and_yarn/eslint-7.12.1
Bump eslint from 7.12.0 to 7.12.1
2020-10-28 06:13:48 -07:00
Daniel Imms 62cf413d54 Merge pull request #3150 from xtermjs/dependabot/npm_and_yarn/typescript-4.0.5
Bump typescript from 4.0.3 to 4.0.5
2020-10-28 06:12:57 -07:00
dependabot-preview[bot] 3e0a270891 Bump @types/ws from 7.2.7 to 7.2.8
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.7 to 7.2.8.
- [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-10-28 13:01:39 +00:00
dependabot-preview[bot] 22d79eef26 Bump typescript from 4.0.3 to 4.0.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.3 to 4.0.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.3...v4.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 13:01:11 +00:00
dependabot-preview[bot] 31d806afce Bump eslint from 7.12.0 to 7.12.1
Bumps [eslint](https://github.com/eslint/eslint) from 7.12.0 to 7.12.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.12.0...v7.12.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 13:00:07 +00:00
dependabot-preview[bot] 1e9ca83120 Bump source-map-loader from 1.1.1 to 1.1.2
Bumps [source-map-loader](https://github.com/webpack-contrib/source-map-loader) from 1.1.1 to 1.1.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.1.1...v1.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 12:59:33 +00:00
Tony Brix 3d9a33bb69 move measure before refreshRows 2020-10-25 10:59:30 -05:00
Tony Brix ea989ed691 Merge branch 'master' into rerender-hidden 2020-10-25 09:58:09 -05:00
jerch ee2c5969fa Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2020-10-25 15:35:22 +01:00
jerch 8e151ee6ef Merge pull request #3143 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.7
Bump ts-loader from 8.0.6 to 8.0.7
2020-10-25 12:00:21 +01:00
jerch dc904b27a2 Merge branch 'master' into dependabot/npm_and_yarn/ts-loader-8.0.7 2020-10-25 11:49:09 +01:00
jerch 4de539a1ff Merge pull request #3142 from xtermjs/dependabot/npm_and_yarn/eslint-7.12.0
Bump eslint from 7.11.0 to 7.12.0
2020-10-25 11:45:02 +01:00
dependabot-preview[bot] 913de3158e Bump ts-loader from 8.0.6 to 8.0.7
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.6 to 8.0.7.
- [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.6...v8.0.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-25 09:14:57 +00:00
dependabot-preview[bot] 049ca653ed Bump eslint from 7.11.0 to 7.12.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.11.0 to 7.12.0.
- [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.11.0...v7.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-25 08:59:56 +00:00
coderaiser 246d137c2c src: lint using putout 2020-10-25 10:05:41 +02:00
coderaiser 99b1a7a49b bin: lint using putout 2020-10-25 01:13:40 +03:00
jerch 9fa068f574 Merge pull request #3109 from mmis1000/fix/addon-serialize-benchmark
Fix/addon serialize benchmark
2020-10-24 23:43:59 +02:00
jerch eb5f964bcb Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2020-10-24 14:57:37 +02:00
jerch 91337d7e57 Merge branch 'master' into fix/addon-serialize-benchmark 2020-10-24 14:57:13 +02:00
jerch cb555d5297 Merge branch 'master' into rerender-hidden 2020-10-24 14:02:17 +02:00
jerch 50dd3cb841 Merge pull request #3114 from jerch/fix_3108
marker fixes
2020-10-24 14:01:18 +02:00
jerch b7750cbf91 Merge branch 'master' into fix_3108 2020-10-24 13:44:19 +02:00
jerch dde47269de Merge branch 'master' into rerender-hidden 2020-10-24 13:43:59 +02:00
jerch bc3f2a12c0 Merge pull request #3132 from xtermjs/dependabot/npm_and_yarn/mocha-8.2.0
Bump mocha from 8.1.3 to 8.2.0
2020-10-24 13:42:06 +02:00
jerch bdb112b23c Merge branch 'master' into dependabot/npm_and_yarn/mocha-8.2.0 2020-10-24 13:32:29 +02:00
jerch 214ccd14ac Merge pull request #3139 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.6
Bump ts-loader from 8.0.4 to 8.0.6
2020-10-24 13:30:12 +02:00
jerch e5f3820285 Merge branch 'master' into dependabot/npm_and_yarn/ts-loader-8.0.6 2020-10-24 13:21:37 +02:00
jerch f75b4cfa93 Merge pull request #3140 from xtermjs/dependabot/npm_and_yarn/types/webpack-4.41.23
Bump @types/webpack from 4.41.22 to 4.41.23
2020-10-24 13:21:01 +02:00
jerch f5d651dda1 Merge branch 'master' into dependabot/npm_and_yarn/types/webpack-4.41.23 2020-10-24 13:14:21 +02:00
jerch a90254e778 Merge branch 'master' into dependabot/npm_and_yarn/ts-loader-8.0.6 2020-10-24 13:03:05 +02:00
jerch a6bcfcfba4 Merge pull request #3135 from xtermjs/dependabot/npm_and_yarn/webpack-cli-4.1.0
Bump webpack-cli from 3.3.12 to 4.1.0
2020-10-24 13:01:34 +02:00
jerch 78ae1d09f7 Merge branch 'master' into dependabot/npm_and_yarn/webpack-cli-4.1.0 2020-10-24 12:51:21 +02:00
jerch 1132da8563 Merge pull request #3131 from xtermjs/dependabot/npm_and_yarn/types/chai-4.2.14
Bump @types/chai from 4.2.12 to 4.2.14
2020-10-24 12:49:52 +02:00
jerch 199b9ceb6d Merge branch 'master' into dependabot/npm_and_yarn/types/chai-4.2.14 2020-10-24 12:40:02 +02:00
jerch 8e41d22f8d Merge pull request #3128 from xtermjs/dependabot/npm_and_yarn/playwright-1.5.1
Bump playwright from 1.4.2 to 1.5.1
2020-10-24 12:39:17 +02:00
jerch 57bd61697c Merge branch 'master' into dependabot/npm_and_yarn/playwright-1.5.1 2020-10-24 12:32:16 +02:00
jerch 3e8b8dc6ef Merge pull request #3122 from xtermjs/dependabot/npm_and_yarn/eslint-7.11.0
Bump eslint from 7.10.0 to 7.11.0
2020-10-24 12:31:03 +02:00
jerch b4bc830cee Merge branch 'master' into dependabot/npm_and_yarn/eslint-7.11.0 2020-10-24 12:19:02 +02:00
jerch 2e43f615f6 Merge pull request #3121 from xtermjs/dependabot/npm_and_yarn/source-map-loader-1.1.1
Bump source-map-loader from 1.1.0 to 1.1.1
2020-10-24 12:17:46 +02:00
jerch 5f2d1d2b4e Merge branch 'master' into dependabot/npm_and_yarn/source-map-loader-1.1.1 2020-10-24 12:07:11 +02:00
jerch 4ee305fa21 Merge pull request #3119 from xtermjs/dependabot/npm_and_yarn/deep-equal-2.0.4
Bump deep-equal from 2.0.3 to 2.0.4
2020-10-24 12:06:34 +02:00
jerch 4b3e16dbd0 Merge branch 'master' into dependabot/npm_and_yarn/deep-equal-2.0.4 2020-10-24 11:58:13 +02:00
jerch a7c836e42c Merge pull request #3117 from xtermjs/dependabot/npm_and_yarn/types/ws-7.2.7
Bump @types/ws from 7.2.6 to 7.2.7
2020-10-24 11:57:13 +02:00
dependabot-preview[bot] 886c057d0f Bump @types/webpack from 4.41.22 to 4.41.23
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.22 to 4.41.23.
- [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-10-21 09:34:39 +00:00
dependabot-preview[bot] 038704786d Bump ts-loader from 8.0.4 to 8.0.6
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.4 to 8.0.6.
- [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/8.0.4...v8.0.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-21 09:33:24 +00:00
Ken Aoki c61076830f Replace function call from term.fit() to addons.fit.instance.fit() 2020-10-21 06:44:17 +00:00
dependabot-preview[bot] 02fccfbdc7 Bump webpack-cli from 3.3.12 to 4.1.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 3.3.12 to 4.1.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/v3.3.12...webpack-cli@4.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-19 15:48:14 +00:00
dependabot-preview[bot] b250cedf81 Bump mocha from 8.1.3 to 8.2.0
Bumps [mocha](https://github.com/mochajs/mocha) from 8.1.3 to 8.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/v8.1.3...v8.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-18 01:30:59 +00:00
dependabot-preview[bot] 7243e330fc Bump @types/chai from 4.2.12 to 4.2.14
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.12 to 4.2.14.
- [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-10-16 16:46:16 +00:00
dependabot-preview[bot] 17a7fb2a6e Bump playwright from 1.4.2 to 1.5.1
Bumps [playwright](https://github.com/Microsoft/playwright) from 1.4.2 to 1.5.1.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.4.2...v1.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-15 09:50:26 +00:00
Ken Aoki d3d8ec3b20 Fix search not expanding selection to left when appropriate (revenge) 2020-10-13 09:55:10 +00:00
Ken Aoki b6074df4bf Revert "Fix search not expanding selection to left when appropriate"
This reverts commit a9d2b8a55c.
2020-10-13 06:44:01 +00:00
dependabot-preview[bot] f3cc9469a7 Bump eslint from 7.10.0 to 7.11.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.10.0 to 7.11.0.
- [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.10.0...v7.11.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-10 22:07:29 +00:00
Ken Aoki a9d2b8a55c Fix search not expanding selection to left when appropriate 2020-10-10 04:04:52 +00:00
dependabot-preview[bot] 73e235d9f8 Bump source-map-loader from 1.1.0 to 1.1.1
Bumps [source-map-loader](https://github.com/webpack-contrib/source-map-loader) from 1.1.0 to 1.1.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.1.0...v1.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-09 16:59:40 +00:00
Tony Brix 17ec85e39e Merge branch 'master' into rerender-hidden 2020-10-09 10:23:20 -05:00
dependabot-preview[bot] 723c64e481 Bump deep-equal from 2.0.3 to 2.0.4
Bumps [deep-equal](https://github.com/inspect-js/node-deep-equal) from 2.0.3 to 2.0.4.
- [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.3...v2.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 15:57:08 +00:00
Jörg Breitbart faa60be6fb add missing insert and delete events to CircularList.splice 2020-10-03 17:11:49 +02:00
Jörg Breitbart e95f9815d8 Merge branch 'master' into fix_3108 2020-10-03 16:43:04 +02:00
Jörg Breitbart 9b62d8a01a basic marker test cases 2020-10-03 16:32:46 +02:00
dependabot-preview[bot] 1c206c2c27 Bump @types/ws from 7.2.6 to 7.2.7
Bumps [@types/ws](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/ws) from 7.2.6 to 7.2.7.
- [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-09-30 03:51:40 +00:00
Daniel Imms 782797ca11 Merge pull request #3116 from bhrg3se/master
added TRASA in "Real-world uses" list
2020-09-29 10:37:40 -07:00
bhrg3se b34ee5157e added TRASA in "Real-world uses" list 2020-09-29 19:55:58 +05:45
Daniel Imms ae37c43cd4 Merge pull request #3112 from xtermjs/dependabot/npm_and_yarn/playwright-1.4.2
Bump playwright from 1.3.0 to 1.4.2
2020-09-28 09:15:56 -07:00
dependabot-preview[bot] 272b1d2194 Bump playwright from 1.3.0 to 1.4.2
Bumps [playwright](https://github.com/Microsoft/playwright) from 1.3.0 to 1.4.2.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.3.0...v1.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-28 16:05:45 +00:00
Daniel Imms 260e2dab16 Merge pull request #3115 from xtermjs/dependabot/npm_and_yarn/eslint-7.10.0
Bump eslint from 7.9.0 to 7.10.0
2020-09-28 09:03:36 -07:00
dependabot-preview[bot] 7c78390e2b Bump eslint from 7.9.0 to 7.10.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.9.0 to 7.10.0.
- [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.9.0...v7.10.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-28 15:50:17 +00:00
Jörg Breitbart f5a4eed27c add super.dispose, add oDispose to API 2020-09-27 15:59:11 +02:00
Daniel Imms b0768f18ca Merge pull request #3113 from zaataylor/patch-1
Fix spelling error in README
2020-09-26 15:16:40 -07:00
zaataylor 4d1e532069 Fix spelling error in README
I corrected the spelling error for the Internet Explorer 11 browser mentioned in the "Browser Support" section.
2020-09-26 13:11:24 -04:00
Mmis1000 5beb7f52c2 Serialize addon: Change benchmark random source from /dev/random to /dev/urandom 2020-09-23 21:22:40 +08:00
Mmis1000 eaaf9b7af1 Serialize addon: Fix file path in benchmark 2020-09-23 21:21:54 +08:00
Tony Brix 3c9687decf Merge branch 'master' into rerender-hidden 2020-09-21 17:46:06 -05:00
Daniel Imms a5e269a3f9 Merge pull request #3104 from xtermjs/dependabot/npm_and_yarn/ts-loader-8.0.4
Bump ts-loader from 8.0.3 to 8.0.4
2020-09-21 14:52:45 -07:00
Daniel Imms 30d84b1202 Merge pull request #3106 from xtermjs/dependabot/npm_and_yarn/typescript-4.0.3
Bump typescript from 4.0.2 to 4.0.3
2020-09-21 14:51:52 -07:00
Daniel Imms 0aa1079cd0 Merge pull request #3107 from xtermjs/dependabot/npm_and_yarn/webpack-4.44.2
Bump webpack from 4.44.1 to 4.44.2
2020-09-21 14:51:36 -07:00
dependabot-preview[bot] 1091255d2c Bump webpack from 4.44.1 to 4.44.2
Bumps [webpack](https://github.com/webpack/webpack) from 4.44.1 to 4.44.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.44.1...v4.44.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-21 15:55:09 +00:00
dependabot-preview[bot] 56e63d762b Bump typescript from 4.0.2 to 4.0.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.2 to 4.0.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.0.2...v4.0.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-21 15:54:34 +00:00
dependabot-preview[bot] f3c8b8f395 Bump ts-loader from 8.0.3 to 8.0.4
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.0.3 to 8.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/v8.0.3...8.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-21 15:53:19 +00:00
Mmis1000 47be9a2df4 Fix another error about impossible wrap 2020-09-18 22:02:30 +08:00
Mmis1000 aee1629c25 Reuse the cell object to redice gc 2020-09-18 21:02:56 +08:00
mmis1000 8587eea54c Merge branch 'master' into feature/xterm-addon-serialize-restore-layout-and-cursor 2020-09-18 15:28:33 +08:00
mmis1000 d7ed109f9d Support the isWrapped handling 2020-09-18 15:21:59 +08:00
Mmis1000 84dfe8fccc CLearup comment 2020-09-18 01:20:41 +08:00
Mmis1000 6904dc5009 Handle BCE + line scroll
Using an additional field for store the current background and compare
  against it to generate proper color sequence
2020-09-18 00:36:10 +08:00
Mmis1000 b89227d365 Workaround firefox bug that yield -0 on bit op 2020-09-16 22:47:23 +08:00
mmis1000 6c01630090 Remove the unused options 2020-09-16 15:13:30 +08:00
mmis1000 10282e4cb1 Move the test util to static method 2020-09-16 14:54:15 +08:00
mmis1000 8518b354a7 Fix test that breaks by the option change 2020-09-16 14:45:14 +08:00
mmis1000 00a8b80ef7 Implement cursor adn alt screen.
Fix background serialize
2020-09-16 14:28:08 +08:00
Daniel Imms 1a0a56c1f2 Merge pull request #3100 from Tyriar/fix_build
Fix publish build
2020-09-15 10:49:58 -07:00
Daniel Imms 055267ee9c Fix publish build 2020-09-15 10:49:21 -07:00
Daniel Imms 6e9040e6ba Merge pull request #3099 from Tyriar/role
Move role=document to xterm element
2020-09-15 10:38:14 -07:00
Daniel Imms a32776e2af Move role=document to xterm element
Feedback in microsoft/vscode#98918 said this could improve the UX on
screen readers
2020-09-15 10:33:28 -07:00
Tony Brix 1d6d6eb716 Merge branch 'master' into rerender-hidden 2020-09-15 09:55:22 -05:00
mmis1000 881a4a0dbb Try implement cursor restortion 2020-09-15 17:58:56 +08:00
Daniel Imms 003cf96910 Merge pull request #3096 from xtermjs/dependabot/npm_and_yarn/eslint-7.9.0
Bump eslint from 7.8.1 to 7.9.0
2020-09-14 10:41:58 -07:00
dependabot-preview[bot] 3cb87af315 Bump eslint from 7.8.1 to 7.9.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.8.1 to 7.9.0.
- [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.8.1...v7.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-14 16:07:24 +00:00
Mmis1000 edee1a1067 Handle alt screen 2020-09-13 21:33:32 +08:00
Daniel Imms e32d8774eb Merge branch 'master' into rerender-hidden 2020-09-11 05:56:26 -07:00
Daniel Imms 49d5608fa6 Define member bar in ctor 2020-09-11 05:29:24 -07:00
Daniel Imms 56bfdb64d4 Merge pull request #3088 from UziTech/patch-2
fix: fit addon proposing infinite dimensions
2020-09-11 05:25:09 -07:00
Tony Brix 9513c231c9 fix: rerender hidden terminal when visible 2020-09-11 00:42:18 -05:00
Tony Brix dd92161da5 test: test proposing dimensions on hidden terminal 2020-09-10 19:54:31 -05:00
Tony Brix 55571a1ae8 fix: fit addon proposing infinite dimensions 2020-09-10 12:31:27 -05:00
Daniel Imms c112990d8f Merge pull request #3087 from Tyriar/playwright
Update playwright to 1.3.0
2020-09-10 08:09:13 -07:00
Daniel Imms 23dba6aebd Remove commented out calls 2020-09-10 08:01:31 -07:00
Daniel Imms f669b8ed1d Fix 2444 regression test 2020-09-10 07:52:02 -07:00
Daniel Imms 9a22cbe44b Fix selection api test on Windows 2020-09-10 07:45:38 -07:00
Daniel Imms 883ddba934 Improve search test
Was failing on Windows
2020-09-10 07:38:14 -07:00
Daniel Imms 8f7295b8a2 Avoid cache in integration test jobs 2020-09-10 06:54:25 -07:00
Daniel Imms 0ba97f6941 Put customOscHandlerCallStack on window 2020-09-10 06:38:43 -07:00
Daniel Imms d979c077a0 Update playwright to 1.3.0
Fixes #2917
2020-09-10 06:31:59 -07:00
Daniel Imms 4e18a78c02 Merge pull request #3086 from Tyriar/addon_test_projects
Create addon test tsconfig projects
2020-09-09 14:26:19 -07:00
Daniel Imms 1d6e8abcca More other addons api tests into test project 2020-09-09 13:54:43 -07:00
Daniel Imms 82a65be446 Include new out-test path in test-api 2020-09-09 12:58:39 -07:00
Daniel Imms 0778a823d1 Exclude test dirs in npmignore 2020-09-09 12:54:01 -07:00
Daniel Imms eca36458b3 Move webgl addon test code into own tsconfig
Part of #2917
2020-09-09 12:53:33 -07:00
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
129 changed files with 4096 additions and 3909 deletions
-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/
+11 -9
View File
@@ -12,14 +12,21 @@
"test/api/tsconfig.json",
"test/benchmark/tsconfig.json",
"addons/xterm-addon-attach/src/tsconfig.json",
"addons/xterm-addon-attach/test/tsconfig.json",
"addons/xterm-addon-fit/src/tsconfig.json",
"addons/xterm-addon-fit/test/tsconfig.json",
"addons/xterm-addon-ligatures/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-search/test/tsconfig.json",
"addons/xterm-addon-serialize/src/tsconfig.json",
"addons/xterm-addon-serialize/test/tsconfig.json",
"addons/xterm-addon-serialize/benchmark/tsconfig.json",
"addons/xterm-addon-ligatures/src/tsconfig.json"
"addons/xterm-addon-unicode11/src/tsconfig.json",
"addons/xterm-addon-unicode11/test/tsconfig.json",
"addons/xterm-addon-web-links/src/tsconfig.json",
"addons/xterm-addon-web-links/test/tsconfig.json",
"addons/xterm-addon-webgl/src/tsconfig.json",
"addons/xterm-addon-webgl/test/tsconfig.json"
],
"sourceType": "module"
},
@@ -40,7 +47,6 @@
"readonly": "generic"
}
],
"@typescript-eslint/class-name-casing": "warn",
"@typescript-eslint/consistent-type-definitions": "warn",
"@typescript-eslint/explicit-function-return-type": [
"warn",
@@ -61,10 +67,6 @@
"warn",
2
],
"@typescript-eslint/interface-name-prefix": [
"warn",
"always"
],
"@typescript-eslint/member-delimiter-style": [
"warn",
{
-19
View File
@@ -1,19 +0,0 @@
FROM node:12
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
+8 -1
View File
@@ -87,7 +87,7 @@ The xterm.js team maintains the following addons but they can be built by anyone
Since xterm.js is typically implemented as a developer tool, only modern browsers are supported officially. Specifically the latest versions of *Chrome*, *Edge*, *Firefox* and *Safari*.
We also partially support *Intenet Explorer 11*, meaning xterm.js should work for the most part, but we reserve the right to not provide workarounds specifically for it unless it's absolutely necessary to get the basic input/output flow working.
We also partially support *Internet Explorer 11*, meaning xterm.js should work for the most part, but we reserve the right to not provide workarounds specifically for it unless it's absolutely necessary to get the basic input/output flow working.
Xterm.js works seamlessly in [Electron](https://electronjs.org/) apps and may even work on earlier versions of the browsers, these are the versions we strive to keep working.
@@ -165,6 +165,13 @@ Xterm.js is used in several world-class applications to provide great terminal e
- [**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.
- [**TRASA**](https://trasa.io): Zero trust access to Web, SSH, RDP and Database services.
- [**Commas**](https://github.com/CyanSalt/commas): Commas is a hackable terminal and command runner.
- [**Devtron**](https://github.com/devtron-labs/devtron): Software Delivery Workflow For Kubernetes.
- [**NxShell**](https://github.com/nxshell/nxshell): An easy to use new terminal for SSH.
[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
@@ -10,7 +10,7 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
+1 -2
View File
@@ -12,8 +12,7 @@
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -5,7 +5,7 @@
import WebSocket = require('ws');
import { openTerminal, pollFor, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -17,7 +17,7 @@ const height = 600;
describe('AttachAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es2015"
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
]
}
+8
View File
@@ -0,0 +1,8 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" }
]
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-fit",
"version": "0.4.0",
"version": "0.5.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -10,7 +10,7 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
+4
View File
@@ -59,6 +59,10 @@ export class FitAddon implements ITerminalAddon {
// TODO: Remove reliance on private API
const core = (this._terminal as any)._core;
if (core._renderService.dimensions.actualCellWidth === 0 || core._renderService.dimensions.actualCellHeight === 0) {
return undefined;
}
const parentElementStyle = window.getComputedStyle(this._terminal.element.parentElement);
const parentElementHeight = parseInt(parentElementStyle.getPropertyValue('height'));
const parentElementWidth = Math.max(0, parseInt(parentElementStyle.getPropertyValue('width')));
+1 -2
View File
@@ -12,8 +12,7 @@
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -5,7 +5,7 @@
import { assert } from 'chai';
import { openTerminal, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -17,12 +17,16 @@ const height = 768;
describe('FitAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
await page.setViewportSize({ width, height });
await page.goto(APP);
});
beforeEach(async function(): Promise<any> {
await page.evaluate(`document.querySelector('#terminal-container').style.display=''`);
await openTerminal(page);
});
@@ -30,6 +34,10 @@ describe('FitAddon', () => {
await browser.close();
});
afterEach(async function(): Promise<any> {
await page.evaluate(`window.term.dispose()`);
});
it('no terminal', async function(): Promise<any> {
await page.evaluate(`window.fit = new FitAddon();`);
assert.equal(await page.evaluate(`window.fit.proposeDimensions()`), undefined);
@@ -63,6 +71,15 @@ describe('FitAddon', () => {
rows: 1
});
});
it('hidden', async function(): Promise<any> {
await page.evaluate(`window.term.dispose()`);
await page.evaluate(`document.querySelector('#terminal-container').style.display='none'`);
await page.evaluate(`window.term = new Terminal()`);
await page.evaluate(`window.term.open(document.querySelector('#terminal-container'))`);
await loadFit();
assert.equal(await page.evaluate(`window.fit.proposeDimensions()`), undefined);
});
});
describe('fit', () => {
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es2015"
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
]
}
+8
View File
@@ -0,0 +1,8 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" }
]
}
+5 -5
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-ligatures",
"version": "0.3.0",
"version": "0.4.0",
"description": "Add support for programming ligatures to xterm.js",
"author": {
"name": "The xterm.js authors",
@@ -31,14 +31,14 @@
],
"license": "MIT",
"dependencies": {
"font-finder": "^1.0.4",
"font-ligatures": "^1.3.2"
"font-finder": "^1.1.0",
"font-ligatures": "^1.3.3"
},
"devDependencies": {
"@types/sinon": "^5.0.1",
"axios": "^0.18.0",
"mkdirp": "^0.5.1",
"sinon": "^6.1.3",
"mkdirp": "0.5.5",
"sinon": "6.3.5",
"yauzl": "^2.10.0"
},
"peerDependencies": {
+16 -13
View File
@@ -1,16 +1,19 @@
{
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"sourceMap": true,
"outDir": "../out",
"rootDir": ".",
"strict": true,
"noUnusedLocals": true,
"preserveWatchOutput": true
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
"compilerOptions": {
"target": "es2017",
"module": "commonjs",
"sourceMap": true,
"outDir": "../out",
"rootDir": ".",
"strict": true,
"noUnusedLocals": true,
"preserveWatchOutput": true,
"types": [
"../../../node_modules/@types/mocha"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
]
}
@@ -0,0 +1,7 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" }
]
}
+101 -51
View File
@@ -2,20 +2,49 @@
# yarn lockfile v1
"@sinonjs/formatio@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@sinonjs/formatio/-/formatio-2.0.0.tgz#84db7e9eb5531df18a8c5e0bfb6e449e55e654b2"
"@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:
samsam "1.3.0"
type-detect "4.0.8"
"@sinonjs/samsam@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@sinonjs/samsam/-/samsam-2.0.0.tgz#9163742ac35c12d3602dece74317643b35db6a80"
"@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"
@@ -49,16 +78,25 @@ follow-redirects@1.5.10:
dependencies:
debug "=3.1.0"
font-finder@^1.0.3, font-finder@^1.0.4:
font-finder@^1.0.3:
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.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/font-ligatures/-/font-ligatures-1.3.2.tgz#227eb5fc38fef34b5373aa19b555320b82842a71"
font-finder@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/font-finder/-/font-finder-1.1.0.tgz#2bff2b2762acba720239c8bec898a96daae90858"
integrity sha512-wpCL2uIbi6GurJbU7ZlQ3nGd61Ho+dSU6U83/xJT5UPFfN35EeCW/rOtS+5k+IuEZu2SYmHzDIPL9eA5tSYRAw==
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"
@@ -80,17 +118,31 @@ isarray@0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf"
just-extend@^1.1.27:
version "1.1.27"
resolved "https://registry.yarnpkg.com/just-extend/-/just-extend-1.1.27.tgz#ec6e79410ff914e472652abfa0e603c03d60e905"
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"
lolex@^2.3.2, lolex@^2.4.2:
version "2.7.1"
resolved "https://registry.yarnpkg.com/lolex/-/lolex-2.7.1.tgz#e40a8c4d1f14b536aa03e42a537c7adbaf0c20be"
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"
@@ -99,29 +151,32 @@ lru-cache@^4.1.3:
pseudomap "^1.0.2"
yallist "^2.1.2"
minimist@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
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.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
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 "0.0.8"
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.3.3:
version "1.4.2"
resolved "https://registry.yarnpkg.com/nise/-/nise-1.4.2.tgz#a9a3800e3994994af9e452333d549d60f72b8e8c"
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" "^2.0.0"
just-extend "^1.1.27"
lolex "^2.3.2"
"@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"
text-encoding "^0.6.4"
opentype.js@^0.8.0:
version "0.8.0"
@@ -147,38 +202,33 @@ pseudomap@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
samsam@1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.3.0.tgz#8d1d9350e25622da30de3e44ba692b5221ab7c50"
sinon@^6.1.3:
version "6.1.3"
resolved "https://registry.yarnpkg.com/sinon/-/sinon-6.1.3.tgz#98e7d716b7b11f7f1200e9c997e74f50ae094660"
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/formatio" "^2.0.0"
"@sinonjs/samsam" "^2.0.0"
"@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.4.2"
nise "^1.3.3"
supports-color "^5.4.0"
lolex "^2.7.5"
nise "^1.4.5"
supports-color "^5.5.0"
type-detect "^4.0.8"
supports-color@^5.4.0:
version "5.4.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.4.0.tgz#1c6b337402c2137605efe19f10fec390f6faab54"
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"
text-encoding@^0.6.4:
version "0.6.4"
resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19"
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, type-detect@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c"
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-search",
"version": "0.7.0",
"version": "0.8.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -10,7 +10,7 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
+9 -1
View File
@@ -158,8 +158,15 @@ export class SearchAddon implements ITerminalAddon {
};
if (incremental) {
// Try to expand selection to right first.
result = this._findInLine(term, searchPosition, searchOptions, false);
if (!(result && result.row === startRow && result.col === startCol)) {
const isOldResultHighlighted = result && result.row === startRow && result.col === startCol;
if (!isOldResultHighlighted) {
// If selection was not able to be expanded to the right, then try reverse search
if (currentSelection) {
searchPosition.startRow = currentSelection.endRow;
searchPosition.startCol = currentSelection.endColumn;
}
result = this._findInLine(term, searchPosition, searchOptions, true);
}
} else {
@@ -245,6 +252,7 @@ export class SearchAddon implements ITerminalAddon {
* @param term The search term.
* @param position The position to start the search.
* @param searchOptions Search options.
* @param isReverseSearch Whether the search should start from the right side of the terminal and search to the left.
* @return The search result if it was found.
*/
protected _findInLine(term: string, searchPosition: ISearchPosition, searchOptions: ISearchOptions = {}, isReverseSearch: boolean = false): ISearchResult | undefined {
+1 -2
View File
@@ -12,8 +12,7 @@
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -7,7 +7,7 @@ import { assert } from 'chai';
import { readFile } from 'fs';
import { resolve } from 'path';
import { openTerminal, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -19,7 +19,7 @@ const height = 600;
describe('Search Tests', function(): void {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
@@ -111,8 +111,15 @@ describe('Search Tests', function(): void {
let fixture: string;
before(async () => {
const rawFixture = await new Promise<Buffer>(r => readFile(resolve(__dirname, '../fixtures/issue-2444'), (err, data) => r(data)));
fixture = rawFixture.toString()
.replace(/\n/g, '\\n\\r')
if (process.platform === 'win32') {
fixture = rawFixture.toString()
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r');
} else {
fixture = rawFixture.toString()
.replace(/\n/g, '\\n\\r');
}
fixture = fixture
.replace(/'/g, '\\\'');
});
it('should find all occurrences using findNext', async () => {
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es6",
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
]
}
+8
View File
@@ -0,0 +1,8 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" }
]
}
@@ -16,12 +16,12 @@ class TestTerminal extends Terminal {
}
}
perfContext('Terminal: sh -c "dd if=/dev/random count=40 bs=1k | hexdump | lolcat -f"', () => {
perfContext('Terminal: sh -c "dd if=/dev/urandom count=40 bs=1k | hexdump | lolcat -f"', () => {
let content = '';
let contentUtf8: Uint8Array;
before(async () => {
const p = spawn('sh', ['-c', 'dd if=/dev/random count=40 bs=1k | hexdump | lolcat -f'], {
const p = spawn('sh', ['-c', 'dd if=/dev/urandom count=40 bs=1k | hexdump | lolcat -f'], {
name: 'xterm-256color',
cols: 80,
rows: 25,
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-serialize",
"version": "0.3.0",
"version": "0.5.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -9,13 +9,13 @@
"types": "typings/xterm-addon-serialize.d.ts",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package",
"benchmark": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json",
"benchmark-baseline": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --baseline out-benchmark/addons/xterm-addon-serialize/benchmark/*benchmark.js",
"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"
"benchmark-baseline": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --baseline out-benchmark/benchmark/*benchmark.js",
"benchmark-eval": "NODE_PATH=../../out:./out:./out-benchmark/ ../../node_modules/.bin/xterm-benchmark -r 5 -c benchmark/benchmark.json --eval out-benchmark/benchmark/*benchmark.js"
},
"peerDependencies": {
"xterm": "^4.0.0"
@@ -21,7 +21,7 @@ abstract class BaseSerializeHandler {
const cell2 = this._buffer.getNullCell();
let oldCell = cell1;
this._beforeSerialize(endRow - startRow);
this._beforeSerialize(endRow - startRow, startRow, endRow);
for (let row = startRow; row < endRow; row++) {
const line = this._buffer.getLine(row);
@@ -36,7 +36,7 @@ abstract class BaseSerializeHandler {
oldCell = c;
}
}
this._rowEnd(row);
this._rowEnd(row, row === endRow - 1);
}
this._afterSerialize();
@@ -45,8 +45,8 @@ abstract class BaseSerializeHandler {
}
protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void { }
protected _rowEnd(row: number): void { }
protected _beforeSerialize(rows: number): void { }
protected _rowEnd(row: number, isLastRow: boolean): void { }
protected _beforeSerialize(rows: number, startRow: number, endRow: number): void { }
protected _afterSerialize(): void { }
protected _serializeString(): string { return ''; }
}
@@ -71,27 +71,152 @@ function equalFlags(cell1: IBufferCell, cell2: IBufferCell): boolean {
&& cell1.isDim() === cell2.isDim();
}
class StringSerializeHandler extends BaseSerializeHandler {
private _rowIndex: number = 0;
private _allRows: string[] = new Array<string>();
private _allRowSeparators: string[] = new Array<string>();
private _currentRow: string = '';
private _nullCellCount: number = 0;
constructor(buffer: IBuffer) {
super(buffer);
// we can see a full colored cell and a null cell that only have background the same style
// but the information isn't preserved by null cell itself
// so wee need to record it when required.
private _cursorStyle: IBufferCell = this._buffer1.getNullCell();
// where exact the cursor styles comes from
// because we can't copy the cell directly
// so we remember where the content comes from instead
private _cursorStyleRow: number = 0;
private _cursorStyleCol: number = 0;
// this is a null cell for reference for checking whether background is empty or not
private _backgroundCell: IBufferCell = this._buffer1.getNullCell();
private _firstRow: number = 0;
private _lastCursorRow: number = 0;
private _lastCursorCol: number = 0;
private _lastContentCursorRow: number = 0;
private _lastContentCursorCol: number = 0;
constructor(private _buffer1: IBuffer, private _terminal: Terminal) {
super(_buffer1);
}
protected _beforeSerialize(rows: number): void {
protected _beforeSerialize(rows: number, start: number, end: number): void {
this._allRows = new Array<string>(rows);
this._lastContentCursorRow = start;
this._lastCursorRow = start;
this._firstRow = start;
}
protected _rowEnd(row: number): void {
this._allRows[this._rowIndex++] = this._currentRow;
private _thisRowLastChar: IBufferCell = this._buffer1.getNullCell();
private _thisRowLastSecondChar: IBufferCell = this._buffer1.getNullCell();
private _nextRowFirstChar: IBufferCell = this._buffer1.getNullCell();
protected _rowEnd(row: number, isLastRow: boolean): void {
// if there is colorful empty cell at line end, whe must pad it back, or the the color block will missing
if (this._nullCellCount > 0 && !equalBg(this._cursorStyle, this._backgroundCell)) {
// use clear right to set background.
this._currentRow += `\x1b[${this._nullCellCount}X`;
}
let rowSeparator = '';
// handle row separator
if (!isLastRow) {
// Enable BCE
if (row - this._firstRow >= this._terminal.rows) {
this._buffer1.getLine(this._cursorStyleRow)?.getCell(this._cursorStyleCol, this._backgroundCell);
}
// Fetch current line
const currentLine = this._buffer1.getLine(row)!;
// Fetch next line
const nextLine = this._buffer1.getLine(row + 1)!;
if (!nextLine.isWrapped) {
// just insert the line break
rowSeparator = '\r\n';
// we sended the enter
this._lastCursorRow = row + 1;
this._lastCursorCol = 0;
} else {
rowSeparator = '';
const thisRowLastChar = currentLine.getCell(currentLine.length - 1, this._thisRowLastChar)!;
const thisRowLastSecondChar = currentLine.getCell(currentLine.length - 2, this._thisRowLastSecondChar)!;
const nextRowFirstChar = nextLine.getCell(0, this._nextRowFirstChar)!;
const isNextRowFirstCharDoubleWidth = nextRowFirstChar.getWidth() > 1;
// validate whether this line wrap is ever possible
// which mean whether cursor can placed at a overflow position (x === row) naturally
let isValid = false;
if (
// you must output character to cause overflow, control sequence can't do this
nextRowFirstChar.getChars() &&
isNextRowFirstCharDoubleWidth ? this._nullCellCount <= 1 : this._nullCellCount <= 0
) {
if (
// the last character can't be null,
// you can't use control sequence to move cursor to (x === row)
(thisRowLastChar.getChars() || thisRowLastChar.getWidth() === 0) &&
// change background of the first wrapped cell also affects BCE
// so we mark it as invalid to simply the process to determine line separator
equalBg(thisRowLastChar, nextRowFirstChar)
) {
isValid = true;
}
if (
// the second to last character can't be null if the next line starts with CJK,
// you can't use control sequence to move cursor to (x === row)
isNextRowFirstCharDoubleWidth &&
(thisRowLastSecondChar.getChars() || thisRowLastSecondChar.getWidth() === 0) &&
// change background of the first wrapped cell also affects BCE
// so we mark it as invalid to simply the process to determine line separator
equalBg(thisRowLastChar, nextRowFirstChar) &&
equalBg(thisRowLastSecondChar, nextRowFirstChar)
) {
isValid = true;
}
}
if (!isValid) {
// force the wrap with magic
// insert enough character to force the wrap
rowSeparator = '-'.repeat(this._nullCellCount + 1);
// move back and erase next line head
rowSeparator += '\x1b[1D\x1b[1X';
if (this._nullCellCount > 0) {
// do these because we filled the last several null slot, which we shouldn't
rowSeparator += '\x1b[A';
rowSeparator += `\x1b[${currentLine.length - this._nullCellCount}C`;
rowSeparator += `\x1b[${this._nullCellCount}X`;
rowSeparator += `\x1b[${currentLine.length - this._nullCellCount}D`;
rowSeparator += '\x1b[B';
}
// This is content and need the be serialized even it is invisible.
// without this, wrap will be missing from outputs.
this._lastContentCursorRow = row + 1;
this._lastContentCursorCol = 0;
// force commit the cursor position
this._lastCursorRow = row + 1;
this._lastCursorCol = 0;
}
}
}
this._allRows[this._rowIndex] = this._currentRow;
this._allRowSeparators[this._rowIndex++] = rowSeparator;
this._currentRow = '';
this._nullCellCount = 0;
}
protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void {
private _diffStyle(cell: IBufferCell, oldCell: IBufferCell): number[] {
const sgrSeq: number[] = [];
const fgChanged = !equalFg(cell, oldCell);
const bgChanged = !equalBg(cell, oldCell);
@@ -99,7 +224,9 @@ class StringSerializeHandler extends BaseSerializeHandler {
if (fgChanged || bgChanged || flagsChanged) {
if (cell.isAttributeDefault()) {
this._currentRow += '\x1b[0m';
if (!oldCell.isAttributeDefault()) {
sgrSeq.push(0);
}
} else {
if (fgChanged) {
const color = cell.getFgColor();
@@ -131,30 +258,129 @@ class StringSerializeHandler extends BaseSerializeHandler {
}
}
if (sgrSeq.length) {
return sgrSeq;
}
protected _nextCell(cell: IBufferCell, oldCell: IBufferCell, row: number, col: number): void {
// a width 0 cell don't need to be count because it is just a placeholder after a CJK character;
const isPlaceHolderCell = cell.getWidth() === 0;
if (isPlaceHolderCell) {
return;
}
// this cell don't have content
const isEmptyCell = cell.getChars() === '';
const sgrSeq = this._diffStyle(cell, this._cursorStyle);
// the empty cell style is only assumed to be changed when background changed, because foreground is always 0.
const styleChanged = isEmptyCell ? !equalBg(this._cursorStyle, cell) : sgrSeq.length > 0;
/**
* handles style change
*/
if (styleChanged) {
// before update the style, we need to fill empty cell back
if (this._nullCellCount > 0) {
// use clear right to set background.
if (!equalBg(this._cursorStyle, this._backgroundCell)) {
this._currentRow += `\x1b[${this._nullCellCount}X`;
}
// use move right to move cursor.
this._currentRow += `\x1b[${this._nullCellCount}C`;
this._nullCellCount = 0;
}
this._lastContentCursorRow = this._lastCursorRow = row;
this._lastContentCursorCol = this._lastCursorCol = col;
this._currentRow += `\x1b[${sgrSeq.join(';')}m`;
// update the last cursor style
const line = this._buffer1.getLine(row);
if (line !== undefined) {
line.getCell(col, this._cursorStyle);
this._cursorStyleRow = row;
this._cursorStyleCol = col;
}
}
// 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++;
} else if (this._nullCellCount > 0) {
this._currentRow += `\x1b[${this._nullCellCount}C`;
this._nullCellCount = 0;
}
/**
* handles actual content
*/
if (isEmptyCell) {
this._nullCellCount += cell.getWidth();
} else {
if (this._nullCellCount > 0) {
// we can just assume we have same style with previous one here
// because style change is handled by previous stage
// use move right when background is empty, use clear right when there is background.
if (equalBg(this._cursorStyle, this._backgroundCell)) {
this._currentRow += `\x1b[${this._nullCellCount}C`;
} else {
this._currentRow += `\x1b[${this._nullCellCount}X`;
this._currentRow += `\x1b[${this._nullCellCount}C`;
}
this._nullCellCount = 0;
}
this._currentRow += cell.getChars();
this._currentRow += cell.getChars();
// update cursor
this._lastContentCursorRow = this._lastCursorRow = row;
this._lastContentCursorCol = this._lastCursorCol = col + cell.getWidth();
}
}
protected _serializeString(): string {
let rowEnd = this._allRows.length;
for (; rowEnd > 0; rowEnd--) {
if (this._allRows[rowEnd - 1]) {
break;
// the fixup is only required for data without scrollback
// because it will always be placed at last line otherwise
if (this._buffer1.length - this._firstRow <= this._terminal.rows) {
rowEnd = this._lastContentCursorRow + 1 - this._firstRow;
this._lastCursorCol = this._lastContentCursorCol;
this._lastCursorRow = this._lastContentCursorRow;
}
let content = '';
for (let i = 0; i < rowEnd; i++) {
content += this._allRows[i];
if (i + 1 < rowEnd) {
content += this._allRowSeparators[i];
}
}
return this._allRows.slice(0, rowEnd).join('\r\n');
// restore the cursor
const realCursorRow = this._buffer1.baseY + this._buffer1.cursorY;
const realCursorCol = this._buffer1.cursorX;
const cursorMoved = (realCursorRow !== this._lastCursorRow || realCursorCol !== this._lastCursorCol);
const moveRight = (offset: number): void => {
if (offset > 0) {
content += `\u001b[${offset}C`;
} else if (offset < 0) {
content += `\u001b[${-offset}D`;
}
};
const moveDown = (offset: number): void => {
if (offset > 0) {
content += `\u001b[${offset}B`;
} else if (offset < 0) {
content += `\u001b[${-offset}A`;
}
};
if (cursorMoved) {
moveDown(realCursorRow - this._lastCursorRow);
moveRight(realCursorCol - this._lastCursorCol);
}
return content;
}
}
@@ -167,20 +393,33 @@ export class SerializeAddon implements ITerminalAddon {
this._terminal = terminal;
}
public serialize(rows?: number): string {
// TODO: Add re-position cursor support
// TODO: Add word wrap mode support
private _getString(buffer: IBuffer, scrollback?: number): string {
const maxRows = buffer.length;
const handler = new StringSerializeHandler(buffer, this._terminal!);
const correctRows = (scrollback === undefined) ? maxRows : constrain(scrollback + this!._terminal!.rows, 0, maxRows);
const result = handler.serialize(maxRows - correctRows, maxRows);
return result;
}
public serialize(scrollback?: number): string {
// TODO: Add combinedData support
if (!this._terminal) {
throw new Error('Cannot use addon until it has been loaded');
}
const maxRows = this._terminal.buffer.active.length;
const handler = new StringSerializeHandler(this._terminal.buffer.active);
if (this._terminal.buffer.active.type === 'normal') {
return this._getString(this._terminal.buffer.active, scrollback);
}
rows = (rows === undefined) ? maxRows : constrain(rows, 0, maxRows);
const normalScreenContent = this._getString(this._terminal.buffer.normal, scrollback);
// alt screen don't have scrollback
const alternativeScreenContent = this._getString(this._terminal.buffer.alternate, undefined);
return handler.serialize(maxRows - rows, maxRows);
return normalScreenContent
+ '\u001b[?1049h\u001b[H'
+ alternativeScreenContent;
}
public dispose(): void { }
@@ -18,8 +18,7 @@
},
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -5,7 +5,7 @@
import { assert } from 'chai';
import { openTerminal, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -14,10 +14,26 @@ let page: Page;
const width = 800;
const height = 600;
const writeRawSync = (page: any, str: string): Promise<void> => writeSync(page, '\' +' + JSON.stringify(str) + '+ \'');
const testNormalScreenEqual = async (page: any, str: string): Promise<void> => {
await writeRawSync(page, str);
const originalBuffer = await page.evaluate(`inspectBuffer(term.buffer.normal);`);
const result = await page.evaluate(`serializeAddon.serialize();`) as string;
await page.evaluate(`term.reset();`);
await writeRawSync(page, result);
const newBuffer = await page.evaluate(`inspectBuffer(term.buffer.normal);`);
// chai decides -0 and 0 are different number...
// and firefox have a bug that output -0 for unknown reason
assert.equal(JSON.stringify(originalBuffer), JSON.stringify(newBuffer));
};
describe('SerializeAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
@@ -27,19 +43,74 @@ describe('SerializeAddon', () => {
await page.evaluate(`
window.serializeAddon = new SerializeAddon();
window.term.loadAddon(window.serializeAddon);
window.inspectBuffer = (buffer) => {
const lines = [];
for (let i = 0; i < buffer.length; i++) {
// Do this intentionally to get content of underlining source
const bufferLine = buffer.getLine(i)._line;
lines.push(JSON.stringify(bufferLine));
}
return {
x: buffer.cursorX,
y: buffer.cursorY,
data: lines
};
}
`);
});
after(async () => await browser.close());
beforeEach(async () => await page.evaluate(`window.term.reset()`));
it('produce different output when we call test util with different text', async function(): Promise<any> {
await writeRawSync(page, '12345');
const buffer1 = await page.evaluate(`inspectBuffer(term.buffer.normal);`);
await page.evaluate(`term.reset();`);
await writeRawSync(page, '67890');
const buffer2 = await page.evaluate(`inspectBuffer(term.buffer.normal);`);
assert.throw(() => {
assert.equal(JSON.stringify(buffer1), JSON.stringify(buffer2));
});
});
it('produce different output when we call test util with different line wrap', async function(): Promise<any> {
await writeRawSync(page, '1234567890\r\n12345');
const buffer3 = await page.evaluate(`inspectBuffer(term.buffer.normal);`);
await page.evaluate(`term.reset();`);
await writeRawSync(page, '1234567890n12345');
const buffer4 = await page.evaluate(`inspectBuffer(term.buffer.normal);`);
assert.throw(() => {
assert.equal(JSON.stringify(buffer3), JSON.stringify(buffer4));
});
});
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('unwrap wrapped line', async function(): Promise<any> {
const lines = ['123456789123456789'];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('does not unwrap non-wrapped line', async function(): Promise<any> {
const lines = [
'123456789',
'123456789'
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('preserve last empty lines', async function(): Promise<any> {
const cols = 10;
const lines = [
'',
@@ -55,7 +126,7 @@ describe('SerializeAddon', () => {
''
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.slice(0, 8).join('\r\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('digits content', async function(): Promise<any> {
@@ -67,21 +138,22 @@ describe('SerializeAddon', () => {
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.join('\r\n'));
});
it('serialize half rows of content', async function(): Promise<any> {
const rows = 10;
const halfRows = rows >> 1;
it('serialize with half of scrollback', async function(): Promise<any> {
const rows = 20;
const scrollback = rows - 10;
const halfScrollback = scrollback / 2;
const cols = 10;
const lines = newArray<string>((index: number) => digitsString(cols, index), rows);
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize(${halfRows});`), lines.slice(halfRows, 2 * halfRows).join('\r\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize(${halfScrollback});`), lines.slice(halfScrollback, rows).join('\r\n'));
});
it('serialize 0 rows of content', async function(): Promise<any> {
const rows = 10;
it('serialize 0 rows of scrollback', async function(): Promise<any> {
const rows = 20;
const cols = 10;
const lines = newArray<string>((index: number) => digitsString(cols, index), rows);
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize(0);`), '');
assert.equal(await page.evaluate(`serializeAddon.serialize(0);`), lines.slice(rows - 10, rows).join('\r\n'));
});
it('serialize all rows of content with color16', async function(): Promise<any> {
@@ -270,6 +342,145 @@ describe('SerializeAddon', () => {
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), expected.join('\r\n'));
});
it('serialize CJK correctly', async () => {
const lines = [
'中文中文',
'12中文',
'中文12',
// This line is going to be wrapped at last character
// because it has line length of 11 (1+2*5).
// We concat it back without the null cell currently.
// But this may be incorrect.
// see also #3097
'1中文中文中'
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`serializeAddon.serialize();`), lines.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'));
});
it('serialize with alt screen correctly', async () => {
const SMCUP = '\u001b[?1049h';
const CUP = '\u001b[H';
const lines = [
`1${SMCUP}${CUP}2`
];
const expected = [
`1${SMCUP}${CUP}2`
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'alternate');
assert.equal(JSON.stringify(await page.evaluate(`serializeAddon.serialize();`)), JSON.stringify(expected.join('\r\n')));
});
it('serialize without alt screen correctly', async () => {
const SMCUP = '\u001b[?1049h';
const RMCUP = '\u001b[?1049l';
const lines = [
`1${SMCUP}2${RMCUP}`
];
const expected = [
`1`
];
await writeSync(page, lines.join('\\r\\n'));
assert.equal(await page.evaluate(`window.term.buffer.active.type`), 'normal');
assert.equal(JSON.stringify(await page.evaluate(`serializeAddon.serialize();`)), JSON.stringify(expected.join('\r\n')));
});
it('serialize with background', async () => {
const CLEAR_RIGHT = (l: number): string => `\u001b[${l}X`;
const lines = [
`1\u001b[44m${CLEAR_RIGHT(5)}`,
`2${CLEAR_RIGHT(9)}`
];
await testNormalScreenEqual(page, lines.join('\r\n'));
});
it('cause the BCE on scroll', async () => {
const CLEAR_RIGHT = (l: number): string => `\u001b[${l}X`;
const padLines = newArray<string>(
(index: number) => digitsString(10, index),
10
);
const lines = [
...padLines,
`\u001b[44m${CLEAR_RIGHT(5)}1111111111111111`
];
await testNormalScreenEqual(page, lines.join('\r\n'));
});
it('handle invalid wrap before scroll', async () => {
const CLEAR_RIGHT = (l: number): string => `\u001b[${l}X`;
const MOVE_UP = (l: number): string => `\u001b[${l}A`;
const MOVE_DOWN = (l: number): string => `\u001b[${l}B`;
const MOVE_LEFT = (l: number): string => `\u001b[${l}D`;
// A line wrap happened after current line.
// But there is no content.
// so wrap shouldn't even be able to happen.
const segments = [
`123456789012345`,
MOVE_UP(1),
CLEAR_RIGHT(5),
MOVE_DOWN(1),
MOVE_LEFT(5),
CLEAR_RIGHT(5),
MOVE_UP(1),
'1'
];
await testNormalScreenEqual(page, segments.join(''));
});
it('handle invalid wrap after scroll', async () => {
const CLEAR_RIGHT = (l: number): string => `\u001b[${l}X`;
const MOVE_UP = (l: number): string => `\u001b[${l}A`;
const MOVE_DOWN = (l: number): string => `\u001b[${l}B`;
const MOVE_LEFT = (l: number): string => `\u001b[${l}D`;
const padLines = newArray<string>(
(index: number) => digitsString(10, index),
10
);
// A line wrap happened after current line.
// But there is no content.
// so wrap shouldn't even be able to happen.
const lines = [
padLines.join('\r\n'),
'\r\n',
`123456789012345`,
MOVE_UP(1),
CLEAR_RIGHT(5),
MOVE_DOWN(1),
MOVE_LEFT(5),
CLEAR_RIGHT(5),
MOVE_UP(1),
'1'
];
await testNormalScreenEqual(page, lines.join(''));
});
});
function newArray<T>(initial: T | ((index: number) => T), count: number): T[] {
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es2015"
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"baseUrl": ".",
"paths": {
"common/*": [
"../../../src/common/*"
]
},
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{
"path": "../../../src/common"
}
]
}
@@ -0,0 +1,9 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" },
{ "path": "./benchmark" }
]
}
@@ -25,10 +25,10 @@ declare module 'xterm-addon-serialize' {
* to restore the state. The cursor will also be positioned to the correct cell.
* When restoring a terminal it is best to do before `Terminal.open` is called
* to avoid wasting CPU cycles rendering incomplete frames.
* @param rows The number of rows to serialize, starting from the bottom of the
* terminal. This defaults to the number of rows in the viewport.
* @param scrollback The number of rows in scrollback buffer to serialize, starting from the bottom of the
* scrollback buffer. This defaults to the all available rows in the scrollback buffer.
*/
public serialize(rows?: number): string;
public serialize(scrollback?: number): string;
/**
* Disposes the addon.
+1 -1
View File
@@ -10,7 +10,7 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
@@ -18,8 +18,7 @@
]
},
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -5,7 +5,7 @@
import { assert } from 'chai';
import { openTerminal, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -17,7 +17,7 @@ const height = 600;
describe('Unicode11Addon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
@@ -0,0 +1,35 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es2015",
"lib": [
"dom",
"es2015"
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"strict": true,
"baseUrl": ".",
"paths": {
"common/*": [
"../../../src/common/*"
]
},
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{
"path": "../../../src/common"
}
]
}
@@ -0,0 +1,8 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" }
]
}
+1 -1
View File
@@ -10,7 +10,7 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
@@ -3,20 +3,40 @@
* @license MIT
*/
import { ILinkProvider, IBufferCellPosition, ILink, Terminal } from 'xterm';
import { ILinkProvider, ILink, Terminal, IViewportRange } from 'xterm';
interface ILinkProviderOptions {
hover?(event: MouseEvent, text: string, location: IViewportRange): void;
leave?(event: MouseEvent, text: string): void;
}
export class WebLinkProvider implements ILinkProvider {
constructor(
private readonly _terminal: Terminal,
private readonly _regex: RegExp,
private readonly _handler: (event: MouseEvent, uri: string) => void
private readonly _handler: (event: MouseEvent, uri: string) => void,
private readonly _options: ILinkProviderOptions = {}
) {
}
public provideLinks(y: number, callback: (links: ILink[] | undefined) => void): void {
callback(LinkComputer.computeLink(y, this._regex, this._terminal, this._handler));
const links = LinkComputer.computeLink(y, this._regex, this._terminal, this._handler);
callback(this._addCallbacks(links));
}
private _addCallbacks(links: ILink[]): ILink[] {
return links.map(link => {
link.leave = this._options.leave;
link.hover = (event: MouseEvent, uri: string): void => {
if (this._options.hover) {
const { range } = link;
this._options.hover(event, uri, range);
}
};
return link;
});
}
}
@@ -3,7 +3,7 @@
* @license MIT
*/
import { Terminal, ILinkMatcherOptions, ITerminalAddon, IDisposable } from 'xterm';
import { Terminal, ILinkMatcherOptions, ITerminalAddon, IDisposable, IViewportRange } from 'xterm';
import { WebLinkProvider } from './WebLinkProvider';
const protocolClause = '(https?:\\/\\/)';
@@ -36,6 +36,11 @@ function handleLink(event: MouseEvent, uri: string): void {
}
}
interface ILinkProviderOptions {
hover?(event: MouseEvent, text: string, location: IViewportRange): void;
leave?(event: MouseEvent, text: string): void;
}
export class WebLinksAddon implements ITerminalAddon {
private _linkMatcherId: number | undefined;
private _terminal: Terminal | undefined;
@@ -43,20 +48,22 @@ export class WebLinksAddon implements ITerminalAddon {
constructor(
private _handler: (event: MouseEvent, uri: string) => void = handleLink,
private _options: ILinkMatcherOptions = {},
private _options: ILinkMatcherOptions | ILinkProviderOptions = {},
private _useLinkProvider: boolean = false
) {
this._options.matchIndex = 1;
}
public activate(terminal: Terminal): void {
this._terminal = terminal;
if (this._useLinkProvider && 'registerLinkProvider' in this._terminal) {
this._linkProvider = this._terminal.registerLinkProvider(new WebLinkProvider(this._terminal, strictUrlRegex, this._handler));
const options = this._options as ILinkProviderOptions;
this._linkProvider = this._terminal.registerLinkProvider(new WebLinkProvider(this._terminal, strictUrlRegex, this._handler, options));
} else {
// TODO: This should be removed eventually
this._linkMatcherId = (this._terminal as Terminal).registerLinkMatcher(strictUrlRegex, this._handler, this._options);
const options = this._options as ILinkMatcherOptions;
options.matchIndex = 1;
this._linkMatcherId = (this._terminal as Terminal).registerLinkMatcher(strictUrlRegex, this._handler, options);
}
}
@@ -12,8 +12,7 @@
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -5,7 +5,7 @@
import { assert } from 'chai';
import { openTerminal, pollFor, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -17,7 +17,7 @@ const height = 600;
describe('WebLinksAddon', () => {
before(async function(): Promise<any> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es2015"
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
]
}
@@ -0,0 +1,8 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" }
]
}
@@ -4,7 +4,7 @@
*/
import { Terminal, ILinkMatcherOptions, ITerminalAddon } from 'xterm';
import { Terminal, ILinkMatcherOptions, ITerminalAddon, IViewportRange } from 'xterm';
declare module 'xterm-addon-web-links' {
/**
@@ -20,7 +20,7 @@ declare module 'xterm-addon-web-links' {
* 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, useLinkProvider?: boolean);
constructor(handler?: (event: MouseEvent, uri: string) => void, options?: ILinkMatcherOptions | ILinkProviderOptions, useLinkProvider?: boolean);
/**
* Activates the addon
@@ -33,4 +33,21 @@ declare module 'xterm-addon-web-links' {
*/
public dispose(): void;
}
/**
* An object containing options for a link provider.
*/
export interface ILinkProviderOptions {
/**
* A callback that fires when the mouse hovers over a link for a period of
* time (defined by {@link ITerminalOptions.linkTooltipHoverDuration}).
*/
hover?(event: MouseEvent, text: string, location: IViewportRange): void;
/**
* A callback that fires when the mouse leaves a link. Note that this can
* happen even when tooltipCallback hasn't fired for the link yet.
*/
leave?(event: MouseEvent, text: string): void;
}
}
+2
View File
@@ -3,3 +3,5 @@
tsconfig.json
.yarnrc
webpack.config.js
out-test/
test/
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "xterm-addon-webgl",
"version": "0.8.0",
"version": "0.10.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
@@ -10,7 +10,7 @@
"repository": "https://github.com/xtermjs/xterm.js",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"build": "../../node_modules/.bin/tsc -p .",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
@@ -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,
@@ -43,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 {
@@ -40,4 +40,8 @@ export class WebglAddon implements ITerminalAddon {
public get textureAtlas(): HTMLCanvasElement | undefined {
return this._renderer?.textureAtlas;
}
public clearTextureAtlas(): void {
this._renderer?.clearCharAtlas();
}
}
+24 -8
View File
@@ -116,9 +116,6 @@ 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();
}
@@ -137,7 +134,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._updateDimensions();
this._model.resize(this._terminal.cols, this._terminal.rows);
this._rectangleRenderer.onResize();
// Resize all render layers
this._renderLayers.forEach(l => l.resize(this._terminal, this.dimensions));
@@ -151,6 +147,13 @@ export class WebglRenderer extends Disposable implements IRenderer {
// Resize the screen
this._core.screenElement!.style.width = `${this.dimensions.canvasWidth}px`;
this._core.screenElement!.style.height = `${this.dimensions.canvasHeight}px`;
this._rectangleRenderer.onResize();
if (this._model.selection.hasSelection) {
// Update selection as dimensions have changed
this._rectangleRenderer.updateSelection(this._model.selection);
}
this._glyphRenderer.setDimensions(this.dimensions);
this._glyphRenderer.onResize();
@@ -177,9 +180,6 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._updateSelectionModel(start, end, columnSelectMode);
this._rectangleRenderer.updateSelection(this._model.selection);
this._glyphRenderer.updateSelection(this._model);
this._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
}
@@ -214,6 +214,13 @@ 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._onRequestRedraw.fire({ start: 0, end: this._terminal.rows - 1 });
}
public clear(): void {
this._renderLayers.forEach(l => l.reset(this._terminal));
}
@@ -243,6 +250,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
// Tell renderer the frame is beginning
if (this._glyphRenderer.beginFrame()) {
this._model.clear();
this._updateSelectionModel(undefined, undefined);
}
// Update model to reflect what's drawn
@@ -292,14 +300,19 @@ export class WebglRenderer extends Disposable implements IRenderer {
}
}
this._rectangleRenderer.updateBackgrounds(this._model);
if (this._model.selection.hasSelection) {
// Model could be updated but the selection is unchanged
this._glyphRenderer.updateSelection(this._model);
}
}
private _updateSelectionModel(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean): void {
private _updateSelectionModel(start: [number, number] | undefined, end: [number, number] | undefined, columnSelectMode: boolean = false): void {
const terminal = this._terminal;
// Selection does not exist
if (!start || !end || (start[0] === end[0] && start[1] === end[1])) {
this._model.clearSelection();
this._rectangleRenderer.updateSelection(this._model.selection);
return;
}
@@ -312,6 +325,7 @@ export class WebglRenderer extends Disposable implements IRenderer {
// No need to draw the selection
if (viewportCappedStartRow >= terminal.rows || viewportCappedEndRow < 0) {
this._model.clearSelection();
this._rectangleRenderer.updateSelection(this._model.selection);
return;
}
@@ -323,6 +337,8 @@ export class WebglRenderer extends Disposable implements IRenderer {
this._model.selection.viewportCappedEndRow = viewportCappedEndRow;
this._model.selection.startCol = start[0];
this._model.selection.endCol = end[0];
this._rectangleRenderer.updateSelection(this._model.selection);
}
/**
@@ -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) {
+1 -2
View File
@@ -21,8 +21,7 @@
},
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../out-test/api/TestUtils"
"../../../node_modules/@types/mocha"
]
},
"include": [
@@ -7,7 +7,7 @@ import { ITerminalOptions } from '../../../src/common/Types';
import { ITheme } from 'xterm';
import { assert } from 'chai';
import { openTerminal, pollFor, writeSync, getBrowserType } from '../../../out-test/api/TestUtils';
import { Browser, Page } from 'playwright-core';
import { Browser, Page } from 'playwright';
const APP = 'http://127.0.0.1:3000/test';
@@ -16,14 +16,12 @@ let page: Page;
const width = 800;
const height = 600;
let itWebgl: (expectation: string, callback?: (this: Mocha.ITestCallbackContext, done: MochaDone) => any) => Mocha.ITest | void;
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);
itWebgl = areTestsEnabled ? it : it.skip;
const itWebgl = areTestsEnabled ? it : it.skip;
itWebgl('dispose removes renderer canvases', async function(): Promise<void> {
await setupBrowser();
@@ -894,7 +892,7 @@ async function getCellColor(col: number, row: number): Promise<number[]> {
async function setupBrowser(options: ITerminalOptions = { rendererType: 'dom' }): Promise<void> {
const browserType = getBrowserType();
browser = await browserType.launch({ dumpio: true,
browser = await browserType.launch({
headless: process.argv.indexOf('--headless') !== -1
});
page = await (await browser.newContext()).newPage();
@@ -0,0 +1,40 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"lib": [
"es6",
],
"rootDir": ".",
"outDir": "../out-test",
"sourceMap": true,
"removeComments": true,
"baseUrl": ".",
"paths": {
"common/*": [
"../../../src/common/*"
],
"browser/*": [
"../../../src/browser/*"
]
},
"strict": true,
"types": [
"../../../node_modules/@types/mocha",
"../../../node_modules/@types/node",
"../../../out-test/api/TestUtils"
]
},
"include": [
"./**/*",
"../../../typings/xterm.d.ts"
],
"references": [
{
"path": "../../../src/common"
},
{
"path": "../../../src/browser"
}
]
}
+8
View File
@@ -0,0 +1,8 @@
{
"files": [],
"include": [],
"references": [
{ "path": "./src" },
{ "path": "./test" }
]
}
+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;
}
}
-10
View File
@@ -98,11 +98,6 @@ jobs:
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: |
@@ -122,11 +117,6 @@ jobs:
inputs:
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: |
-23
View File
@@ -1,23 +0,0 @@
/**
* 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));
}
+2 -2
View File
@@ -359,7 +359,7 @@ function empty(ar) {
}
function* parseMultiLineGen(filename, s) {
if (!~s.indexOf('@vt:')) {
if (!s.includes('@vt:')) {
return;
}
const lines = s.split('\n').map(el => el.trim().replace(/[*]/, '').replace(/\s/, ''));
@@ -413,7 +413,7 @@ function parseSingleLine(filename, s) {
const line = s.trim();
const match = line.match(REX_VT_LINE);
if (match !== null) {
if (!~TYPES.indexOf(match[2])) {
if (!TYPES.includes(match[2])) {
throw new Error(`unkown vt-command type "${match[2]}" specified in "${filename}"`);
}
return {
+2 -2
View File
@@ -25,7 +25,7 @@ if (fs.existsSync(addonsPath)) {
// walk all addon folders
fs.readdir(addonsPath, (err, files) => {
files.forEach(folder => {
for (const folder of files) {
const addonPath = path.join(addonsPath, folder);
// install only if there are dependencies listed
@@ -51,6 +51,6 @@ if (fs.existsSync(addonsPath)) {
} else {
console.log('Skipped', folder);
}
});
}
});
}
+5 -5
View File
@@ -11,7 +11,7 @@ const path = require('path');
// Setup auth
fs.writeFileSync(`${process.env['HOME']}/.npmrc`, `//registry.npmjs.org/:_authToken=${process.env['NPM_AUTH_TOKEN']}`);
const isDryRun = process.argv.indexOf('--dry') !== -1;
const isDryRun = process.argv.includes('--dry');
if (isDryRun) {
console.log('Publish dry run');
}
@@ -36,13 +36,13 @@ const addonPackageDirs = [
path.resolve(__dirname, '../addons/xterm-addon-webgl')
];
console.log(`Checking if addons need to be published`);
addonPackageDirs.forEach(p => {
for (const p of addonPackageDirs) {
const addon = path.basename(p);
if (changedFiles.some(e => e.indexOf(addon) !== -1)) {
if (changedFiles.some(e => e.includes(addon))) {
console.log(`Try publish ${addon}`);
checkAndPublishPackage(p);
}
});
}
// Publish website if it's a stable release
if (isStableRelease) {
@@ -54,7 +54,7 @@ function checkAndPublishPackage(packageDir) {
// Determine if this is a stable or beta release
const publishedVersions = getPublishedVersions(packageJson);
const isStableRelease = publishedVersions.indexOf(packageJson.version) === -1;
const isStableRelease = !publishedVersions.includes(packageJson.version);
// Get the next version
let nextVersion = isStableRelease ? packageJson.version : getNextBetaVersion(packageJson);
+1 -1
View File
@@ -12,7 +12,7 @@ const env = { ...process.env };
env.NODE_PATH = path.resolve(__dirname, '../out');
let testFiles = [
'./addons/**/out/*api.js',
'./addons/**/out-test/*api.js',
'./out-test/**/*api.js',
];
+5 -5
View File
@@ -88,19 +88,19 @@ function evalButtonCode(code) {
if (code & 64) {
button |= 4
}
let actionS = 'press';
let action = 'press';
let buttonS = reverseButtons[button];
if (button === 3) {
buttonS = '<none>';
actionS = 'release';
action = 'release';
}
if (move) {
actionS = 'move';
action = 'move';
} else if (4 <= button && button <= 7) {
buttonS = 'wheel';
actionS = button === 4 ? 'up' : button === 5 ? 'down' : button === 6 ? 'left' : 'right';
action = button === 4 ? 'up' : button === 5 ? 'down' : button === 6 ? 'left' : 'right';
}
return {button: buttonS, action: actionS, modifier};
return {button: buttonS, action, modifier};
}
// protocols
+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;
+1 -1
View File
@@ -93,7 +93,7 @@ const paddingElement = <HTMLInputElement>document.getElementById('padding');
function setPadding(): void {
term.element.style.padding = parseInt(paddingElement.value, 10).toString() + 'px';
term.fit();
addons.fit.instance.fit();
}
function getSearchOptions(e: KeyboardEvent): ISearchOptions {
+9 -9
View File
@@ -43,15 +43,15 @@ function startServer() {
const env = Object.assign({}, process.env);
env['COLORTERM'] = 'truecolor';
var cols = parseInt(req.query.cols),
rows = parseInt(req.query.rows),
term = pty.spawn(process.platform === 'win32' ? 'cmd.exe' : 'bash', [], {
name: 'xterm-256color',
cols: cols || 80,
rows: rows || 24,
cwd: env.PWD,
env: env,
encoding: USE_BINARY ? null : 'utf8'
});
rows = parseInt(req.query.rows),
term = pty.spawn(process.platform === 'win32' ? 'cmd.exe' : 'bash', [], {
name: 'xterm-256color',
cols: cols || 80,
rows: rows || 24,
cwd: process.platform === 'win32' ? undefined : env.PWD,
env: env,
encoding: USE_BINARY ? null : 'utf8'
});
console.log('Created terminal with PID: ' + term.pid);
terminals[term.pid] = term;
-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"]
+21 -23
View File
@@ -1,7 +1,7 @@
{
"name": "xterm",
"description": "Full xterm terminal, in your browser",
"version": "4.7.0",
"version": "4.11.0",
"main": "lib/xterm.js",
"style": "css/xterm.css",
"types": "typings/xterm.d.ts",
@@ -11,6 +11,7 @@
"prepackage": "npm run build",
"package": "webpack",
"start": "node demo/start",
"start-debug": "node --inspect-brk demo/start",
"lint": "eslint -c .eslintrc.json --max-warnings 0 --ext .ts src/ addons/",
"test": "npm run test-unit",
"posttest": "npm run lint",
@@ -18,9 +19,6 @@
"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",
@@ -36,37 +34,37 @@
"vtfeatures": "node bin/extract_vtfeatures.js src/**/*.ts src/*.ts"
},
"devDependencies": {
"@types/chai": "^4.2.11",
"@types/chai": "^4.2.14",
"@types/debug": "^4.1.5",
"@types/deep-equal": "^1.0.1",
"@types/glob": "^7.1.2",
"@types/jsdom": "^16.2.3",
"@types/mocha": "^7.0.2",
"@types/glob": "^7.1.3",
"@types/jsdom": "^16.2.5",
"@types/mocha": "^8.0.3",
"@types/node": "^10.17.17",
"@types/utf8": "^2.1.6",
"@types/webpack": "^4.41.17",
"@types/ws": "^7.2.5",
"@typescript-eslint/eslint-plugin": "^2.34.0",
"@typescript-eslint/parser": "^2.34.0",
"@types/webpack": "^4.41.24",
"@types/ws": "^7.2.9",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^3.10.1",
"chai": "^4.2.0",
"deep-equal": "^2.0.3",
"eslint": "^6.8.0",
"deep-equal": "^2.0.4",
"eslint": "^7.12.1",
"express": "^4.17.1",
"express-ws": "^4.0.0",
"glob": "^7.0.5",
"jsdom": "^16.2.2",
"mocha": "^8.0.1",
"jsdom": "^16.4.0",
"mocha": "^8.2.1",
"mustache": "^4.0.1",
"node-pty": "^0.9.0",
"nyc": "^15.1.0",
"playwright-core": "^0.11.1",
"source-map-loader": "^1.0.0",
"ts-loader": "^7.0.5",
"typescript": "3.9",
"playwright": "^1.5.2",
"source-map-loader": "^1.1.2",
"ts-loader": "^8.0.8",
"typescript": "4.0",
"utf8": "^3.0.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"ws": "^7.3.0",
"webpack": "^5.4.0",
"webpack-cli": "^4.2.0",
"ws": "^7.3.1",
"xterm-benchmark": "^0.1.3"
}
}
+2 -2
View File
@@ -56,8 +56,8 @@ export class AccessibilityManager extends Disposable {
this._accessibilityTreeRoot.classList.add('xterm-accessibility');
this._rowContainer = document.createElement('div');
this._rowContainer.classList.add('xterm-accessibility-tree');
this._rowContainer.setAttribute('role', 'list');
this._rowContainer.classList.add('xterm-accessibility-tree');
this._rowElements = [];
for (let i = 0; i < this._terminal.rows; i++) {
this._rowElements[i] = this._createAccessibilityTreeNode();
@@ -263,7 +263,7 @@ export class AccessibilityManager extends Disposable {
const element = this._rowElements[i];
if (element) {
if (lineData.length === 0) {
element.innerHTML = '&nbsp;';
element.innerText = '\u00a0';
} else {
element.textContent = lineData;
}
+2 -14
View File
@@ -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);
}
/**
@@ -101,8 +89,8 @@ export function moveTextAreaUnderMouseCursor(ev: MouseEvent, textarea: HTMLTextA
export function rightClickHandler(ev: MouseEvent, textarea: HTMLTextAreaElement, screenElement: HTMLElement, selectionService: ISelectionService, shouldSelectWord: boolean): void {
moveTextAreaUnderMouseCursor(ev, textarea, screenElement);
if (shouldSelectWord && !selectionService.isClickInSelection(ev)) {
selectionService.selectWordAtCursor(ev);
if (shouldSelectWord) {
selectionService.rightClickSelect(ev);
}
// Get textarea ready to copy from the context menu
+3 -4
View File
@@ -17,9 +17,8 @@ const DEFAULT_SELECTION = {
rgba: 0xFFFFFF4D
};
// An IIFE to generate DEFAULT_ANSI_COLORS. Do not mutate DEFAULT_ANSI_COLORS, instead make a copy
// and mutate that.
export const DEFAULT_ANSI_COLORS = (() => {
// An IIFE to generate DEFAULT_ANSI_COLORS.
export const DEFAULT_ANSI_COLORS = Object.freeze((() => {
const colors = [
// dark:
css.toColor('#2e3436'),
@@ -64,7 +63,7 @@ export const DEFAULT_ANSI_COLORS = (() => {
}
return colors;
})();
})());
/**
* Manages the source of truth for a terminal's colors.
+2 -2
View File
@@ -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();
+7
View File
@@ -125,6 +125,13 @@ export class Linkifier2 extends Disposable implements ILinkifier2 {
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;
}
+205 -140
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { assert, expect } from 'chai';
import { assert } from 'chai';
import { MockViewport, MockCompositionHelper, MockRenderer, TestTerminal } from 'browser/TestUtils.test';
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
import { CellData } from 'common/buffer/CellData';
@@ -11,6 +11,7 @@ import { IBufferService, IUnicodeService } from 'common/services/Services';
import { Linkifier } from 'browser/Linkifier';
import { MockLogService, MockUnicodeService } from 'common/TestUtils.test';
import { IRegisteredLinkMatcher, IMouseZoneManager, IMouseZone } from 'browser/Types';
import { IMarker } from 'common/Types';
const INIT_COLS = 80;
const INIT_ROWS = 24;
@@ -74,7 +75,7 @@ describe('Terminal', () => {
it('should fire a key event after a keypress DOM event', (done) => {
term.onKey(e => {
assert.equal(typeof e.key, 'string');
expect(e.domEvent).to.be.an.instanceof(Object);
assert.equal(e.domEvent instanceof Object, true);
done();
});
const evKeyPress = <KeyboardEvent>{
@@ -88,7 +89,7 @@ describe('Terminal', () => {
it('should fire a key event after a keydown DOM event', (done) => {
term.onKey(e => {
assert.equal(typeof e.key, 'string');
expect(e.domEvent).to.be.an.instanceof(Object);
assert.equal(e.domEvent instanceof Object, true);
done();
});
(<any>term).textarea = { value: '' };
@@ -102,7 +103,6 @@ describe('Terminal', () => {
});
it('should fire the onResize event', (done) => {
term.onResize(e => {
expect(e).to.have.keys(['cols', 'rows']);
assert.equal(typeof e.cols, 'number');
assert.equal(typeof e.rows, 'number');
done();
@@ -723,10 +723,10 @@ describe('Terminal', () => {
for (let i = 0xDC00; i <= 0xDCFF; ++i) {
term.writeSync(high + String.fromCharCode(i));
const tchar = term.buffer.lines.get(0)!.loadCell(0, cell);
expect(tchar.getChars()).eql(high + String.fromCharCode(i));
expect(tchar.getChars().length).eql(2);
expect(tchar.getWidth()).eql(1);
expect(term.buffer.lines.get(0)!.loadCell(1, cell).getChars()).eql('');
assert.equal(tchar.getChars(), high + String.fromCharCode(i));
assert.equal(tchar.getChars().length, 2);
assert.equal(tchar.getWidth(), 1);
assert.equal(term.buffer.lines.get(0)!.loadCell(1, cell).getChars(), '');
term.reset();
}
});
@@ -736,9 +736,9 @@ describe('Terminal', () => {
for (let i = 0xDC00; i <= 0xDCFF; ++i) {
term.buffer.x = term.cols - 1;
term.writeSync(high + String.fromCharCode(i));
expect(term.buffer.lines.get(0)!.loadCell(term.buffer.x - 1, cell).getChars()).eql(high + String.fromCharCode(i));
expect(term.buffer.lines.get(0)!.loadCell(term.buffer.x - 1, cell).getChars().length).eql(2);
expect(term.buffer.lines.get(1)!.loadCell(0, cell).getChars()).eql('');
assert.equal(term.buffer.lines.get(0)!.loadCell(term.buffer.x - 1, cell).getChars(), high + String.fromCharCode(i));
assert.equal(term.buffer.lines.get(0)!.loadCell(term.buffer.x - 1, cell).getChars().length, 2);
assert.equal(term.buffer.lines.get(1)!.loadCell(0, cell).getChars(), '');
term.reset();
}
});
@@ -749,10 +749,10 @@ describe('Terminal', () => {
term.buffer.x = term.cols - 1;
term.writeSync('a' + high + String.fromCharCode(i));
expect(term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell).getChars()).eql('a');
expect(term.buffer.lines.get(1)!.loadCell(0, cell).getChars()).eql(high + String.fromCharCode(i));
expect(term.buffer.lines.get(1)!.loadCell(0, cell).getChars().length).eql(2);
expect(term.buffer.lines.get(1)!.loadCell(1, cell).getChars()).eql('');
assert.equal(term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell).getChars(), 'a');
assert.equal(term.buffer.lines.get(1)!.loadCell(0, cell).getChars(), high + String.fromCharCode(i));
assert.equal(term.buffer.lines.get(1)!.loadCell(0, cell).getChars().length, 2);
assert.equal(term.buffer.lines.get(1)!.loadCell(1, cell).getChars(), '');
term.reset();
}
});
@@ -768,9 +768,9 @@ describe('Terminal', () => {
}
term.writeSync('a' + high + String.fromCharCode(i));
// auto wraparound mode should cut off the rest of the line
expect(term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell).getChars()).eql(high + String.fromCharCode(i));
expect(term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell).getChars().length).eql(2);
expect(term.buffer.lines.get(1)!.loadCell(1, cell).getChars()).eql('');
assert.equal(term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell).getChars(), high + String.fromCharCode(i));
assert.equal(term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell).getChars().length, 2);
assert.equal(term.buffer.lines.get(1)!.loadCell(1, cell).getChars(), '');
term.reset();
}
});
@@ -781,10 +781,10 @@ describe('Terminal', () => {
term.writeSync(high);
term.writeSync(String.fromCharCode(i));
const tchar = term.buffer.lines.get(0)!.loadCell(0, cell);
expect(tchar.getChars()).eql(high + String.fromCharCode(i));
expect(tchar.getChars().length).eql(2);
expect(tchar.getWidth()).eql(1);
expect(term.buffer.lines.get(0)!.loadCell(1, cell).getChars()).eql('');
assert.equal(tchar.getChars(), high + String.fromCharCode(i));
assert.equal(tchar.getChars().length, 2);
assert.equal(tchar.getWidth(), 1);
assert.equal(term.buffer.lines.get(0)!.loadCell(1, cell).getChars(), '');
term.reset();
}
});
@@ -795,81 +795,81 @@ describe('Terminal', () => {
it('café', () => {
term.writeSync('cafe\u0301');
term.buffer.lines.get(0)!.loadCell(3, cell);
expect(cell.getChars()).eql('e\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), 'e\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 1);
});
it('café - end of line', () => {
term.buffer.x = term.cols - 1 - 3;
term.writeSync('cafe\u0301');
term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell);
expect(cell.getChars()).eql('e\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), 'e\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 1);
term.buffer.lines.get(0)!.loadCell(1, cell);
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 1);
});
it('multiple combined é', () => {
term.writeSync(Array(100).join('e\u0301'));
for (let i = 0; i < term.cols; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
expect(cell.getChars()).eql('e\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), 'e\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 1);
}
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('e\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), 'e\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 1);
});
it('multiple surrogate with combined', () => {
term.writeSync(Array(100).join('\uD800\uDC00\u0301'));
for (let i = 0; i < term.cols; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
expect(cell.getChars()).eql('\uD800\uDC00\u0301');
expect(cell.getChars().length).eql(3);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), '\uD800\uDC00\u0301');
assert.equal(cell.getChars().length, 3);
assert.equal(cell.getWidth(), 1);
}
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('\uD800\uDC00\u0301');
expect(cell.getChars().length).eql(3);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), '\uD800\uDC00\u0301');
assert.equal(cell.getChars().length, 3);
assert.equal(cell.getWidth(), 1);
});
});
describe('unicode - fullwidth characters', () => {
const cell = new CellData();
it('cursor movement even', () => {
expect(term.buffer.x).eql(0);
assert.equal(term.buffer.x, 0);
term.writeSync('¥');
expect(term.buffer.x).eql(2);
assert.equal(term.buffer.x, 2);
});
it('cursor movement odd', () => {
term.buffer.x = 1;
expect(term.buffer.x).eql(1);
assert.equal(term.buffer.x, 1);
term.writeSync('¥');
expect(term.buffer.x).eql(3);
assert.equal(term.buffer.x, 3);
});
it('line of ¥ even', () => {
term.writeSync(Array(50).join('¥'));
for (let i = 0; i < term.cols; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
if (i % 2) {
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(0);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 0);
} else {
expect(cell.getChars()).eql('¥');
expect(cell.getChars().length).eql(1);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥');
assert.equal(cell.getChars().length, 1);
assert.equal(cell.getWidth(), 2);
}
}
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('¥');
expect(cell.getChars().length).eql(1);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥');
assert.equal(cell.getChars().length, 1);
assert.equal(cell.getWidth(), 2);
});
it('line of ¥ odd', () => {
term.buffer.x = 1;
@@ -877,23 +877,23 @@ describe('Terminal', () => {
for (let i = 1; i < term.cols - 1; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
if (!(i % 2)) {
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(0);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 0);
} else {
expect(cell.getChars()).eql('¥');
expect(cell.getChars().length).eql(1);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥');
assert.equal(cell.getChars().length, 1);
assert.equal(cell.getWidth(), 2);
}
}
term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell);
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 1);
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('¥');
expect(cell.getChars().length).eql(1);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥');
assert.equal(cell.getChars().length, 1);
assert.equal(cell.getWidth(), 2);
});
it('line of ¥ with combining odd', () => {
term.buffer.x = 1;
@@ -901,42 +901,42 @@ describe('Terminal', () => {
for (let i = 1; i < term.cols - 1; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
if (!(i % 2)) {
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(0);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 0);
} else {
expect(cell.getChars()).eql('¥\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 2);
}
}
term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell);
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 1);
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('¥\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 2);
});
it('line of ¥ with combining even', () => {
term.writeSync(Array(50).join('¥\u0301'));
for (let i = 0; i < term.cols; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
if (i % 2) {
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(0);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 0);
} else {
expect(cell.getChars()).eql('¥\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 2);
}
}
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('¥\u0301');
expect(cell.getChars().length).eql(2);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '¥\u0301');
assert.equal(cell.getChars().length, 2);
assert.equal(cell.getWidth(), 2);
});
it('line of surrogate fullwidth with combining odd', () => {
term.buffer.x = 1;
@@ -944,42 +944,42 @@ describe('Terminal', () => {
for (let i = 1; i < term.cols - 1; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
if (!(i % 2)) {
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(0);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 0);
} else {
expect(cell.getChars()).eql('\ud843\ude6d\u0301');
expect(cell.getChars().length).eql(3);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '\ud843\ude6d\u0301');
assert.equal(cell.getChars().length, 3);
assert.equal(cell.getWidth(), 2);
}
}
term.buffer.lines.get(0)!.loadCell(term.cols - 1, cell);
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(1);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 1);
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('\ud843\ude6d\u0301');
expect(cell.getChars().length).eql(3);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '\ud843\ude6d\u0301');
assert.equal(cell.getChars().length, 3);
assert.equal(cell.getWidth(), 2);
});
it('line of surrogate fullwidth with combining even', () => {
term.writeSync(Array(50).join('\ud843\ude6d\u0301'));
for (let i = 0; i < term.cols; ++i) {
term.buffer.lines.get(0)!.loadCell(i, cell);
if (i % 2) {
expect(cell.getChars()).eql('');
expect(cell.getChars().length).eql(0);
expect(cell.getWidth()).eql(0);
assert.equal(cell.getChars(), '');
assert.equal(cell.getChars().length, 0);
assert.equal(cell.getWidth(), 0);
} else {
expect(cell.getChars()).eql('\ud843\ude6d\u0301');
expect(cell.getChars().length).eql(3);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '\ud843\ude6d\u0301');
assert.equal(cell.getChars().length, 3);
assert.equal(cell.getWidth(), 2);
}
}
term.buffer.lines.get(1)!.loadCell(0, cell);
expect(cell.getChars()).eql('\ud843\ude6d\u0301');
expect(cell.getChars().length).eql(3);
expect(cell.getWidth()).eql(2);
assert.equal(cell.getChars(), '\ud843\ude6d\u0301');
assert.equal(cell.getChars().length, 3);
assert.equal(cell.getWidth(), 2);
});
});
@@ -991,11 +991,11 @@ describe('Terminal', () => {
term.buffer.y = 0;
term.write('\x1b[4h');
term.writeSync('abcde');
expect(term.buffer.lines.get(0)!.length).eql(term.cols);
expect(term.buffer.lines.get(0)!.loadCell(10, cell).getChars()).eql('a');
expect(term.buffer.lines.get(0)!.loadCell(14, cell).getChars()).eql('e');
expect(term.buffer.lines.get(0)!.loadCell(15, cell).getChars()).eql('0');
expect(term.buffer.lines.get(0)!.loadCell(79, cell).getChars()).eql('4');
assert.equal(term.buffer.lines.get(0)!.length, term.cols);
assert.equal(term.buffer.lines.get(0)!.loadCell(10, cell).getChars(), 'a');
assert.equal(term.buffer.lines.get(0)!.loadCell(14, cell).getChars(), 'e');
assert.equal(term.buffer.lines.get(0)!.loadCell(15, cell).getChars(), '0');
assert.equal(term.buffer.lines.get(0)!.loadCell(79, cell).getChars(), '4');
});
it('fullwidth - insert', () => {
term.writeSync(Array(9).join('0123456789').slice(-80));
@@ -1003,12 +1003,12 @@ describe('Terminal', () => {
term.buffer.y = 0;
term.write('\x1b[4h');
term.writeSync('¥¥¥');
expect(term.buffer.lines.get(0)!.length).eql(term.cols);
expect(term.buffer.lines.get(0)!.loadCell(10, cell).getChars()).eql('¥');
expect(term.buffer.lines.get(0)!.loadCell(11, cell).getChars()).eql('');
expect(term.buffer.lines.get(0)!.loadCell(14, cell).getChars()).eql('¥');
expect(term.buffer.lines.get(0)!.loadCell(15, cell).getChars()).eql('');
expect(term.buffer.lines.get(0)!.loadCell(79, cell).getChars()).eql('3');
assert.equal(term.buffer.lines.get(0)!.length, term.cols);
assert.equal(term.buffer.lines.get(0)!.loadCell(10, cell).getChars(), '¥');
assert.equal(term.buffer.lines.get(0)!.loadCell(11, cell).getChars(), '');
assert.equal(term.buffer.lines.get(0)!.loadCell(14, cell).getChars(), '¥');
assert.equal(term.buffer.lines.get(0)!.loadCell(15, cell).getChars(), '');
assert.equal(term.buffer.lines.get(0)!.loadCell(79, cell).getChars(), '3');
});
it('fullwidth - right border', () => {
term.writeSync(Array(41).join('¥'));
@@ -1016,15 +1016,15 @@ describe('Terminal', () => {
term.buffer.y = 0;
term.write('\x1b[4h');
term.writeSync('a');
expect(term.buffer.lines.get(0)!.length).eql(term.cols);
expect(term.buffer.lines.get(0)!.loadCell(10, cell).getChars()).eql('a');
expect(term.buffer.lines.get(0)!.loadCell(11, cell).getChars()).eql('¥');
expect(term.buffer.lines.get(0)!.loadCell(79, cell).getChars()).eql(''); // fullwidth char got replaced
assert.equal(term.buffer.lines.get(0)!.length, term.cols);
assert.equal(term.buffer.lines.get(0)!.loadCell(10, cell).getChars(), 'a');
assert.equal(term.buffer.lines.get(0)!.loadCell(11, cell).getChars(), '¥');
assert.equal(term.buffer.lines.get(0)!.loadCell(79, cell).getChars(), ''); // fullwidth char got replaced
term.writeSync('b');
expect(term.buffer.lines.get(0)!.length).eql(term.cols);
expect(term.buffer.lines.get(0)!.loadCell(11, cell).getChars()).eql('b');
expect(term.buffer.lines.get(0)!.loadCell(12, cell).getChars()).eql('¥');
expect(term.buffer.lines.get(0)!.loadCell(79, cell).getChars()).eql(''); // empty cell after fullwidth
assert.equal(term.buffer.lines.get(0)!.length, term.cols);
assert.equal(term.buffer.lines.get(0)!.loadCell(11, cell).getChars(), 'b');
assert.equal(term.buffer.lines.get(0)!.loadCell(12, cell).getChars(), '¥');
assert.equal(term.buffer.lines.get(0)!.loadCell(79, cell).getChars(), ''); // empty cell after fullwidth
});
});
@@ -1042,7 +1042,7 @@ describe('Terminal', () => {
linkifier.attachToDom({} as any, mouseZoneManager);
});
function assertLinkifiesInTerminal(rowText: string, linkMatcherRegex: RegExp, links: {x1: number, y1: number, x2: number, y2: number}[], done: MochaDone): void {
function assertLinkifiesInTerminal(rowText: string, linkMatcherRegex: RegExp, links: {x1: number, y1: number, x2: number, y2: number}[], done: Mocha.Done): void {
terminal.writeSync(rowText);
linkifier.registerLinkMatcher(linkMatcherRegex, () => {});
linkifier.linkifyRows();
@@ -1345,7 +1345,7 @@ describe('Terminal', () => {
];
terminal.writeSync(data.join(''));
// brute force test with insane values
expect(() => {
assert.doesNotThrow(() => {
for (let overscan = 0; overscan < 20; ++overscan) {
for (let start = -10; start < 20; ++start) {
for (let end = -10; end < 20; ++end) {
@@ -1356,7 +1356,7 @@ describe('Terminal', () => {
}
}
}
}).to.not.throw();
});
});
});
@@ -1405,18 +1405,18 @@ describe('Terminal', () => {
// not converting
const termNotConverting = new TestTerminal({cols: 15, rows: 10});
termNotConverting.writeSync('Hello\nWorld');
expect(termNotConverting.buffer.lines.get(0)!.translateToString(false)).equals('Hello ');
expect(termNotConverting.buffer.lines.get(1)!.translateToString(false)).equals(' World ');
expect(termNotConverting.buffer.lines.get(0)!.translateToString(true)).equals('Hello');
expect(termNotConverting.buffer.lines.get(1)!.translateToString(true)).equals(' World');
assert.equal(termNotConverting.buffer.lines.get(0)!.translateToString(false), 'Hello ');
assert.equal(termNotConverting.buffer.lines.get(1)!.translateToString(false), ' World ');
assert.equal(termNotConverting.buffer.lines.get(0)!.translateToString(true), 'Hello');
assert.equal(termNotConverting.buffer.lines.get(1)!.translateToString(true), ' World');
// converting
const termConverting = new TestTerminal({cols: 15, rows: 10, convertEol: true});
termConverting.writeSync('Hello\nWorld');
expect(termConverting.buffer.lines.get(0)!.translateToString(false)).equals('Hello ');
expect(termConverting.buffer.lines.get(1)!.translateToString(false)).equals('World ');
expect(termConverting.buffer.lines.get(0)!.translateToString(true)).equals('Hello');
expect(termConverting.buffer.lines.get(1)!.translateToString(true)).equals('World');
assert.equal(termConverting.buffer.lines.get(0)!.translateToString(false), 'Hello ');
assert.equal(termConverting.buffer.lines.get(1)!.translateToString(false), 'World ');
assert.equal(termConverting.buffer.lines.get(0)!.translateToString(true), 'Hello');
assert.equal(termConverting.buffer.lines.get(1)!.translateToString(true), 'World');
});
describe('Terminal InputHandler integration', () => {
function getLines(term: TestTerminal, limit: number = term.rows): string[] {
@@ -1533,6 +1533,71 @@ describe('Terminal', () => {
});
});
});
// FIXME: move to common/CoreTerminal.test once the trimming is moved over
describe('marker lifecycle', () => {
// create a 10x5 terminal with markers on every line
// to test marker lifecycle under various terminal actions
let markers: IMarker[];
let disposeStack: IMarker[];
let term: TestTerminal;
beforeEach(() => {
term = new TestTerminal({});
markers = [];
disposeStack = [];
term.optionsService.setOption('scrollback', 1);
term.resize(10, 5);
markers.push(term.buffers.active.addMarker(term.buffers.active.y));
term.writeSync('\x1b[r0\r\n');
markers.push(term.buffers.active.addMarker(term.buffers.active.y));
term.writeSync('1\r\n');
markers.push(term.buffers.active.addMarker(term.buffers.active.y));
term.writeSync('2\r\n');
markers.push(term.buffers.active.addMarker(term.buffers.active.y));
term.writeSync('3\r\n');
markers.push(term.buffers.active.addMarker(term.buffers.active.y));
term.writeSync('4');
for (let i = 0; i < markers.length; ++i) {
const marker = markers[i];
marker.onDispose(() => disposeStack.push(marker));
}
});
it('initial', () => {
assert.deepEqual(markers.map(m => m.line), [0, 1, 2, 3, 4]);
});
it('should dispose on normal trim off the top', () => {
// moves top line into scrollback
term.writeSync('\n');
assert.deepEqual(disposeStack, []);
// trims first marker
term.writeSync('\n');
assert.deepEqual(disposeStack, [markers[0]]);
// trims second marker
term.writeSync('\n');
assert.deepEqual(disposeStack, [markers[0], markers[1]]);
// trimmed marker objs should be disposed
assert.deepEqual(disposeStack.map(el => el.isDisposed), [true, true]);
assert.deepEqual(disposeStack.map(el => (el as any)._isDisposed), [true, true]);
// trimmed markers should contain line -1
assert.deepEqual(disposeStack.map(el => el.line), [-1, -1]);
});
it('should dispose on DL', () => {
term.writeSync('\x1b[3;1H'); // move cursor to 0, 2
term.writeSync('\x1b[2M'); // delete 2 lines
assert.deepEqual(disposeStack, [markers[2], markers[3]]);
});
it('should dispose on IL', () => {
term.writeSync('\x1b[3;1H'); // move cursor to 0, 2
term.writeSync('\x1b[2L'); // insert 2 lines
assert.deepEqual(disposeStack, [markers[4], markers[3]]);
assert.deepEqual(markers.map(el => el.line), [0, 1, 4, -1, -1]);
});
it('should dispose on resize', () => {
term.resize(10, 2);
assert.deepEqual(disposeStack, [markers[0], markers[1]]);
assert.deepEqual(markers.map(el => el.line), [-1, -1, 0, 1, 2]);
});
});
});
class TestLinkifier extends Linkifier {
+43 -5
View File
@@ -39,7 +39,7 @@ import { MouseZoneManager } from 'browser/MouseZoneManager';
import { AccessibilityManager } from './AccessibilityManager';
import { ITheme, IMarker, IDisposable, ISelectionPosition, ILinkProvider } from 'xterm';
import { DomRenderer } from 'browser/renderer/dom/DomRenderer';
import { IKeyboardEvent, KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions } from 'common/Types';
import { IKeyboardEvent, KeyboardResultType, CoreMouseEventType, CoreMouseButton, CoreMouseAction, ITerminalOptions, IAnsiColorChangeEvent } from 'common/Types';
import { evaluateKeyboardEvent } from 'common/input/Keyboard';
import { EventEmitter, IEvent, forwardEvent } from 'common/EventEmitter';
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
@@ -53,6 +53,7 @@ import { Linkifier2 } from 'browser/Linkifier2';
import { CoreBrowserService } from 'browser/services/CoreBrowserService';
import { CoreTerminal } from 'common/CoreTerminal';
import { ITerminalOptions as IInitializedTerminalOptions } from 'common/services/Services';
import { rgba } from 'browser/Color';
// Let it work inside Node.js for automated testing purposes.
const document: Document = (typeof window !== 'undefined') ? window.document : null as any;
@@ -148,6 +149,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
this.register(this._inputHandler.onRequestReset(() => this.reset()));
this.register(this._inputHandler.onRequestScroll((eraseAttr, isWrapped) => this.scroll(eraseAttr, isWrapped || undefined)));
this.register(this._inputHandler.onRequestWindowsOptionsReport(type => this._reportWindowsOptions(type)));
this.register(this._inputHandler.onAnsiColorChange((event) => this._changeAnsiColor(event)));
this.register(forwardEvent(this._inputHandler.onCursorMove, this._onCursorMove));
this.register(forwardEvent(this._inputHandler.onTitleChange, this._onTitleChange));
this.register(forwardEvent(this._inputHandler.onA11yChar, this._onA11yCharEmitter));
@@ -157,6 +159,19 @@ export class Terminal extends CoreTerminal implements ITerminal {
this.register(this._bufferService.onResize(e => this._afterResize(e.cols, e.rows)));
}
private _changeAnsiColor(event: IAnsiColorChangeEvent): void {
if (!this._colorManager) { return; }
event.colors.forEach(ansiColor => {
const color = rgba.toColor(ansiColor.red, ansiColor.green, ansiColor.blue);
this._colorManager!.colors.ansi[ansiColor.colorIndex] = color;
});
this._renderService?.setColors(this._colorManager!.colors);
this.viewport?.onThemeChange(this._colorManager!.colors);
}
public dispose(): void {
if (this._isDisposed) {
return;
@@ -281,6 +296,25 @@ export class Terminal extends CoreTerminal implements ITerminal {
this._onBlur.fire();
}
private _syncTextArea(): void {
if (!this.textarea || !this.buffer.isCursorInViewport || this._compositionHelper!.isComposing) {
return;
}
const cellHeight = Math.ceil(this._charSizeService!.height * this.optionsService.options.lineHeight);
const cursorTop = this._bufferService.buffer.y * cellHeight;
const cursorLeft = this._bufferService.buffer.x * this._charSizeService!.width;
// Sync the textarea to the exact position of the composition view so the IME knows where the
// text is.
this.textarea.style.left = cursorLeft + 'px';
this.textarea.style.top = cursorTop + 'px';
this.textarea.style.width = this._charSizeService!.width + 'px';
this.textarea.style.height = cellHeight + 'px';
this.textarea.style.lineHeight = cellHeight + 'px';
this.textarea.style.zIndex = '-5';
}
/**
* Initialize default behavior
*/
@@ -352,7 +386,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
throw new Error('Terminal requires a parent element.');
}
if (!document.body.contains(parent)) {
if (!parent.isConnected) {
this._logService.debug('Terminal.open was called on an element that was not attached to the DOM');
}
@@ -364,6 +398,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
this.element.classList.add('terminal');
this.element.classList.add('xterm');
this.element.setAttribute('tabindex', '0');
this.element.setAttribute('role', 'document');
parent.appendChild(this.element);
// Performance: Use a document fragment to build the terminal
@@ -436,7 +471,10 @@ export class Terminal extends CoreTerminal implements ITerminal {
this.register(this._inputHandler.onRequestSyncScrollBar(() => this.viewport!.syncScrollArea()));
this.register(this.viewport);
this.register(this.onCursorMove(() => this._renderService!.onCursorMove()));
this.register(this.onCursorMove(() => {
this._renderService!.onCursorMove();
this._syncTextArea();
}));
this.register(this.onResize(() => this._renderService!.onResize(this.cols, this.rows)));
this.register(this.onBlur(() => this._renderService!.onBlur()));
this.register(this.onFocus(() => this._renderService!.onFocus()));
@@ -756,7 +794,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
if (!this.viewport!.onWheel(ev)) {
return this.cancel(ev);
}
}, { passive: true }));
}, { passive: false }));
this.register(addDisposableDomListener(el, 'touchstart', (ev: TouchEvent) => {
if (this._coreMouseService.areMouseEventsActive) return;
@@ -769,7 +807,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
if (!this.viewport!.onTouchMove(ev)) {
return this.cancel(ev);
}
}, { passive: true }));
}, { passive: false }));
}
+2 -2
View File
@@ -32,7 +32,7 @@ if (os.platform() === 'darwin') {
);
}
// filter skipFilenames
const FILES = TESTFILES.filter(value => SKIP_FILES.indexOf(value.split('/').slice(-1)[0]) === -1);
const FILES = TESTFILES.filter(value => !SKIP_FILES.includes(value.split('/').slice(-1)[0]));
describe('Escape Sequence Files', function(): void {
this.timeout(1000);
@@ -104,7 +104,7 @@ describe('Escape Sequence Files', function(): void {
function formatError(input: string, output: string, expected: string): string {
function addLineNumber(start: number, color: string): (s: string) => string {
let counter = start || 0;
return function(s: string): string {
return (s: string): string => {
counter += 1;
return '\x1b[33m' + (' ' + counter).slice(-2) + color + s;
};
+3
View File
@@ -309,6 +309,9 @@ export class MockViewport implements IViewport {
}
export class MockCompositionHelper implements ICompositionHelper {
public get isComposing(): boolean {
return false;
}
public compositionstart(): void {
throw new Error('Method not implemented.');
}
+2
View File
@@ -87,6 +87,7 @@ export type CustomKeyEventHandler = (event: KeyboardEvent) => boolean;
export type LineData = CharData[];
export interface ICompositionHelper {
readonly isComposing: boolean;
compositionstart(): void;
compositionupdate(ev: CompositionEvent): void;
compositionend(): void;
@@ -274,6 +275,7 @@ interface ILink {
activate(event: MouseEvent, text: string): void;
hover?(event: MouseEvent, text: string): void;
leave?(event: MouseEvent, text: string): void;
dispose?(): void;
}
interface ILinkDecorations {
+15 -11
View File
@@ -22,6 +22,7 @@ export class CompositionHelper {
* IME. This variable determines whether the compositionText should be displayed on the UI.
*/
private _isComposing: boolean;
public get isComposing(): boolean { return this._isComposing; }
/**
* The position within the input textarea's value of the current composition.
@@ -34,6 +35,11 @@ export class CompositionHelper {
*/
private _isSendingComposition: boolean;
/**
* Data already sent due to keydown event.
*/
private _dataAlreadySent: string;
constructor(
private readonly _textarea: HTMLTextAreaElement,
private readonly _compositionView: HTMLElement,
@@ -45,6 +51,7 @@ export class CompositionHelper {
this._isComposing = false;
this._isSendingComposition = false;
this._compositionPosition = { start: 0, end: 0 };
this._dataAlreadySent = '';
}
/**
@@ -54,6 +61,7 @@ export class CompositionHelper {
this._isComposing = true;
this._compositionPosition.start = this._textarea.value.length;
this._compositionView.textContent = '';
this._dataAlreadySent = '';
this._compositionView.classList.add('active');
}
@@ -118,7 +126,6 @@ export class CompositionHelper {
private _finalizeComposition(waitForPropagation: boolean): void {
this._compositionView.classList.remove('active');
this._isComposing = false;
this._clearTextareaPosition();
if (!waitForPropagation) {
// Cancel any delayed composition send requests and send the input immediately.
@@ -147,6 +154,9 @@ export class CompositionHelper {
if (this._isSendingComposition) {
this._isSendingComposition = false;
let input;
// Add length of data already sent due to keydown event,
// otherwise input characters can be duplicated. (Issue #3191)
currentCompositionPosition.start += this._dataAlreadySent.length;
if (this._isComposing) {
// Use the end position to get the string if a new composition has started.
input = this._textarea.value.substring(currentCompositionPosition.start, currentCompositionPosition.end);
@@ -156,7 +166,9 @@ export class CompositionHelper {
// (eg. 2) after a composition character.
input = this._textarea.value.substring(currentCompositionPosition.start);
}
this._coreService.triggerDataEvent(input, true);
if (input.length > 0) {
this._coreService.triggerDataEvent(input, true);
}
}
}, 0);
}
@@ -176,6 +188,7 @@ export class CompositionHelper {
const newValue = this._textarea.value;
const diff = newValue.replace(oldValue, '');
if (diff.length > 0) {
this._dataAlreadySent = diff;
this._coreService.triggerDataEvent(diff, true);
}
}
@@ -218,13 +231,4 @@ export class CompositionHelper {
setTimeout(() => this.updateCompositionElements(true), 0);
}
}
/**
* Clears the textarea's position so that the cursor does not blink on IE.
* @private
*/
private _clearTextareaPosition(): void {
this._textarea.style.left = '';
this._textarea.style.top = '';
}
}
+20 -14
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, IParser, IFunctionIdentifier, ILinkProvider, IUnicodeHandling, IUnicodeVersionProvider } from 'xterm';
import { Terminal as ITerminalApi, ITerminalOptions, IMarker, IDisposable, ILinkMatcherOptions, ITheme, ILocalizableStrings, ITerminalAddon, ISelectionPosition, IBuffer as IBufferApi, IBufferNamespace as IBufferNamespaceApi, IBufferLine as IBufferLineApi, IBufferCell as IBufferCellApi, IParser, IFunctionIdentifier, ILinkProvider, IUnicodeHandling, IUnicodeVersionProvider, FontWeight } from 'xterm';
import { ITerminal } from 'browser/Types';
import { IBufferLine, ICellData } from 'common/Types';
import { IBuffer, IBufferSet } from 'common/buffer/Types';
@@ -13,11 +13,13 @@ import * as Strings from '../LocalizableStrings';
import { IEvent, EventEmitter } from 'common/EventEmitter';
import { AddonManager } from './AddonManager';
import { IParams } from 'common/parser/Types';
import { BufferSet } from 'common/buffer/BufferSet';
export class Terminal implements ITerminalApi {
private _core: ITerminal;
private _addonManager: AddonManager;
private _parser: IParser | undefined;
private _buffer: BufferNamespaceApi | undefined;
constructor(options?: ITerminalOptions) {
this._core = new TerminalCore(options);
@@ -58,7 +60,10 @@ export class Terminal implements ITerminalApi {
public get cols(): number { return this._core.cols; }
public get buffer(): IBufferNamespaceApi {
this._checkProposedApi();
return new BufferNamespaceApi(this._core.buffers);
if (!this._buffer) {
this._buffer = new BufferNamespaceApi(this._core);
}
return this._buffer;
}
public get markers(): ReadonlyArray<IMarker> {
this._checkProposedApi();
@@ -169,19 +174,20 @@ export class Terminal implements ITerminalApi {
public paste(data: string): void {
this._core.paste(data);
}
public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'fontWeight' | 'fontWeightBold' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string;
public getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean;
public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'logLevel' | 'rendererType' | 'termName' | 'wordSeparator'): string;
public getOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell'): boolean;
public getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number;
public getOption(key: 'fontWeight' | 'fontWeightBold'): FontWeight;
public getOption(key: string): any;
public getOption(key: any): any {
return this._core.optionsService.getOption(key);
}
public setOption(key: 'bellSound' | 'fontFamily' | 'termName' | 'wordSeparator', value: string): void;
public setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'): void;
public setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | number): void;
public setOption(key: 'logLevel', value: 'debug' | 'info' | 'warn' | 'error' | 'off'): void;
public setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void;
public setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void;
public setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void;
public setOption(key: 'allowTransparency' | 'altClickMovesCursor' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'visualBell', value: boolean): void;
public setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void;
public setOption(key: 'theme', value: ITheme): void;
public setOption(key: 'cols' | 'rows', value: number): void;
@@ -244,21 +250,21 @@ class BufferNamespaceApi implements IBufferNamespaceApi {
private _onBufferChange = new EventEmitter<IBufferApi>();
public get onBufferChange(): IEvent<IBufferApi> { return this._onBufferChange.event; }
constructor(private _buffers: IBufferSet) {
this._normal = new BufferApiView(this._buffers.normal, 'normal');
this._alternate = new BufferApiView(this._buffers.alt, 'alternate');
this._buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));
constructor(private _core: ITerminal) {
this._normal = new BufferApiView(this._core.buffers.normal, 'normal');
this._alternate = new BufferApiView(this._core.buffers.alt, 'alternate');
this._core.buffers.onBufferActivate(() => this._onBufferChange.fire(this.active));
}
public get active(): IBufferApi {
if (this._buffers.active === this._buffers.normal) { return this.normal; }
if (this._buffers.active === this._buffers.alt) { return this.alternate; }
if (this._core.buffers.active === this._core.buffers.normal) { return this.normal; }
if (this._core.buffers.active === this._core.buffers.alt) { return this.alternate; }
throw new Error('Active buffer is neither normal nor alternate');
}
public get normal(): IBufferApi {
return this._normal.init(this._buffers.normal);
return this._normal.init(this._core.buffers.normal);
}
public get alternate(): IBufferApi {
return this._alternate.init(this._buffers.alt);
return this._alternate.init(this._core.buffers.alt);
}
}
+2 -1
View File
@@ -75,6 +75,7 @@ export class SelectionRenderLayer extends BaseRenderLayer {
// No need to draw the selection
if (viewportCappedStartRow >= this._bufferService.rows || viewportCappedEndRow < 0) {
this._state.ydisp = this._bufferService.buffer.ydisp;
return;
}
@@ -88,7 +89,7 @@ export class SelectionRenderLayer extends BaseRenderLayer {
} else {
// Draw first row
const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;
const startRowEndCol = viewportCappedStartRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;
const startRowEndCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;
this._fillCells(startCol, viewportCappedStartRow, startRowEndCol - startCol, 1);
// Draw middle rows
+1 -1
View File
@@ -26,7 +26,7 @@ export abstract class BaseCharAtlas implements IDisposable {
* Perform any work needed to warm the cache before it can be used. Used by the default
* implementation of warmUp(), and will only be called once.
*/
protected _doWarmUp(): void { }
private _doWarmUp(): void { }
/**
* Called when we start drawing a new frame.
+1 -3
View File
@@ -16,9 +16,7 @@ export function generateConfig(scaledCharWidth: number, scaledCharHeight: number
cursor: undefined,
cursorAccent: undefined,
selection: undefined,
// For the static char atlas, we only use the first 16 colors, but we need all 256 for the
// dynamic character atlas.
ansi: colors.ansi.slice(0, 16)
ansi: colors.ansi
};
return {
devicePixelRatio: window.devicePixelRatio,
+5 -5
View File
@@ -138,7 +138,7 @@ export class DomRenderer extends Disposable implements IRenderer {
` width: ${this.dimensions.actualCellWidth}px` +
`}`;
this._dimensionsStyleElement.innerHTML = styles;
this._dimensionsStyleElement.textContent = styles;
this._selectionContainer.style.height = this._viewportElement.style.height;
this._screenElement.style.width = `${this.dimensions.canvasWidth}px`;
@@ -237,7 +237,7 @@ export class DomRenderer extends Disposable implements IRenderer {
`${this._terminalSelector} .${FG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { color: ${color.opaque(this._colors.background).css}; }` +
`${this._terminalSelector} .${BG_CLASS_PREFIX}${INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`;
this._themeStyleElement.innerHTML = styles;
this._themeStyleElement.textContent = styles;
}
public onDevicePixelRatioChange(): void {
@@ -306,7 +306,7 @@ export class DomRenderer extends Disposable implements IRenderer {
} else {
// Draw first row
const startCol = viewportStartRow === viewportCappedStartRow ? start[0] : 0;
const endCol = viewportCappedStartRow === viewportCappedEndRow ? end[0] : this._bufferService.cols;
const endCol = viewportCappedStartRow === viewportEndRow ? end[0] : this._bufferService.cols;
documentFragment.appendChild(this._createSelectionElement(viewportCappedStartRow, startCol, endCol));
// Draw middle rows
const middleRowsCount = viewportCappedEndRow - viewportCappedStartRow - 1;
@@ -348,7 +348,7 @@ export class DomRenderer extends Disposable implements IRenderer {
public clear(): void {
for (const e of this._rowElements) {
e.innerHTML = '';
e.innerText = '';
}
}
@@ -359,7 +359,7 @@ export class DomRenderer extends Disposable implements IRenderer {
for (let y = start; y <= end; y++) {
const rowElement = this._rowElements[y];
rowElement.innerHTML = '';
rowElement.innerText = '';
const row = y + this._bufferService.buffer.ydisp;
const lineData = this._bufferService.buffer.lines.get(row);
+2 -1
View File
@@ -14,6 +14,7 @@ export class CoreBrowserService implements ICoreBrowserService {
}
public get isFocused(): boolean {
return document.activeElement === this._textarea && document.hasFocus();
const docOrShadowRoot = this._textarea.getRootNode ? this._textarea.getRootNode() as Document | ShadowRoot : document;
return docOrShadowRoot.activeElement === this._textarea && document.hasFocus();
}
}
+13 -3
View File
@@ -51,7 +51,7 @@ export class RenderService extends Disposable implements IRenderService {
private _rowCount: number,
screenElement: HTMLElement,
@IOptionsService optionsService: IOptionsService,
@ICharSizeService charSizeService: ICharSizeService,
@ICharSizeService private readonly _charSizeService: ICharSizeService,
@IBufferService bufferService: IBufferService
) {
super();
@@ -67,7 +67,7 @@ export class RenderService extends Disposable implements IRenderService {
this.register(bufferService.onResize(e => this._fullRefresh()));
this.register(optionsService.onOptionChange(() => this._renderer.onOptionsChanged()));
this.register(charSizeService.onCharSizeChange(() => this.onCharSizeChanged()));
this.register(this._charSizeService.onCharSizeChange(() => this.onCharSizeChanged()));
// No need to register this as renderer is explicitly disposed in RenderService.dispose
this._renderer.onRequestRedraw(e => this.refreshRows(e.start, e.end, true));
@@ -86,7 +86,13 @@ export class RenderService extends Disposable implements IRenderService {
}
private _onIntersectionChange(entry: IntersectionObserverEntry): void {
this._isPaused = entry.intersectionRatio === 0;
this._isPaused = entry.isIntersecting === undefined ? (entry.intersectionRatio === 0) : !entry.isIntersecting;
// Terminal was hidden on open
if (!this._isPaused && !this._charSizeService.hasValidSize) {
this._charSizeService.measure();
}
if (!this._isPaused && this._needsFullRefresh) {
this.refreshRows(0, this._rowCount - 1);
this._needsFullRefresh = false;
@@ -168,6 +174,10 @@ export class RenderService extends Disposable implements IRenderService {
}
public onDevicePixelRatioChange(): void {
// Force char size measurement as DomMeasureStrategy(getBoundingClientRect) is not stable
// when devicePixelRatio changes
this._charSizeService.measure();
this._renderer.onDevicePixelRatioChange();
this.refreshRows(0, this._rowCount - 1);
}
+47 -5
View File
@@ -105,6 +105,9 @@ export class SelectionService extends Disposable implements ISelectionService {
private _workCell: CellData = new CellData();
private _mouseDownTimeStamp: number = 0;
private _oldHasSelection: boolean = false;
private _oldSelectionStart: [number, number] | undefined = undefined;
private _oldSelectionEnd: [number, number] | undefined = undefined;
private _onLinuxMouseSelection = this.register(new EventEmitter<string>());
public get onLinuxMouseSelection(): IEvent<string> { return this._onLinuxMouseSelection.event; }
@@ -290,7 +293,7 @@ export class SelectionService extends Disposable implements ISelectionService {
* Checks if the current click was inside the current selection
* @param event The mouse event
*/
public isClickInSelection(event: MouseEvent): boolean {
private _isClickInSelection(event: MouseEvent): boolean {
const coords = this._getMouseBufferCoords(event);
const start = this._model.finalSelectionStart;
const end = this._model.finalSelectionEnd;
@@ -313,7 +316,7 @@ export class SelectionService extends Disposable implements ISelectionService {
* Selects word at the current mouse event coordinates.
* @param event The mouse event.
*/
public selectWordAtCursor(event: MouseEvent): void {
private _selectWordAtCursor(event: MouseEvent): void {
const coords = this._getMouseBufferCoords(event);
if (coords) {
this._selectWordAt(coords, false);
@@ -667,7 +670,7 @@ export class SelectionService extends Disposable implements ISelectionService {
this._removeMouseDownListeners();
if (this.selectionText.length <= 1 && timeElapsed < ALT_CLICK_MOVE_CURSOR_TIME && event.altKey) {
if (this.selectionText.length <= 1 && timeElapsed < ALT_CLICK_MOVE_CURSOR_TIME && event.altKey && this._optionsService.getOption('altClickMovesCursor')) {
if (this._bufferService.buffer.ybase === this._bufferService.buffer.ydisp) {
const coordinates = this._mouseService.getCoords(
event,
@@ -681,11 +684,43 @@ export class SelectionService extends Disposable implements ISelectionService {
this._coreService.triggerDataEvent(sequence, true);
}
}
} else if (this.hasSelection) {
this._onSelectionChange.fire();
} else {
this._fireEventIfSelectionChanged();
}
}
private _fireEventIfSelectionChanged(): void {
const start = this._model.finalSelectionStart;
const end = this._model.finalSelectionEnd;
const hasSelection = !!start && !!end && (start[0] !== end[0] || start[1] !== end[1]);
if (!hasSelection) {
if (this._oldHasSelection) {
this._fireOnSelectionChange(start, end, hasSelection);
}
return;
}
// Sanity check, these should not be undefined as there is a selection
if (!start || !end) {
return;
}
if (!this._oldSelectionStart || !this._oldSelectionEnd || (
start[0] !== this._oldSelectionStart[0] || start[1] !== this._oldSelectionStart[1] ||
end[0] !== this._oldSelectionEnd[0] || end[1] !== this._oldSelectionEnd[1])) {
this._fireOnSelectionChange(start, end, hasSelection);
}
}
private _fireOnSelectionChange(start: [number, number] | undefined, end: [number, number] | undefined, hasSelection: boolean): void {
this._oldSelectionStart = start;
this._oldSelectionEnd = end;
this._oldHasSelection = hasSelection;
this._onSelectionChange.fire();
}
private _onBufferActivate(e: {activeBuffer: IBuffer, inactiveBuffer: IBuffer}): void {
this.clearSelection();
// Only adjust the selection on trim, shiftElements is rarely used (only in
@@ -727,6 +762,13 @@ export class SelectionService extends Disposable implements ISelectionService {
this.refresh();
}
public rightClickSelect(ev: MouseEvent): void {
if (!this._isClickInSelection(ev)) {
this._selectWordAtCursor(ev);
this._fireEventIfSelectionChanged();
}
}
/**
* Gets positional information for the word at the coordinated specified.
* @param coords The coordinates to get the word at.
+1 -2
View File
@@ -91,8 +91,7 @@ export interface ISelectionService {
selectAll(): void;
selectLines(start: number, end: number): void;
clearSelection(): void;
isClickInSelection(event: MouseEvent): boolean;
selectWordAtCursor(event: MouseEvent): void;
rightClickSelect(event: MouseEvent): void;
shouldColumnSelect(event: KeyboardEvent | MouseEvent): boolean;
shouldForceSelection(event: MouseEvent): boolean;
refresh(isLinuxMouseSelection?: boolean): void;
+1
View File
@@ -4,6 +4,7 @@
"lib": [
"dom",
"es2015",
"es2016.Array.Include"
],
"outDir": "../../out",
"types": [
+4
View File
@@ -158,6 +158,7 @@ export class CircularList<T> implements ICircularList<T> {
this._array[this._getCyclicIndex(i)] = this._array[this._getCyclicIndex(i + deleteCount)];
}
this._length -= deleteCount;
this.onDeleteEmitter.fire({index: start, amount: deleteCount});
}
// Add items
@@ -167,6 +168,9 @@ export class CircularList<T> implements ICircularList<T> {
for (let i = 0; i < items.length; i++) {
this._array[this._getCyclicIndex(start + i)] = items[i];
}
if (items.length) {
this.onInsertEmitter.fire({index: start, amount: items.length});
}
// Adjust length as needed
if (this._length + items.length > this._maxLength) {
+2 -2
View File
@@ -3,7 +3,7 @@
* @license MIT
*/
import { assert, expect } from 'chai';
import { assert } from 'chai';
import { clone } from 'common/Clone';
describe('clone', () => {
@@ -124,6 +124,6 @@ describe('clone', () => {
test.a.b.c = test;
expect(() => clone(test)).to.not.throw();
assert.doesNotThrow(() => clone(test));
});
});
+151 -53
View File
@@ -3,9 +3,9 @@
* @license MIT
*/
import { assert, expect } from 'chai';
import { assert } from 'chai';
import { InputHandler } from 'common/InputHandler';
import { IBufferLine, IAttributeData } from 'common/Types';
import { IBufferLine, IAttributeData, IAnsiColorChangeEvent } from 'common/Types';
import { DEFAULT_ATTR_DATA } from 'common/buffer/BufferLine';
import { CellData } from 'common/buffer/CellData';
import { Attributes, UnderlineStyle } from 'common/buffer/Constants';
@@ -40,6 +40,7 @@ class TestInputHandler extends InputHandler {
public get curAttrData(): IAttributeData { return (this as any)._curAttrData; }
public get windowTitleStack(): string[] { return this._windowTitleStack; }
public get iconNameStack(): string[] { return this._iconNameStack; }
public parseAnsiColorChange(data: string): IAnsiColorChangeEvent | null { return this._parseAnsiColorChange(data); }
}
describe('InputHandler', () => {
@@ -135,7 +136,16 @@ describe('InputHandler', () => {
it('insertChars', function(): void {
const bufferService = new MockBufferService(80, 30);
const inputHandler = new InputHandler(bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService());
const inputHandler = new TestInputHandler(
bufferService,
new MockCharsetService(),
new MockCoreService(),
new MockDirtyRowService(),
new MockLogService(),
new MockOptionsService(),
new MockCoreMouseService(),
new MockUnicodeService()
);
// insert some data in first and second line
inputHandler.parse(Array(bufferService.cols - 9).join('a'));
@@ -143,36 +153,45 @@ describe('InputHandler', () => {
inputHandler.parse(Array(bufferService.cols - 9).join('a'));
inputHandler.parse('1234567890');
const line1: IBufferLine = bufferService.buffer.lines.get(0)!;
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + '1234567890');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + '1234567890');
// insert one char from params = [0]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.insertChars(Params.fromArray([0]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + ' 123456789');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + ' 123456789');
// insert one char from params = [1]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.insertChars(Params.fromArray([1]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + ' 12345678');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + ' 12345678');
// insert two chars from params = [2]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.insertChars(Params.fromArray([2]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + ' 123456');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + ' 123456');
// insert 10 chars from params = [10]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.insertChars(Params.fromArray([10]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + ' ');
expect(line1.translateToString(true)).equals(Array(bufferService.cols - 9).join('a'));
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + ' ');
assert.equal(line1.translateToString(true), Array(bufferService.cols - 9).join('a'));
});
it('deleteChars', function(): void {
const bufferService = new MockBufferService(80, 30);
const inputHandler = new InputHandler(bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService());
const inputHandler = new TestInputHandler(
bufferService,
new MockCharsetService(),
new MockCoreService(),
new MockDirtyRowService(),
new MockLogService(),
new MockOptionsService(),
new MockCoreMouseService(),
new MockUnicodeService()
);
// insert some data in first and second line
inputHandler.parse(Array(bufferService.cols - 9).join('a'));
@@ -180,39 +199,49 @@ describe('InputHandler', () => {
inputHandler.parse(Array(bufferService.cols - 9).join('a'));
inputHandler.parse('1234567890');
const line1: IBufferLine = bufferService.buffer.lines.get(0)!;
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + '1234567890');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + '1234567890');
// delete one char from params = [0]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.deleteChars(Params.fromArray([0]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + '234567890 ');
expect(line1.translateToString(true)).equals(Array(bufferService.cols - 9).join('a') + '234567890');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + '234567890 ');
assert.equal(line1.translateToString(true), Array(bufferService.cols - 9).join('a') + '234567890');
// insert one char from params = [1]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.deleteChars(Params.fromArray([1]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + '34567890 ');
expect(line1.translateToString(true)).equals(Array(bufferService.cols - 9).join('a') + '34567890');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + '34567890 ');
assert.equal(line1.translateToString(true), Array(bufferService.cols - 9).join('a') + '34567890');
// insert two chars from params = [2]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.deleteChars(Params.fromArray([2]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + '567890 ');
expect(line1.translateToString(true)).equals(Array(bufferService.cols - 9).join('a') + '567890');
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + '567890 ');
assert.equal(line1.translateToString(true), Array(bufferService.cols - 9).join('a') + '567890');
// insert 10 chars from params = [10]
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.deleteChars(Params.fromArray([10]));
expect(line1.translateToString(false)).equals(Array(bufferService.cols - 9).join('a') + ' ');
expect(line1.translateToString(true)).equals(Array(bufferService.cols - 9).join('a'));
assert.equal(line1.translateToString(false), Array(bufferService.cols - 9).join('a') + ' ');
assert.equal(line1.translateToString(true), Array(bufferService.cols - 9).join('a'));
});
it('eraseInLine', function(): void {
const bufferService = new MockBufferService(80, 30);
const inputHandler = new InputHandler(bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService());
const inputHandler = new TestInputHandler(
bufferService,
new MockCharsetService(),
new MockCoreService(),
new MockDirtyRowService(),
new MockLogService(),
new MockOptionsService(),
new MockCoreMouseService(),
new MockUnicodeService()
);
// fill 6 lines to test 3 different states
inputHandler.parse(Array(bufferService.cols + 1).join('a'));
@@ -223,24 +252,33 @@ describe('InputHandler', () => {
bufferService.buffer.y = 0;
bufferService.buffer.x = 70;
inputHandler.eraseInLine(Params.fromArray([0]));
expect(bufferService.buffer.lines.get(0)!.translateToString(false)).equals(Array(71).join('a') + ' ');
assert.equal(bufferService.buffer.lines.get(0)!.translateToString(false), Array(71).join('a') + ' ');
// params[1] - left erase
bufferService.buffer.y = 1;
bufferService.buffer.x = 70;
inputHandler.eraseInLine(Params.fromArray([1]));
expect(bufferService.buffer.lines.get(1)!.translateToString(false)).equals(Array(71).join(' ') + ' aaaaaaaaa');
assert.equal(bufferService.buffer.lines.get(1)!.translateToString(false), Array(71).join(' ') + ' aaaaaaaaa');
// params[1] - left erase
bufferService.buffer.y = 2;
bufferService.buffer.x = 70;
inputHandler.eraseInLine(Params.fromArray([2]));
expect(bufferService.buffer.lines.get(2)!.translateToString(false)).equals(Array(bufferService.cols + 1).join(' '));
assert.equal(bufferService.buffer.lines.get(2)!.translateToString(false), Array(bufferService.cols + 1).join(' '));
});
it('eraseInDisplay', function(): void {
const bufferService = new MockBufferService(80, 7);
const inputHandler = new InputHandler(bufferService, new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService());
const inputHandler = new TestInputHandler(
bufferService,
new MockCharsetService(),
new MockCoreService(),
new MockDirtyRowService(),
new MockLogService(),
new MockOptionsService(),
new MockCoreMouseService(),
new MockUnicodeService()
);
// fill display with a's
for (let i = 0; i < bufferService.rows; ++i) inputHandler.parse(Array(bufferService.cols + 1).join('a'));
@@ -249,7 +287,7 @@ describe('InputHandler', () => {
bufferService.buffer.y = 5;
bufferService.buffer.x = 40;
inputHandler.eraseInDisplay(Params.fromArray([0]));
expect(termContent(bufferService, false)).eql([
assert.deepEqual(termContent(bufferService, false), [
Array(bufferService.cols + 1).join('a'),
Array(bufferService.cols + 1).join('a'),
Array(bufferService.cols + 1).join('a'),
@@ -258,7 +296,7 @@ describe('InputHandler', () => {
Array(40 + 1).join('a') + Array(bufferService.cols - 40 + 1).join(' '),
Array(bufferService.cols + 1).join(' ')
]);
expect(termContent(bufferService, true)).eql([
assert.deepEqual(termContent(bufferService, true), [
Array(bufferService.cols + 1).join('a'),
Array(bufferService.cols + 1).join('a'),
Array(bufferService.cols + 1).join('a'),
@@ -277,7 +315,7 @@ describe('InputHandler', () => {
bufferService.buffer.y = 5;
bufferService.buffer.x = 40;
inputHandler.eraseInDisplay(Params.fromArray([1]));
expect(termContent(bufferService, false)).eql([
assert.deepEqual(termContent(bufferService, false), [
Array(bufferService.cols + 1).join(' '),
Array(bufferService.cols + 1).join(' '),
Array(bufferService.cols + 1).join(' '),
@@ -286,7 +324,7 @@ describe('InputHandler', () => {
Array(41 + 1).join(' ') + Array(bufferService.cols - 41 + 1).join('a'),
Array(bufferService.cols + 1).join('a')
]);
expect(termContent(bufferService, true)).eql([
assert.deepEqual(termContent(bufferService, true), [
'',
'',
'',
@@ -305,7 +343,7 @@ describe('InputHandler', () => {
bufferService.buffer.y = 5;
bufferService.buffer.x = 40;
inputHandler.eraseInDisplay(Params.fromArray([2]));
expect(termContent(bufferService, false)).eql([
assert.deepEqual(termContent(bufferService, false), [
Array(bufferService.cols + 1).join(' '),
Array(bufferService.cols + 1).join(' '),
Array(bufferService.cols + 1).join(' '),
@@ -314,7 +352,7 @@ describe('InputHandler', () => {
Array(bufferService.cols + 1).join(' '),
Array(bufferService.cols + 1).join(' ')
]);
expect(termContent(bufferService, true)).eql([
assert.deepEqual(termContent(bufferService, true), [
'',
'',
'',
@@ -333,11 +371,11 @@ describe('InputHandler', () => {
// params[1] left and above with wrap
// confirm precondition that line 2 is wrapped
expect(bufferService.buffer.lines.get(2)!.isWrapped).true;
assert.equal(bufferService.buffer.lines.get(2)!.isWrapped, true);
bufferService.buffer.y = 2;
bufferService.buffer.x = 40;
inputHandler.eraseInDisplay(Params.fromArray([1]));
expect(bufferService.buffer.lines.get(2)!.isWrapped).false;
assert.equal(bufferService.buffer.lines.get(2)!.isWrapped, false);
// reset and add a wrapped line
bufferService.buffer.y = 0;
@@ -348,16 +386,25 @@ describe('InputHandler', () => {
// params[1] left and above with wrap
// confirm precondition that line 2 is wrapped
expect(bufferService.buffer.lines.get(2)!.isWrapped).true;
assert.equal(bufferService.buffer.lines.get(2)!.isWrapped, true);
bufferService.buffer.y = 1;
bufferService.buffer.x = 90; // Cursor is beyond last column
inputHandler.eraseInDisplay(Params.fromArray([1]));
expect(bufferService.buffer.lines.get(2)!.isWrapped).false;
assert.equal(bufferService.buffer.lines.get(2)!.isWrapped, false);
});
});
describe('print', () => {
it('should not cause an infinite loop (regression test)', () => {
const inputHandler = new InputHandler(new MockBufferService(80, 30), new MockCharsetService(), new MockCoreService(), new MockDirtyRowService(), new MockLogService(), new MockOptionsService(), new MockCoreMouseService(), new MockUnicodeService());
const inputHandler = new TestInputHandler(
new MockBufferService(80, 30),
new MockCharsetService(),
new MockCoreService(),
new MockDirtyRowService(),
new MockLogService(),
new MockOptionsService(),
new MockCoreMouseService(),
new MockUnicodeService()
);
const container = new Uint32Array(10);
container[0] = 0x200B;
inputHandler.print(container, 0, 1);
@@ -382,48 +429,48 @@ describe('InputHandler', () => {
});
it('should handle DECSET/DECRST 47 (alt screen buffer)', () => {
handler.parse('\x1b[?47h\r\n\x1b[31mJUNK\x1b[?47lTEST');
expect(bufferService.buffer.translateBufferLineToString(0, true)).to.equal('');
expect(bufferService.buffer.translateBufferLineToString(1, true)).to.equal(' TEST');
assert.equal(bufferService.buffer.translateBufferLineToString(0, true), '');
assert.equal(bufferService.buffer.translateBufferLineToString(1, true), ' TEST');
// Text color of 'TEST' should be red
expect((bufferService.buffer.lines.get(1)!.loadCell(4, new CellData()).getFgColor())).to.equal(1);
assert.equal((bufferService.buffer.lines.get(1)!.loadCell(4, new CellData()).getFgColor()), 1);
});
it('should handle DECSET/DECRST 1047 (alt screen buffer)', () => {
handler.parse('\x1b[?1047h\r\n\x1b[31mJUNK\x1b[?1047lTEST');
expect(bufferService.buffer.translateBufferLineToString(0, true)).to.equal('');
expect(bufferService.buffer.translateBufferLineToString(1, true)).to.equal(' TEST');
assert.equal(bufferService.buffer.translateBufferLineToString(0, true), '');
assert.equal(bufferService.buffer.translateBufferLineToString(1, true), ' TEST');
// Text color of 'TEST' should be red
expect((bufferService.buffer.lines.get(1)!.loadCell(4, new CellData()).getFgColor())).to.equal(1);
assert.equal((bufferService.buffer.lines.get(1)!.loadCell(4, new CellData()).getFgColor()), 1);
});
it('should handle DECSET/DECRST 1048 (alt screen cursor)', () => {
handler.parse('\x1b[?1048h\r\n\x1b[31mJUNK\x1b[?1048lTEST');
expect(bufferService.buffer.translateBufferLineToString(0, true)).to.equal('TEST');
expect(bufferService.buffer.translateBufferLineToString(1, true)).to.equal('JUNK');
assert.equal(bufferService.buffer.translateBufferLineToString(0, true), 'TEST');
assert.equal(bufferService.buffer.translateBufferLineToString(1, true), 'JUNK');
// Text color of 'TEST' should be default
expect(bufferService.buffer.lines.get(0)!.loadCell(0, new CellData()).fg).to.equal(DEFAULT_ATTR_DATA.fg);
assert.equal(bufferService.buffer.lines.get(0)!.loadCell(0, new CellData()).fg, DEFAULT_ATTR_DATA.fg);
// Text color of 'JUNK' should be red
expect((bufferService.buffer.lines.get(1)!.loadCell(0, new CellData()).getFgColor())).to.equal(1);
assert.equal((bufferService.buffer.lines.get(1)!.loadCell(0, new CellData()).getFgColor()), 1);
});
it('should handle DECSET/DECRST 1049 (alt screen buffer+cursor)', () => {
handler.parse('\x1b[?1049h\r\n\x1b[31mJUNK\x1b[?1049lTEST');
expect(bufferService.buffer.translateBufferLineToString(0, true)).to.equal('TEST');
expect(bufferService.buffer.translateBufferLineToString(1, true)).to.equal('');
assert.equal(bufferService.buffer.translateBufferLineToString(0, true), 'TEST');
assert.equal(bufferService.buffer.translateBufferLineToString(1, true), '');
// Text color of 'TEST' should be default
expect(bufferService.buffer.lines.get(0)!.loadCell(0, new CellData()).fg).to.equal(DEFAULT_ATTR_DATA.fg);
assert.equal(bufferService.buffer.lines.get(0)!.loadCell(0, new CellData()).fg, DEFAULT_ATTR_DATA.fg);
});
it('should handle DECSET/DECRST 1049 - maintains saved cursor for alt buffer', () => {
handler.parse('\x1b[?1049h\r\n\x1b[31m\x1b[s\x1b[?1049lTEST');
expect(bufferService.buffer.translateBufferLineToString(0, true)).to.equal('TEST');
assert.equal(bufferService.buffer.translateBufferLineToString(0, true), 'TEST');
// Text color of 'TEST' should be default
expect(bufferService.buffer.lines.get(0)!.loadCell(0, new CellData()).fg).to.equal(DEFAULT_ATTR_DATA.fg);
assert.equal(bufferService.buffer.lines.get(0)!.loadCell(0, new CellData()).fg, DEFAULT_ATTR_DATA.fg);
handler.parse('\x1b[?1049h\x1b[uTEST');
expect(bufferService.buffer.translateBufferLineToString(1, true)).to.equal('TEST');
assert.equal(bufferService.buffer.translateBufferLineToString(1, true), 'TEST');
// Text color of 'TEST' should be red
expect((bufferService.buffer.lines.get(1)!.loadCell(0, new CellData()).getFgColor())).to.equal(1);
assert.equal((bufferService.buffer.lines.get(1)!.loadCell(0, new CellData()).getFgColor()), 1);
});
it('should handle DECSET/DECRST 1049 - clears alt buffer with erase attributes', () => {
handler.parse('\x1b[42m\x1b[?1049h');
// Buffer should be filled with green background
expect(bufferService.buffer.lines.get(20)!.loadCell(10, new CellData()).getBgColor()).to.equal(2);
assert.equal(bufferService.buffer.lines.get(20)!.loadCell(10, new CellData()).getBgColor(), 2);
});
});
@@ -1692,4 +1739,55 @@ describe('InputHandler', () => {
assert.equal(coreService.decPrivateModes.origin, false);
});
});
describe('OSC', () => {
it('4: should parse correct Ansi color change data', () => {
// this is testing a private method
const event = inputHandler.parseAnsiColorChange('19;rgb:a1/b2/c3');
assert.isNotNull(event);
assert.deepEqual(event!.colors[0], { colorIndex: 19, red: 0xa1, green: 0xb2, blue: 0xc3 });
}),
it('4: should ignore incorrect Ansi color change data', () => {
// this is testing a private method
assert.isNull(inputHandler.parseAnsiColorChange('17;rgb:a/b/c'));
assert.isNull(inputHandler.parseAnsiColorChange('17;rgb:#aabbcc'));
assert.isNull(inputHandler.parseAnsiColorChange('17;rgba:aa/bb/cc'));
assert.isNull(inputHandler.parseAnsiColorChange('rgb:aa/bb/cc'));
});
it('4: should parse a list of Ansi color changes', () => {
// this is testing a private method
const event = inputHandler.parseAnsiColorChange('19;rgb:a1/b2/c3;17;rgb:00/11/22;255;rgb:01/ef/2d');
assert.isNotNull(event);
assert.equal(event!.colors.length, 3);
assert.deepEqual(event!.colors[0], { colorIndex: 19, red: 0xa1, green: 0xb2, blue: 0xc3 });
assert.deepEqual(event!.colors[1], { colorIndex: 17, red: 0x00, green: 0x11, blue: 0x22 });
assert.deepEqual(event!.colors[2], { colorIndex: 255, red: 0x01, green: 0xef, blue: 0x2d });
});
it('4: should ignore incorrect colors in a list of Ansi color changes', () => {
// this is testing a private method
const event = inputHandler.parseAnsiColorChange('19;rgb:a1/b2/c3;17;rgb:WR/ON/G;255;rgb:01/ef/2d');
assert.equal(event!.colors.length, 2);
assert.deepEqual(event!.colors[0], { colorIndex: 19, red: 0xa1, green: 0xb2, blue: 0xc3 });
assert.deepEqual(event!.colors[1], { colorIndex: 255, red: 0x01, green: 0xef, blue: 0x2d });
});
it('4: should be case insensitive when parsing Ansi color changes', () => {
// this is testing a private method
const event = inputHandler.parseAnsiColorChange('19;rGb:A1/b2/C3');
assert.equal(event!.colors.length, 1);
assert.deepEqual(event!.colors[0], { colorIndex: 19, red: 0xa1, green: 0xb2, blue: 0xc3 });
});
it('4: should fire event on Ansi color change', (done) => {
inputHandler.onAnsiColorChange(e => {
assert.isNotNull(e);
assert.isNotNull(e!.colors);
assert.deepEqual(e!.colors[0], { colorIndex: 17, red: 0x1a, green: 0x2b, blue: 0x3c });
assert.deepEqual(e!.colors[1], { colorIndex: 12, red: 0x11, green: 0x22, blue: 0x33 });
done();
});
inputHandler.parse('\x1b]4;17;rgb:1a/2b/3c;12;rgb:11/22/33\x1b\\');
});
});
});
+286 -172
View File
File diff suppressed because it is too large Load Diff
+3 -12
View File
@@ -17,23 +17,14 @@ const isNode = (typeof navigator === 'undefined') ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;
const platform = (isNode) ? 'node' : navigator.platform;
export const isFirefox = !!~userAgent.indexOf('Firefox');
export const isFirefox = userAgent.includes('Firefox');
export const isSafari = /^((?!chrome|android).)*safari/i.test(userAgent);
// Find the users platform. We use this to interpret the meta key
// and ISO third level shifts.
// http://stackoverflow.com/q/19877924/577598
export const isMac = contains(['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'], platform);
export const isMac = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K'].includes(platform);
export const isIpad = platform === 'iPad';
export const isIphone = platform === 'iPhone';
export const isWindows = contains(['Windows', 'Win16', 'Win32', 'WinCE'], platform);
export const isWindows = ['Windows', 'Win16', 'Win32', 'WinCE'].includes(platform);
export const isLinux = platform.indexOf('Linux') >= 0;
/**
* Return if the given array contains the given element
* @param arr The array to search for the given element.
* @param el The element to look for into the array
*/
function contains(arr: any[], el: any): boolean {
return arr.indexOf(el) >= 0;
}
+16
View File
@@ -183,6 +183,7 @@ export interface IMarker extends IDisposable {
readonly id: number;
readonly isDisposed: boolean;
readonly line: number;
onDispose: IEvent<void>;
}
export interface IModes {
insertMode: boolean;
@@ -327,6 +328,20 @@ export interface IWindowOptions {
setWinLines?: boolean;
}
export interface IAnsiColorChangeEventColor {
colorIndex: number;
red: number;
green: number;
blue: number;
}
/**
* Event fired for OSC 4 command - to change ANSI color based on its index.
*/
export interface IAnsiColorChangeEvent {
colors: IAnsiColorChangeEventColor[];
}
/**
* Calls the parser and handles actions generated by the parser.
*/
@@ -388,6 +403,7 @@ export interface IInputHandler {
/** CSI ' ~ */ deleteColumns(params: IParams): void;
/** OSC 0
OSC 2 */ setTitle(data: string): void;
/** OSC 4 */ setAnsiColor(data: string): void;
/** ESC E */ nextLine(): void;
/** ESC = */ keypadApplicationMode(): void;
/** ESC > */ keypadNumericMode(): void;
+26 -12
View File
@@ -700,7 +700,7 @@ describe('Buffer', () => {
}
const wrappedLines: number[] = [];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -723,7 +723,7 @@ describe('Buffer', () => {
}
const wrappedLines: number[] = [];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -754,7 +754,7 @@ describe('Buffer', () => {
}
const wrappedLines: number[] = [];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -777,7 +777,7 @@ describe('Buffer', () => {
}
const wrappedLines: number[] = [];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -814,7 +814,7 @@ describe('Buffer', () => {
}
const wrappedLines: number[] = [];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -837,7 +837,7 @@ describe('Buffer', () => {
}
const wrappedLines: number[] = [];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -891,7 +891,7 @@ describe('Buffer', () => {
}
const wrappedLines = [1, 3, 5];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -917,7 +917,7 @@ describe('Buffer', () => {
}
const wrappedLines = [1, 3, 5];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -950,7 +950,7 @@ describe('Buffer', () => {
}
const wrappedLines = [11, 13, 15];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -975,7 +975,7 @@ describe('Buffer', () => {
}
const wrappedLines = [11, 13, 15];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -1014,7 +1014,7 @@ describe('Buffer', () => {
}
const wrappedLines = [8, 10, 12];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -1040,7 +1040,7 @@ describe('Buffer', () => {
}
const wrappedLines = [8, 10, 12];
for (let i = 0; i < buffer.lines.length; i++) {
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.indexOf(i) !== -1, `line ${i} isWrapped must equal ${wrappedLines.indexOf(i) !== -1}`);
assert.equal(buffer.lines.get(i)!.isWrapped, wrappedLines.includes(i), `line ${i} isWrapped must equal ${wrappedLines.includes(i)}`);
}
});
});
@@ -1085,6 +1085,20 @@ describe('Buffer', () => {
assert.equal(marker.isDisposed, true);
assert.equal(buffer.markers.length, 0);
});
it('should call onDispose', () => {
const eventStack: string[] = [];
buffer = new Buffer(true, new MockOptionsService({ scrollback: 0 }), bufferService);
buffer.fillViewportRows();
assert.equal(buffer.markers.length, 0);
const marker = buffer.addMarker(0);
marker.onDispose(() => eventStack.push('disposed'));
assert.equal(marker.isDisposed, false);
assert.equal(buffer.markers.length, 1);
buffer.lines.onTrimEmitter.fire(1);
assert.equal(marker.isDisposed, true);
assert.equal(buffer.markers.length, 0);
assert.deepEqual(eventStack, ['disposed']);
});
});
describe ('translateBufferLineToString', () => {
+84 -84
View File
@@ -6,7 +6,7 @@ import { NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE, DEFAULT_ATTR, Content,
import { BufferLine } from 'common/buffer//BufferLine';
import { CellData } from 'common/buffer/CellData';
import { CharData, IBufferLine } from '../Types';
import { assert, expect } from 'chai';
import { assert } from 'chai';
import { AttributeData } from 'common/buffer/AttributeData';
@@ -151,20 +151,20 @@ describe('CellData', () => {
describe('BufferLine', function(): void {
it('ctor', function(): void {
let line: IBufferLine = new TestBufferLine(0);
expect(line.length).equals(0);
expect(line.isWrapped).equals(false);
assert.equal(line.length, 0);
assert.equal(line.isWrapped, false);
line = new TestBufferLine(10);
expect(line.length).equals(10);
expect(line.loadCell(0, new CellData()).getAsCharData()).eql([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
expect(line.isWrapped).equals(false);
assert.equal(line.length, 10);
assert.deepEqual(line.loadCell(0, new CellData()).getAsCharData(), [0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
assert.equal(line.isWrapped, false);
line = new TestBufferLine(10, undefined, true);
expect(line.length).equals(10);
expect(line.loadCell(0, new CellData()).getAsCharData()).eql([0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
expect(line.isWrapped).equals(true);
assert.equal(line.length, 10);
assert.deepEqual(line.loadCell(0, new CellData()).getAsCharData(), [0, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]);
assert.equal(line.isWrapped, true);
line = new TestBufferLine(10, CellData.fromCharData([123, 'a', 456, 'a'.charCodeAt(0)]), true);
expect(line.length).equals(10);
expect(line.loadCell(0, new CellData()).getAsCharData()).eql([123, 'a', 456, 'a'.charCodeAt(0)]);
expect(line.isWrapped).equals(true);
assert.equal(line.length, 10);
assert.deepEqual(line.loadCell(0, new CellData()).getAsCharData(), [123, 'a', 456, 'a'.charCodeAt(0)]);
assert.equal(line.isWrapped, true);
});
it('insertCells', function(): void {
const line = new TestBufferLine(3);
@@ -172,7 +172,7 @@ describe('BufferLine', function(): void {
line.setCell(1, CellData.fromCharData([2, 'b', 0, 'b'.charCodeAt(0)]));
line.setCell(2, CellData.fromCharData([3, 'c', 0, 'c'.charCodeAt(0)]));
line.insertCells(1, 3, CellData.fromCharData([4, 'd', 0, 'd'.charCodeAt(0)]));
expect(line.toArray()).eql([
assert.deepEqual(line.toArray(), [
[1, 'a', 0, 'a'.charCodeAt(0)],
[4, 'd', 0, 'd'.charCodeAt(0)],
[4, 'd', 0, 'd'.charCodeAt(0)]
@@ -186,7 +186,7 @@ describe('BufferLine', function(): void {
line.setCell(3, CellData.fromCharData([4, 'd', 0, 'd'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([5, 'e', 0, 'e'.charCodeAt(0)]));
line.deleteCells(1, 2, CellData.fromCharData([6, 'f', 0, 'f'.charCodeAt(0)]));
expect(line.toArray()).eql([
assert.deepEqual(line.toArray(), [
[1, 'a', 0, 'a'.charCodeAt(0)],
[4, 'd', 0, 'd'.charCodeAt(0)],
[5, 'e', 0, 'e'.charCodeAt(0)],
@@ -202,7 +202,7 @@ describe('BufferLine', function(): void {
line.setCell(3, CellData.fromCharData([4, 'd', 0, 'd'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([5, 'e', 0, 'e'.charCodeAt(0)]));
line.replaceCells(2, 4, CellData.fromCharData([6, 'f', 0, 'f'.charCodeAt(0)]));
expect(line.toArray()).eql([
assert.deepEqual(line.toArray(), [
[1, 'a', 0, 'a'.charCodeAt(0)],
[2, 'b', 0, 'b'.charCodeAt(0)],
[6, 'f', 0, 'f'.charCodeAt(0)],
@@ -218,7 +218,7 @@ describe('BufferLine', function(): void {
line.setCell(3, CellData.fromCharData([4, 'd', 0, 'd'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([5, 'e', 0, 'e'.charCodeAt(0)]));
line.fill(CellData.fromCharData([123, 'z', 0, 'z'.charCodeAt(0)]));
expect(line.toArray()).eql([
assert.deepEqual(line.toArray(), [
[123, 'z', 0, 'z'.charCodeAt(0)],
[123, 'z', 0, 'z'.charCodeAt(0)],
[123, 'z', 0, 'z'.charCodeAt(0)],
@@ -234,9 +234,9 @@ describe('BufferLine', function(): void {
line.setCell(3, CellData.fromCharData([4, 'd', 0, 'd'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([5, 'e', 0, 'e'.charCodeAt(0)]));
const line2 = line.clone();
expect(TestBufferLine.prototype.toArray.apply(line2)).eql(line.toArray());
expect(line2.length).equals(line.length);
expect(line2.isWrapped).equals(line.isWrapped);
assert.deepEqual(TestBufferLine.prototype.toArray.apply(line2), line.toArray());
assert.equal(line2.length, line.length);
assert.equal(line2.isWrapped, line.isWrapped);
});
it('copyFrom', function(): void {
const line = new TestBufferLine(5);
@@ -247,92 +247,92 @@ describe('BufferLine', function(): void {
line.setCell(4, CellData.fromCharData([5, 'e', 0, 'e'.charCodeAt(0)]));
const line2 = new TestBufferLine(5, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]), true);
line2.copyFrom(line);
expect(line2.toArray()).eql(line.toArray());
expect(line2.length).equals(line.length);
expect(line2.isWrapped).equals(line.isWrapped);
assert.deepEqual(line2.toArray(), line.toArray());
assert.equal(line2.length, line.length);
assert.equal(line2.isWrapped, line.isWrapped);
});
it('should support combining chars', function(): void {
// CHAR_DATA_CODE_INDEX resembles current behavior in InputHandler.print
// --> set code to the last charCodeAt value of the string
// Note: needs to be fixed once the string pointer is in place
const line = new TestBufferLine(2, CellData.fromCharData([1, 'e\u0301', 0, '\u0301'.charCodeAt(0)]));
expect(line.toArray()).eql([[1, 'e\u0301', 0, '\u0301'.charCodeAt(0)], [1, 'e\u0301', 0, '\u0301'.charCodeAt(0)]]);
assert.deepEqual(line.toArray(), [[1, 'e\u0301', 0, '\u0301'.charCodeAt(0)], [1, 'e\u0301', 0, '\u0301'.charCodeAt(0)]]);
const line2 = new TestBufferLine(5, CellData.fromCharData([1, 'a', 0, '\u0301'.charCodeAt(0)]), true);
line2.copyFrom(line);
expect(line2.toArray()).eql(line.toArray());
assert.deepEqual(line2.toArray(), line.toArray());
const line3 = line.clone();
expect(TestBufferLine.prototype.toArray.apply(line3)).eql(line.toArray());
assert.deepEqual(TestBufferLine.prototype.toArray.apply(line3), line.toArray());
});
describe('resize', function(): void {
it('enlarge(false)', function(): void {
const line = new TestBufferLine(5, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]), false);
line.resize(10, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]));
expect(line.toArray()).eql((Array(10) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
assert.deepEqual(line.toArray(), (Array(10) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
});
it('enlarge(true)', function(): void {
const line = new TestBufferLine(5, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]), false);
line.resize(10, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]));
expect(line.toArray()).eql((Array(10) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
assert.deepEqual(line.toArray(), (Array(10) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
});
it('shrink(true) - should apply new size', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]), false);
line.resize(5, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]));
expect(line.toArray()).eql((Array(5) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
assert.deepEqual(line.toArray(), (Array(5) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
});
it('shrink to 0 length', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]), false);
line.resize(0, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]));
expect(line.toArray()).eql((Array(0) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
assert.deepEqual(line.toArray(), (Array(0) as any).fill([1, 'a', 0, 'a'.charCodeAt(0)]));
});
it('should remove combining data on replaced cells after shrinking then enlarging', () => {
const line = new TestBufferLine(10, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]), false);
line.set(2, [ 0, '😁', 1, '😁'.charCodeAt(0) ]);
line.set(9, [ 0, '😁', 1, '😁'.charCodeAt(0) ]);
expect(line.translateToString()).eql('aa😁aaaaaa😁');
expect(Object.keys(line.combined).length).eql(2);
assert.equal(line.translateToString(), 'aa😁aaaaaa😁');
assert.equal(Object.keys(line.combined).length, 2);
line.resize(5, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]));
expect(line.translateToString()).eql('aa😁aa');
assert.equal(line.translateToString(), 'aa😁aa');
line.resize(10, CellData.fromCharData([1, 'a', 0, 'a'.charCodeAt(0)]));
expect(line.translateToString()).eql('aa😁aaaaaaa');
expect(Object.keys(line.combined).length).eql(1);
assert.equal(line.translateToString(), 'aa😁aaaaaaa');
assert.equal(Object.keys(line.combined).length, 1);
});
});
describe('getTrimLength', function(): void {
it('empty line', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
expect(line.getTrimmedLength()).equal(0);
assert.equal(line.getTrimmedLength(), 0);
});
it('ASCII', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(2, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
expect(line.getTrimmedLength()).equal(3);
assert.equal(line.getTrimmedLength(), 3);
});
it('surrogate', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(2, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
expect(line.getTrimmedLength()).equal(3);
assert.equal(line.getTrimmedLength(), 3);
});
it('combining', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(2, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
expect(line.getTrimmedLength()).equal(3);
assert.equal(line.getTrimmedLength(), 3);
});
it('fullwidth', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(2, CellData.fromCharData([1, '1', 2, '1'.charCodeAt(0)]));
line.setCell(3, CellData.fromCharData([0, '', 0, 0]));
expect(line.getTrimmedLength()).equal(4); // also counts null cell after fullwidth
assert.equal(line.getTrimmedLength(), 4); // also counts null cell after fullwidth
});
});
describe('translateToString with and w\'o trimming', function(): void {
it('empty line', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
expect(line.translateToString(false)).equal(' ');
expect(line.translateToString(true)).equal('');
assert.equal(line.translateToString(false), ' ');
assert.equal(line.translateToString(true), '');
});
it('ASCII', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
@@ -340,14 +340,14 @@ describe('BufferLine', function(): void {
line.setCell(2, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(5, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
expect(line.translateToString(false)).equal('a a aa ');
expect(line.translateToString(true)).equal('a a aa');
expect(line.translateToString(false, 0, 5)).equal('a a a');
expect(line.translateToString(false, 0, 4)).equal('a a ');
expect(line.translateToString(false, 0, 3)).equal('a a');
expect(line.translateToString(true, 0, 5)).equal('a a a');
expect(line.translateToString(true, 0, 4)).equal('a a ');
expect(line.translateToString(true, 0, 3)).equal('a a');
assert.equal(line.translateToString(false), 'a a aa ');
assert.equal(line.translateToString(true), 'a a aa');
assert.equal(line.translateToString(false, 0, 5), 'a a a');
assert.equal(line.translateToString(false, 0, 4), 'a a ');
assert.equal(line.translateToString(false, 0, 3), 'a a');
assert.equal(line.translateToString(true, 0, 5), 'a a a');
assert.equal(line.translateToString(true, 0, 4), 'a a ');
assert.equal(line.translateToString(true, 0, 3), 'a a');
});
it('surrogate', function(): void {
@@ -356,14 +356,14 @@ describe('BufferLine', function(): void {
line.setCell(2, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
line.setCell(5, CellData.fromCharData([1, '𝄞', 1, '𝄞'.charCodeAt(0)]));
expect(line.translateToString(false)).equal('a 𝄞 𝄞𝄞 ');
expect(line.translateToString(true)).equal('a 𝄞 𝄞𝄞');
expect(line.translateToString(false, 0, 5)).equal('a 𝄞 𝄞');
expect(line.translateToString(false, 0, 4)).equal('a 𝄞 ');
expect(line.translateToString(false, 0, 3)).equal('a 𝄞');
expect(line.translateToString(true, 0, 5)).equal('a 𝄞 𝄞');
expect(line.translateToString(true, 0, 4)).equal('a 𝄞 ');
expect(line.translateToString(true, 0, 3)).equal('a 𝄞');
assert.equal(line.translateToString(false), 'a 𝄞 𝄞𝄞 ');
assert.equal(line.translateToString(true), 'a 𝄞 𝄞𝄞');
assert.equal(line.translateToString(false, 0, 5), 'a 𝄞 𝄞');
assert.equal(line.translateToString(false, 0, 4), 'a 𝄞 ');
assert.equal(line.translateToString(false, 0, 3), 'a 𝄞');
assert.equal(line.translateToString(true, 0, 5), 'a 𝄞 𝄞');
assert.equal(line.translateToString(true, 0, 4), 'a 𝄞 ');
assert.equal(line.translateToString(true, 0, 3), 'a 𝄞');
});
it('combining', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
@@ -371,14 +371,14 @@ describe('BufferLine', function(): void {
line.setCell(2, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
line.setCell(4, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
line.setCell(5, CellData.fromCharData([1, 'e\u0301', 1, '\u0301'.charCodeAt(0)]));
expect(line.translateToString(false)).equal('a e\u0301 e\u0301e\u0301 ');
expect(line.translateToString(true)).equal('a e\u0301 e\u0301e\u0301');
expect(line.translateToString(false, 0, 5)).equal('a e\u0301 e\u0301');
expect(line.translateToString(false, 0, 4)).equal('a e\u0301 ');
expect(line.translateToString(false, 0, 3)).equal('a e\u0301');
expect(line.translateToString(true, 0, 5)).equal('a e\u0301 e\u0301');
expect(line.translateToString(true, 0, 4)).equal('a e\u0301 ');
expect(line.translateToString(true, 0, 3)).equal('a e\u0301');
assert.equal(line.translateToString(false), 'a e\u0301 e\u0301e\u0301 ');
assert.equal(line.translateToString(true), 'a e\u0301 e\u0301e\u0301');
assert.equal(line.translateToString(false, 0, 5), 'a e\u0301 e\u0301');
assert.equal(line.translateToString(false, 0, 4), 'a e\u0301 ');
assert.equal(line.translateToString(false, 0, 3), 'a e\u0301');
assert.equal(line.translateToString(true, 0, 5), 'a e\u0301 e\u0301');
assert.equal(line.translateToString(true, 0, 4), 'a e\u0301 ');
assert.equal(line.translateToString(true, 0, 3), 'a e\u0301');
});
it('fullwidth', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
@@ -389,20 +389,20 @@ describe('BufferLine', function(): void {
line.setCell(6, CellData.fromCharData([0, '', 0, 0]));
line.setCell(7, CellData.fromCharData([1, '1', 2, '1'.charCodeAt(0)]));
line.setCell(8, CellData.fromCharData([0, '', 0, 0]));
expect(line.translateToString(false)).equal('a 1 11 ');
expect(line.translateToString(true)).equal('a 1 11');
expect(line.translateToString(false, 0, 7)).equal('a 1 1');
expect(line.translateToString(false, 0, 6)).equal('a 1 1');
expect(line.translateToString(false, 0, 5)).equal('a 1 ');
expect(line.translateToString(false, 0, 4)).equal('a 1');
expect(line.translateToString(false, 0, 3)).equal('a 1');
expect(line.translateToString(false, 0, 2)).equal('a ');
expect(line.translateToString(true, 0, 7)).equal('a 1 1');
expect(line.translateToString(true, 0, 6)).equal('a 1 1');
expect(line.translateToString(true, 0, 5)).equal('a 1 ');
expect(line.translateToString(true, 0, 4)).equal('a 1');
expect(line.translateToString(true, 0, 3)).equal('a 1');
expect(line.translateToString(true, 0, 2)).equal('a ');
assert.equal(line.translateToString(false), 'a 1 11 ');
assert.equal(line.translateToString(true), 'a 1 11');
assert.equal(line.translateToString(false, 0, 7), 'a 1 1');
assert.equal(line.translateToString(false, 0, 6), 'a 1 1');
assert.equal(line.translateToString(false, 0, 5), 'a 1 ');
assert.equal(line.translateToString(false, 0, 4), 'a 1');
assert.equal(line.translateToString(false, 0, 3), 'a 1');
assert.equal(line.translateToString(false, 0, 2), 'a ');
assert.equal(line.translateToString(true, 0, 7), 'a 1 1');
assert.equal(line.translateToString(true, 0, 6), 'a 1 1');
assert.equal(line.translateToString(true, 0, 5), 'a 1 ');
assert.equal(line.translateToString(true, 0, 4), 'a 1');
assert.equal(line.translateToString(true, 0, 3), 'a 1');
assert.equal(line.translateToString(true, 0, 2), 'a ');
});
it('space at end', function(): void {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, NULL_CELL_WIDTH, NULL_CELL_CODE]), false);
@@ -411,21 +411,21 @@ describe('BufferLine', function(): void {
line.setCell(4, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(5, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
line.setCell(6, CellData.fromCharData([1, ' ', 1, ' '.charCodeAt(0)]));
expect(line.translateToString(false)).equal('a a aa ');
expect(line.translateToString(true)).equal('a a aa ');
assert.equal(line.translateToString(false), 'a a aa ');
assert.equal(line.translateToString(true), 'a a aa ');
});
it('should always return some sane value', function(): void {
// sanity check - broken line with invalid out of bound null width cells
// this can atm happen with deleting/inserting chars in inputhandler by "breaking"
// fullwidth pairs --> needs to be fixed after settling BufferLine impl
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, 0, NULL_CELL_CODE]), false);
expect(line.translateToString(false)).equal(' ');
expect(line.translateToString(true)).equal('');
assert.equal(line.translateToString(false), ' ');
assert.equal(line.translateToString(true), '');
});
it('should work with endCol=0', () => {
const line = new TestBufferLine(10, CellData.fromCharData([DEFAULT_ATTR, NULL_CELL_CHAR, 0, NULL_CELL_CODE]), false);
line.setCell(0, CellData.fromCharData([1, 'a', 1, 'a'.charCodeAt(0)]));
expect(line.translateToString(true, 0, 0)).equal('');
assert.equal(line.translateToString(true, 0, 0), '');
});
});
describe('addCharToCell', () => {
+10 -8
View File
@@ -15,10 +15,9 @@ import { Disposable } from 'common/Lifecycle';
* provides also utilities for working with them.
*/
export class BufferSet extends Disposable implements IBufferSet {
private _normal: Buffer;
private _alt: Buffer;
private _activeBuffer: Buffer;
private _normal!: Buffer;
private _alt!: Buffer;
private _activeBuffer!: Buffer;
private _onBufferActivate = this.register(new EventEmitter<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}>());
public get onBufferActivate(): IEvent<{activeBuffer: IBuffer, inactiveBuffer: IBuffer}> { return this._onBufferActivate.event; }
@@ -28,17 +27,20 @@ export class BufferSet extends Disposable implements IBufferSet {
* @param _terminal - The terminal the BufferSet will belong to
*/
constructor(
optionsService: IOptionsService,
bufferService: IBufferService
private readonly _optionsService: IOptionsService,
private readonly _bufferService: IBufferService
) {
super();
this.reset();
}
this._normal = new Buffer(true, optionsService, bufferService);
public reset(): void {
this._normal = new Buffer(true, this._optionsService, this._bufferService);
this._normal.fillViewportRows();
// The alt buffer should never have scrollback.
// See http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-The-Alternate-Screen-Buffer
this._alt = new Buffer(false, optionsService, bufferService);
this._alt = new Buffer(false, this._optionsService, this._bufferService);
this._activeBuffer = this._normal;
this.setupTabStops();

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