Skip to content

Commit 26d29ab

Browse files
authored
Merge branch 'master' into master
2 parents 904ddbc + a260f7d commit 26d29ab

67 files changed

Lines changed: 1347 additions & 332 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
"addons/addon-image/src/tsconfig.json",
2424
"addons/addon-image/test/tsconfig.json",
2525
"addons/addon-ligatures/src/tsconfig.json",
26+
"addons/addon-progress/src/tsconfig.json",
27+
"addons/addon-progress/test/tsconfig.json",
2628
"addons/addon-search/src/tsconfig.json",
2729
"addons/addon-search/test/tsconfig.json",
2830
"addons/addon-serialize/src/tsconfig.json",

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
./addons/addon-ligatures/lib/* \
4545
./addons/addon-ligatures/out/* \
4646
./addons/addon-ligatures/out-*/* \
47+
./addons/addon-progress/lib/* \
48+
./addons/addon-progress/out/* \
49+
./addons/addon-progress/out-*/* \
4750
./addons/addon-search/lib/* \
4851
./addons/addon-search/out/* \
4952
./addons/addon-search/out-*/* \
@@ -63,7 +66,7 @@ jobs:
6366
./addons/addon-webgl/out/* \
6467
./addons/addon-webgl/out-*st/*
6568
- name: Upload artifacts
66-
uses: actions/upload-artifact@v3
69+
uses: actions/upload-artifact@v4
6770
with:
6871
name: build-artifacts
6972
path: compressed-build.zip
@@ -105,7 +108,7 @@ jobs:
105108
run: |
106109
yarn --frozen-lockfile
107110
yarn install-addons
108-
- uses: actions/download-artifact@v3
111+
- uses: actions/download-artifact@v4
109112
with:
110113
name: build-artifacts
111114
- name: Unzip artifacts
@@ -147,7 +150,7 @@ jobs:
147150
with:
148151
token: ${{ secrets.GITHUB_TOKEN }}
149152
job: build
150-
- uses: actions/download-artifact@v3
153+
- uses: actions/download-artifact@v4
151154
with:
152155
name: build-artifacts
153156
- name: Unzip artifacts
@@ -167,9 +170,9 @@ jobs:
167170
strategy:
168171
matrix:
169172
node-version: [18] # just one as integration tests are about testing in browser
170-
runs-on: [ubuntu] # macos is flaky
173+
runs-on: [ubuntu-22.04] # macos is flaky
171174
browser: [chromium, firefox, webkit]
172-
runs-on: ${{ matrix.runs-on }}-latest
175+
runs-on: ${{ matrix.runs-on }}
173176
steps:
174177
- uses: actions/checkout@v3
175178
- name: Use Node.js ${{ matrix.node-version }}.x
@@ -188,7 +191,7 @@ jobs:
188191
with:
189192
token: ${{ secrets.GITHUB_TOKEN }}
190193
job: build
191-
- uses: actions/download-artifact@v3
194+
- uses: actions/download-artifact@v4
192195
with:
193196
name: build-artifacts
194197
- name: Unzip artifacts
@@ -212,6 +215,8 @@ jobs:
212215
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-fit
213216
- name: Integration tests (addon-image)
214217
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-image
218+
- name: Integration tests (addon-progress)
219+
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-progress
215220
- name: Integration tests (addon-search)
216221
run: yarn test-integration-${{ matrix.browser }} --workers=50% --forbid-only --suite=addon-search
217222
- name: Integration tests (addon-serialize)
@@ -244,7 +249,7 @@ jobs:
244249
yarn install-addons
245250
- name: Install playwright
246251
run: npx playwright install
247-
- uses: actions/download-artifact@v3
252+
- uses: actions/download-artifact@v4
248253
with:
249254
name: build-artifacts
250255
- name: Unzip artifacts

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ Xterm.js is used in several world-class applications to provide great terminal e
226226
- [**OpenSFTP**](https://opensftp.com): Super beautiful SSH and SFTP integrated workspace client.
227227
- [**balena**](https://www.balena.io/): Balena is a full-stack solution for developing, deploying, updating, and troubleshooting IoT Edge devices. We use xterm.js to manage & debug devices on [balenaCloud](https://www.balena.io/cloud).
228228
- [**Filet Cloud**](https://github.com/fuglaro/filet-cloud): The lean and powerful personal cloud ⛅.
229+
- [**pyTermTk**](https://github.com/ceccopierangiolieugenio/pyTermTk): Python Terminal Toolkit - a Spiced Up Cross Compatible TUI Library 🌶️, use xterm.js for the [HTML5 exporter](https://ceccopierangiolieugenio.github.io/pyTermTk/sandbox/sandbox.html).
230+
- [**ecmaOS**](https://ecmaos.sh): A kernel and suite of applications tying modern web technologies into a browser-based operating system.
231+
- [**LabEx**](https://labex.io): Interactive learning platform with hands-on labs and xterm.js-based online terminals, focused on learn-by-doing approach.
229232
- [And much more...](https://github.com/xtermjs/xterm.js/network/dependents?package_id=UGFja2FnZS0xNjYzMjc4OQ%3D%3D)
230233

231234
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.

addons/addon-fit/typings/addon-fit.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ declare module '@xterm/addon-fit' {
3939
}
4040

4141
/**
42-
* Reprepresents the dimensions of a terminal.
42+
* Represents the dimensions of a terminal.
4343
*/
4444
export interface ITerminalDimensions {
4545
/**

addons/addon-ligatures/src/LigaturesAddon.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ export interface ITerminalAddon {
1515

1616
export class LigaturesAddon implements ITerminalAddon , ILigaturesApi {
1717
private readonly _fallbackLigatures: string[];
18+
private readonly _fontFeatureSettings?: string;
1819

1920
private _terminal: Terminal | undefined;
2021
private _characterJoinerId: number | undefined;
2122

2223
constructor(options?: Partial<ILigatureOptions>) {
24+
// Source: calt set from https://github.com/be5invis/Iosevka?tab=readme-ov-file#ligations
2325
this._fallbackLigatures = (options?.fallbackLigatures || [
2426
'<--', '<---', '<<-', '<-', '->', '->>', '-->', '--->',
2527
'<==', '<===', '<<=', '<=', '=>', '=>>', '==>', '===>', '>=', '>>=',
26-
'<->', '<-->', '<--->', '<---->', '<=>', '<==>', '<===>', '<====>', '-------->',
27-
'<~~', '<~', '~>', '~~>', '::', ':::', '==', '!=', '===', '!==',
28-
':=', ':-', ':+', '<*', '<*>', '*>', '<|', '<|>', '|>', '+:', '-:', '=:', ':>',
29-
'++', '+++', '<!--', '<!---', '<***>'
28+
'<->', '<-->', '<--->', '<---->', '<=>', '<==>', '<===>', '<====>', '::', ':::',
29+
'<~~', '</', '</>', '/>', '~~>', '==', '!=', '/=', '~=', '<>', '===', '!==', '!===',
30+
'<:', ':=', '*=', '*+', '<*', '<*>', '*>', '<|', '<|>', '|>', '+*', '=*', '=:', ':>',
31+
'/*', '*/', '+++', '<!--', '<!---'
3032
]).sort((a, b) => b.length - a.length);
33+
this._fontFeatureSettings = options?.fontFeatureSettings;
3134
}
3235

3336
public activate(terminal: Terminal): void {
@@ -36,7 +39,7 @@ export class LigaturesAddon implements ITerminalAddon , ILigaturesApi {
3639
}
3740
this._terminal = terminal;
3841
this._characterJoinerId = enableLigatures(terminal, this._fallbackLigatures);
39-
terminal.element.style.fontFeatureSettings = '"liga" on, "calt" on';
42+
terminal.element.style.fontFeatureSettings = this._fontFeatureSettings ?? '"calt" on';
4043
}
4144

4245
public dispose(): void {

addons/addon-ligatures/src/Types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55

66
export interface ILigatureOptions {
77
fallbackLigatures: string[];
8+
fontFeatureSettings: string;
89
}

addons/addon-ligatures/typings/addon-ligatures.d.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ declare module '@xterm/addon-ligatures' {
2323
constructor(options?: Partial<ILigatureOptions>);
2424

2525
/**
26-
* Activates the addon
26+
* Activates the addon. Note that if webgl is also being used, that addon
27+
* should be reactivated after ligatures is activated in order to apply
28+
* {@link ILigatureOptions.fontFeatureSettings} to the texture atlas.
29+
*
2730
*
2831
* @param terminal The terminal the addon is being loaded in.
2932
*/
@@ -40,19 +43,28 @@ declare module '@xterm/addon-ligatures' {
4043
*/
4144
export interface ILigatureOptions {
4245
/**
43-
* Fallback ligatures to use when the font access API is either not supported by the browser or
44-
* access is denied. The default set of ligatures is taken from Iosevka's default "calt"
45-
* ligation set: https://typeof.net/Iosevka/
46+
* Fallback ligatures to use when the font access API is either not
47+
* supported by the browser or access is denied. The default set of
48+
* ligatures is taken from Iosevka's default "calt" ligation set:
49+
* https://typeof.net/Iosevka/
4650
*
4751
* ```
4852
* <-- <--- <<- <- -> ->> --> --->
4953
* <== <=== <<= <= => =>> ==> ===> >= >>=
50-
* <-> <--> <---> <----> <=> <==> <===> <====> -------->
51-
* <~~ <~ ~> ~~> :: ::: == != === !==
52-
* := :- :+ <* <*> *> <| <|> |> +: -: =: :>
53-
* ++ +++ <!-- <!--- <***>
54-
* ```
54+
* <-> <--> <---> <----> <=> <==> <===> <====> :: :::
55+
* <~~ </ </> /> ~~> == != /= ~= <> === !== !===
56+
* <: := *= *+ <* <*> *> <| <|> |> +* =* =: :>
57+
* /* <close block comment> +++ <!-- <!---
5558
*/
5659
fallbackLigatures: string[]
60+
61+
/**
62+
* The CSS `font-feature-settings` value to use for enabling ligatures. This
63+
* also supports font variants for example with a value like
64+
* `"calt" on, "ss03"`.
65+
*
66+
* The default value is `"calt" on`.
67+
*/
68+
fontFeatureSettings: string;
5769
}
5870
}

addons/addon-progress/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib
2+
node_modules

addons/addon-progress/.npmignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Blacklist - exclude everything except npm defaults such as LICENSE, etc
2+
*
3+
!*/
4+
5+
# Whitelist - lib/
6+
!lib/**/*.d.ts
7+
8+
!lib/**/*.js
9+
!lib/**/*.js.map
10+
11+
!lib/**/*.mjs
12+
!lib/**/*.mjs.map
13+
14+
!lib/**/*.css
15+
16+
# Whitelist - src/
17+
!src/**/*.ts
18+
!src/**/*.d.ts
19+
20+
!src/**/*.js
21+
!src/**/*.js.map
22+
23+
!src/**/*.css
24+
25+
# Blacklist - src/ test files
26+
src/**/*.test.ts
27+
src/**/*.test.d.ts
28+
src/**/*.test.js
29+
src/**/*.test.js.map
30+
31+
# Whitelist - typings/
32+
!typings/*.d.ts

addons/addon-progress/LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2024, The xterm.js authors (https://github.com/xtermjs/xterm.js)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

0 commit comments

Comments
 (0)