Skip to content

Commit 6f6ce33

Browse files
committed
Merge branch 'master' into progress-addon
2 parents 8101132 + 0692d48 commit 6f6ce33

26 files changed

+218
-163
lines changed

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
}
File renamed without changes.

src/browser/renderer/shared/CharAtlasCache.ts renamed to addons/addon-webgl/src/CharAtlasCache.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
* @license MIT
44
*/
55

6-
import { TextureAtlas } from 'browser/renderer/shared/TextureAtlas';
6+
import { TextureAtlas } from './TextureAtlas';
77
import { ITerminalOptions, Terminal } from '@xterm/xterm';
88
import { ITerminal, ReadonlyColorSet } from 'browser/Types';
9-
import { ICharAtlasConfig, ITextureAtlas } from 'browser/renderer/shared/Types';
10-
import { generateConfig, configEquals } from 'browser/renderer/shared/CharAtlasUtils';
9+
import { ICharAtlasConfig, ITextureAtlas } from './Types';
10+
import { generateConfig, configEquals } from './CharAtlasUtils';
1111

1212
interface ITextureAtlasCacheEntry {
1313
atlas: ITextureAtlas;
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright (c) 2017 The xterm.js authors. All rights reserved.
3+
* @license MIT
4+
*/
5+
6+
import { isFirefox, isLegacyEdge } from 'common/Platform';
7+
8+
export const DIM_OPACITY = 0.5;
9+
// The text baseline is set conditionally by browser. Using 'ideographic' for Firefox or Legacy Edge
10+
// would result in truncated text (Issue 3353). Using 'bottom' for Chrome would result in slightly
11+
// unaligned Powerline fonts (PR 3356#issuecomment-850928179).
12+
export const TEXT_BASELINE: CanvasTextBaseline = isFirefox || isLegacyEdge ? 'bottom' : 'ideographic';
File renamed without changes.

0 commit comments

Comments
 (0)