@xterm/xterm 6.1.0-beta.9 → 6.1.0-beta.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +27 -28
  2. package/css/xterm.css +5 -11
  3. package/lib/xterm.js +1 -1
  4. package/lib/xterm.js.map +1 -1
  5. package/lib/xterm.mjs +17 -17
  6. package/lib/xterm.mjs.map +4 -4
  7. package/package.json +26 -19
  8. package/src/browser/AccessibilityManager.ts +4 -1
  9. package/src/browser/CoreBrowserTerminal.ts +49 -8
  10. package/src/browser/OscLinkProvider.ts +1 -1
  11. package/src/browser/Types.ts +4 -1
  12. package/src/browser/Viewport.ts +16 -1
  13. package/src/browser/input/CompositionHelper.ts +10 -1
  14. package/src/browser/public/Terminal.ts +6 -5
  15. package/src/browser/renderer/dom/DomRenderer.ts +74 -3
  16. package/src/browser/renderer/dom/WidthCache.ts +54 -52
  17. package/src/browser/renderer/shared/Constants.ts +7 -0
  18. package/src/browser/renderer/shared/Types.ts +5 -0
  19. package/src/browser/services/MouseService.ts +2 -1
  20. package/src/browser/services/RenderService.ts +9 -5
  21. package/src/browser/services/Services.ts +1 -1
  22. package/src/common/Color.ts +8 -0
  23. package/src/common/CoreTerminal.ts +2 -1
  24. package/src/common/InputHandler.ts +52 -9
  25. package/src/common/Platform.ts +4 -1
  26. package/src/common/Types.ts +1 -1
  27. package/src/common/Version.ts +9 -0
  28. package/src/common/buffer/Buffer.ts +4 -0
  29. package/src/common/buffer/Types.ts +4 -0
  30. package/src/common/data/Charsets.ts +1 -1
  31. package/src/common/input/Keyboard.ts +7 -6
  32. package/src/common/services/CharsetService.ts +4 -0
  33. package/src/common/services/DecorationService.ts +17 -3
  34. package/src/common/services/OptionsService.ts +2 -2
  35. package/src/common/services/Services.ts +6 -1
  36. package/typings/xterm.d.ts +165 -34
package/README.md CHANGED
@@ -1,27 +1,27 @@
1
- # [![xterm.js logo](images/logo-full.png)](https://xtermjs.org)
1
+ # [![xterm.js](images/logo-full.png)](https://xtermjs.org)
2
2
 
3
- Xterm.js is a front-end component written in TypeScript that lets applications bring fully-featured terminals to their users in the browser. It's used by popular projects such as VS Code, Hyper and Theia.
3
+ Xterm.js is a frontend component that enables applications to bring fully-featured terminals to their users in the browser. It's used by popular projects such as [VS Code](https://code.visualstudio.com/) (and its forks), [Tabby](https://tabby.sh/) and [Hyper](https://hyper.is/).
4
4
 
5
5
  ## Features
6
6
 
7
7
  - **Terminal apps just work**: Xterm.js works with most terminal apps such as `bash`, `vim`, and `tmux`, including support for curses-based apps and mouse events.
8
- - **Performant**: Xterm.js is *really* fast, it even includes a GPU-accelerated renderer.
8
+ - **Performant**: Xterm.js is *really* fast and includes an optional GPU-accelerated renderer.
9
9
  - **Rich Unicode support**: Supports CJK, emojis, and IMEs.
10
- - **Self-contained**: Requires zero dependencies to work.
11
- - **Accessible**: Screen reader and minimum contrast ratio support can be turned on.
12
- - **And much more**: Links, theming, addons, well documented API, etc.
10
+ - **Self-contained**: The core library has zero dependencies.
11
+ - **Accessible**: Screen reader mode and minimum contrast ratio support can be turned on.
12
+ - **And much more**: Links, theming, custom glyphs, addons, well documented API, etc.
13
13
 
14
14
  ## What xterm.js is not
15
15
 
16
16
  - Xterm.js is not a terminal application that you can download and use on your computer.
17
- - Xterm.js is not `bash`. Xterm.js can be connected to processes like `bash` and let you interact with them (provide input, receive output).
17
+ - Xterm.js is not `bash`. Xterm.js can be connected to processes like `bash` and let you interact with them (provide input, receive output) through a library like [node-pty](https://github.com/microsoft/node-pty).
18
18
 
19
19
  ## Getting Started
20
20
 
21
- First, you need to install the module, we ship exclusively through [npm](https://www.npmjs.com/), so you need that installed and then add xterm.js as a dependency by running:
21
+ First, you need to install the module. We ship exclusively through [npm](https://www.npmjs.com), so you need that installed and then add [@xterm/xterm](https://www.npmjs.com/package/@xterm/xterm) as a dependency by running:
22
22
 
23
23
  ```bash
24
- npm install @xterm/xterm
24
+ npm install --save @xterm/xterm
25
25
  ```
26
26
 
27
27
  To start using xterm.js on your browser, add the `xterm.js` and `xterm.css` to the head of your HTML page. Then create a `<div id="terminal"></div>` onto which xterm can attach itself. Finally, instantiate the `Terminal` object and then call the `open` function with the DOM object of the `div`.
@@ -54,12 +54,10 @@ import { Terminal } from '@xterm/xterm';
54
54
 
55
55
  ### Addons
56
56
 
57
- ⚠️ *This section describes the new addon format introduced in v3.14.0, see [here](https://github.com/xtermjs/xterm.js/blob/3.14.2/README.md#addons) for the instructions on the old format*
58
-
59
57
  Addons are separate modules that extend the `Terminal` by building on the [xterm.js API](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm.d.ts). To use an addon, you first need to install it in your project:
60
58
 
61
59
  ```bash
62
- npm i -S @xterm/addon-web-links
60
+ npm install --save @xterm/addon-web-links
63
61
  ```
64
62
 
65
63
  Then import the addon, instantiate it and call `Terminal.loadAddon`:
@@ -80,50 +78,51 @@ The xterm.js team maintains the following addons, but anyone can build them:
80
78
  - [`@xterm/addon-clipboard`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-clipboard): Access the browser's clipboard
81
79
  - [`@xterm/addon-fit`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-fit): Fits the terminal to the containing element
82
80
  - [`@xterm/addon-image`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-image): Adds image support
81
+ - [`@xterm/addon-ligatures`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-ligatures): Enables rendering of ligatures
82
+ - [`@xterm/addon-progress`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-progress): Adds support for the progress API (`OSC 9;4`)
83
83
  - [`@xterm/addon-search`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-search): Adds search functionality
84
- - [`@xterm/addon-serialize`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-serialize): Serializes the terminal's buffer to a VT sequences or HTML
84
+ - [`@xterm/addon-serialize`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-serialize): Serializes the terminal's buffer to VT sequences or HTML
85
+ - [`@xterm/addon-unicode-graphemes`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode-graphemes): Enhanced unicode support including grapheme clustering (experimental)
85
86
  - [`@xterm/addon-unicode11`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-unicode11): Updates character widths to their unicode11 values
87
+ - [`@xterm/addon-web-fonts`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-web-fonts): Easily integrate web fonts
86
88
  - [`@xterm/addon-web-links`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-web-links): Adds web link detection and interaction
87
89
  - [`@xterm/addon-webgl`](https://github.com/xtermjs/xterm.js/tree/master/addons/addon-webgl): Renders xterm.js using a `canvas` element's webgl2 context
88
90
 
89
91
  ## Browser Support
90
92
 
91
- 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*.
92
-
93
- 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.
93
+ Since xterm.js is typically implemented as a developer tool, generally only modern evergreen browsers are supported officially. Specifically the latest versions of *Chrome*, *Edge*, *Firefox*, and *Safari*. Xterm.js also 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.
94
94
 
95
95
  ### Node.js Support
96
96
 
97
- We also publish [`xterm-headless`](https://www.npmjs.com/package/xterm-headless) which is a stripped down version of xterm.js that runs in Node.js. An example use case for this is to keep track of a terminal's state where the process is running and using the serialize addon so it can get all state restored upon reconnection.
97
+ We also publish [`xterm-headless`](https://www.npmjs.com/package/xterm-headless) which is a stripped down version of xterm.js that runs headless in Node.js. An example use case for this is to keep track of a terminal's state where the process is running and using the [serialize addon](https://www.npmjs.com/package/@xterm/addon-serialize) so it can get all state restored upon reconnection.
98
98
 
99
99
  ## API
100
100
 
101
101
  The full API for xterm.js is contained within the [TypeScript declaration file](https://github.com/xtermjs/xterm.js/blob/master/typings/xterm.d.ts), use the branch/tag picker in GitHub (`w`) to navigate to the correct version of the API.
102
102
 
103
- Note that some APIs are marked *experimental*, these are added to enable experimentation with new ideas without committing to support it like a normal [semver](https://semver.org/) API. Note that these APIs can change radically between versions, so be sure to read release notes if you plan on using experimental APIs.
103
+ Some APIs may be marked with *experimental*, these are added to enable experimentation with new ideas without committing to support it like a normal [semver](https://semver.org/) API. Note that these APIs can change radically between versions, so be sure to read release notes if you plan on using experimental APIs.
104
104
 
105
105
  ## Releases
106
106
 
107
- Xterm.js follows a monthly release cycle roughly.
108
-
109
- All current and past releases are available on this repo's [Releases page](https://github.com/sourcelair/xterm.js/releases), you can view the [high-level roadmap on the wiki](https://github.com/xtermjs/xterm.js/wiki/Roadmap) and see what we're working on now by looking through [Milestones](https://github.com/sourcelair/xterm.js/milestones).
107
+ Stable releases are done on an as needed basis. All current and past releases are available on this repo's [releases page](https://github.com/sourcelair/xterm.js/releases), you can see what's planned for upcoming releases looking through the repository [milestones](https://github.com/sourcelair/xterm.js/milestones).
110
108
 
111
109
  ### Beta builds
112
110
 
113
- Our CI releases beta builds to npm for every change that goes into master. Install the latest beta build with:
111
+ Beta releases are continuously published off the `master` branch. Install the latest beta build with:
114
112
 
115
113
  ```bash
116
- npm install -S @xterm/xterm@beta
114
+ npm install --save @xterm/xterm@beta
117
115
  ```
118
116
 
119
- These should generally be stable, but some bugs may slip in. We recommend using the beta build primarily to test out new features and to verify bug fixes.
117
+ The principal implementation (VS Code) typically uses the latest or near the latest beta build. Generally they are quite stable but can potentially contain bugs or breaking changes. If stability is very important we recommend using the beta build primarily to test out new features and to verify bug fixes, unless you're tracking what's landing and are comfortable taking that risk.
120
118
 
121
119
  ## Contributing
122
120
 
123
- You can read the [guide on the wiki](https://github.com/xtermjs/xterm.js/wiki/Contributing) to learn how to contribute and set up xterm.js for development.
121
+ Read [CONTRIBUTING.md](https://github.com/xtermjs/xterm.js/blob/master/CONTRIBUTING.md) to learn how to contribute to the project.
124
122
 
125
123
  ## Real-world uses
126
- Xterm.js is used in several world-class applications to provide great terminal experiences.
124
+
125
+ Xterm.js is used in many world-class applications to provide great terminal experiences.
127
126
 
128
127
  - [**SourceLair**](https://www.sourcelair.com/): In-browser IDE that provides its users with fully-featured Linux terminals based on xterm.js.
129
128
  - [**Microsoft Visual Studio Code**](http://code.visualstudio.com/): Modern, versatile, and powerful open source code editor that provides an integrated terminal based on xterm.js.
@@ -232,12 +231,12 @@ Xterm.js is used in several world-class applications to provide great terminal e
232
231
  - [**EmuDevz**](https://afska.github.io/emudevz): A free coding game where players learn how to build an emulator from scratch.
233
232
  - [And much more...](https://github.com/xtermjs/xterm.js/network/dependents?package_id=UGFja2FnZS0xNjYzMjc4OQ%3D%3D)
234
233
 
235
- 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 on our list. Note: Please add any new contributions to the end of the list only.
234
+ 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 on our list. Please add any new contributions to the end of the list.
236
235
 
237
236
  ## License Agreement
238
237
 
239
238
  If you contribute code to this project, you implicitly allow your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work.
240
239
 
241
- Copyright (c) 2017-2022, [The xterm.js authors](https://github.com/xtermjs/xterm.js/graphs/contributors) (MIT License)<br>
240
+ Copyright (c) 2017-2026, [The xterm.js authors](https://github.com/xtermjs/xterm.js/graphs/contributors) (MIT License)<br>
242
241
  Copyright (c) 2014-2017, SourceLair, Private Company ([www.sourcelair.com](https://www.sourcelair.com/home)) (MIT License)<br>
243
242
  Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
package/css/xterm.css CHANGED
@@ -91,8 +91,6 @@
91
91
  }
92
92
 
93
93
  .xterm .xterm-viewport {
94
- /* On OS X this is required in order for the scroll bar to appear fully opaque */
95
- background-color: #000;
96
94
  overflow-y: scroll;
97
95
  cursor: default;
98
96
  position: absolute;
@@ -102,6 +100,11 @@
102
100
  bottom: 0;
103
101
  }
104
102
 
103
+ .xterm:not(.allow-transparency) .xterm-viewport {
104
+ /* On OS X this is required in order for the scroll bar to appear fully opaque */
105
+ background-color: #000;
106
+ }
107
+
105
108
  .xterm .xterm-screen {
106
109
  position: relative;
107
110
  }
@@ -112,15 +115,6 @@
112
115
  top: 0;
113
116
  }
114
117
 
115
- .xterm-char-measure-element {
116
- display: inline-block;
117
- visibility: hidden;
118
- position: absolute;
119
- top: 0;
120
- left: -9999em;
121
- line-height: normal;
122
- }
123
-
124
118
  .xterm.enable-mouse-events {
125
119
  /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
126
120
  cursor: default;