Skip to content

Commit 1d3c196

Browse files
authored
Merge branch 'master' into exception_3602
2 parents a6b0734 + 58b7a4a commit 1d3c196

33 files changed

+265
-133
lines changed

.vscode/tasks.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
{
1212
"type": "npm",
1313
"script": "test",
14-
"group": "test",
14+
"group":{
15+
"kind": "test",
16+
"isDefault": true
17+
},
1518
"problemMatcher": []
1619
},
1720
{

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ Xterm.js is used in several world-class applications to provide great terminal e
185185
- [**gdbgui**](https://github.com/cs01/gdbgui): Browser-based frontend to gdb (gnu debugger)
186186
- [**goormIDE**](https://ide.goorm.io/): Run almost every programming languages with real-time collaboration, live pair programming, and built-in messenger.
187187
- [**FleetDeck**](https://fleetdeck.io): Remote desktop & virtual terminal
188+
- [**OpenSumi**](https://github.com/opensumi/core): A framework helps you quickly build Cloud or Desktop IDE products.
188189
- [And much more...](https://github.com/xtermjs/xterm.js/network/dependents?package_id=UGFja2FnZS0xNjYzMjc4OQ%3D%3D)
189190

190191
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/xterm-addon-ligatures/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"license": "MIT",
3333
"dependencies": {
3434
"font-finder": "^1.1.0",
35-
"font-ligatures": "^1.4.0"
35+
"font-ligatures": "^1.4.1"
3636
},
3737
"devDependencies": {
3838
"@types/sinon": "^5.0.1",

addons/xterm-addon-ligatures/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ font-finder@^1.1.0:
8686
get-system-fonts "^2.0.0"
8787
promise-stream-reader "^1.0.1"
8888

89-
font-ligatures@^1.4.0:
90-
version "1.4.0"
91-
resolved "https://registry.npmjs.org/font-ligatures/-/font-ligatures-1.4.0.tgz#6a7b370d96be1358dddfad67830e82fbfd59e6dc"
92-
integrity sha512-n7DFnnEpJ0NrVoLqZIL4tMGVs+CnFwQc92m80LWyrbgAFO4x234+t2/H9o4eOYA1eh6ta9dZAEEsJAwsBdNezA==
89+
font-ligatures@^1.4.1:
90+
version "1.4.1"
91+
resolved "https://registry.npmjs.org/font-ligatures/-/font-ligatures-1.4.1.tgz#e8c9df7cf6bee80c0cca4a9a578618c7b1f5d8de"
92+
integrity sha512-7W6zlfyhvCqShZ5ReUWqmSd9vBaUudW0Hxis+tqUjtHhsPU+L3Grf8mcZAtCiXHTzorhwdRTId2WeH/88gdFkw==
9393
dependencies:
9494
font-finder "^1.0.3"
9595
lru-cache "^6.0.0"

addons/xterm-addon-web-links/src/WebLinksAddon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const protocolClause = '(https?:\\/\\/)';
1010
const domainCharacterSet = '[\\da-z\\.-]+';
1111
const negatedDomainCharacterSet = '[^\\da-z\\.-]+';
1212
const domainBodyClause = '(' + domainCharacterSet + ')';
13-
const tldClause = '([a-z\\.]{2,6})';
13+
const tldClause = '([a-z\\.]{2,18})';
1414
const ipClause = '((\\d{1,3}\\.){3}\\d{1,3})';
1515
const localHostClause = '(localhost)';
1616
const portClause = '(:\\d{1,5})';

src/browser/MouseZoneManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ export class MouseZoneManager extends Disposable implements IMouseZoneManager {
150150
}
151151

152152
// Restart the tooltip timeout
153-
this._tooltipTimeout = window.setTimeout(() => this._onTooltip(e), this._optionsService.options.linkTooltipHoverDuration);
153+
this._tooltipTimeout = window.setTimeout(() => this._onTooltip(e), this._optionsService.rawOptions.linkTooltipHoverDuration);
154154
}
155155

156156
private _onTooltip(e: MouseEvent): void {

src/browser/Terminal.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
298298
this.viewport?.syncScrollArea();
299299
break;
300300
case 'screenReaderMode':
301-
if (this.optionsService.options.screenReaderMode) {
301+
if (this.optionsService.rawOptions.screenReaderMode) {
302302
if (!this._accessibilityManager && this._renderService) {
303303
this._accessibilityManager = new AccessibilityManager(this, this._renderService);
304304
}
@@ -309,7 +309,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
309309
break;
310310
case 'tabStopWidth': this.buffers.setupTabStops(); break;
311311
case 'theme':
312-
this._setTheme(this.optionsService.options.theme);
312+
this._setTheme(this.optionsService.rawOptions.theme);
313313
break;
314314
}
315315
}
@@ -753,7 +753,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
753753
this.register(this.coreMouseService.onProtocolChange(events => {
754754
// apply global changes on events
755755
if (events) {
756-
if (this.optionsService.options.logLevel === 'debug') {
756+
if (this.optionsService.rawOptions.logLevel === 'debug') {
757757
this._logService.debug('Binding to mouse events:', this.coreMouseService.explainEvents(events));
758758
}
759759
this.element!.classList.add('enable-mouse-events');
@@ -1125,7 +1125,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
11251125
// other listeners. When screen reader mode is enabled, this could cause issues if the event
11261126
// is handled at a higher level, this is a compromise in order to echo keys to the screen
11271127
// reader.
1128-
if (!this.optionsService.options.screenReaderMode) {
1128+
if (!this.optionsService.rawOptions.screenReaderMode) {
11291129
return this.cancel(event, true);
11301130
}
11311131

@@ -1220,7 +1220,7 @@ export class Terminal extends CoreTerminal implements ITerminal {
12201220
protected _inputEvent(ev: InputEvent): boolean {
12211221
// Only support emoji IMEs when screen reader mode is disabled as the event must bubble up to
12221222
// support reading out character input which can doubling up input characters
1223-
if (ev.data && ev.inputType === 'insertText' && !ev.composed && !this.optionsService.options.screenReaderMode) {
1223+
if (ev.data && ev.inputType === 'insertText' && !ev.composed && !this.optionsService.rawOptions.screenReaderMode) {
12241224
if (this._keyPressHandled) {
12251225
return false;
12261226
}

src/browser/Viewport.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export class Viewport extends Disposable implements IViewport {
110110
}
111111

112112
// Update scroll bar width
113-
if (this._optionsService.options.scrollback === 0) {
113+
if (this._optionsService.rawOptions.scrollback === 0) {
114114
this.scrollBarWidth = 0;
115115
} else {
116116
this.scrollBarWidth = (this._viewportElement.offsetWidth - this._scrollArea.offsetWidth) || FALLBACK_SCROLL_BAR_WIDTH;
@@ -153,7 +153,7 @@ export class Viewport extends Disposable implements IViewport {
153153
}
154154

155155
// If the scroll bar visibility changed
156-
if (this._lastHadScrollBar !== (this._optionsService.options.scrollback > 0)) {
156+
if (this._lastHadScrollBar !== (this._optionsService.rawOptions.scrollback > 0)) {
157157
this._refresh(immediate);
158158
}
159159
}
@@ -259,15 +259,15 @@ export class Viewport extends Disposable implements IViewport {
259259
}
260260

261261
private _applyScrollModifier(amount: number, ev: WheelEvent): number {
262-
const modifier = this._optionsService.options.fastScrollModifier;
262+
const modifier = this._optionsService.rawOptions.fastScrollModifier;
263263
// Multiply the scroll speed when the modifier is down
264264
if ((modifier === 'alt' && ev.altKey) ||
265265
(modifier === 'ctrl' && ev.ctrlKey) ||
266266
(modifier === 'shift' && ev.shiftKey)) {
267-
return amount * this._optionsService.options.fastScrollSensitivity * this._optionsService.options.scrollSensitivity;
267+
return amount * this._optionsService.rawOptions.fastScrollSensitivity * this._optionsService.rawOptions.scrollSensitivity;
268268
}
269269

270-
return amount * this._optionsService.options.scrollSensitivity;
270+
return amount * this._optionsService.rawOptions.scrollSensitivity;
271271
}
272272

273273
/**

src/browser/input/CompositionHelper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ export class CompositionHelper {
217217
this._compositionView.style.top = cursorTop + 'px';
218218
this._compositionView.style.height = cellHeight + 'px';
219219
this._compositionView.style.lineHeight = cellHeight + 'px';
220-
this._compositionView.style.fontFamily = this._optionsService.options.fontFamily;
221-
this._compositionView.style.fontSize = this._optionsService.options.fontSize + 'px';
220+
this._compositionView.style.fontFamily = this._optionsService.rawOptions.fontFamily;
221+
this._compositionView.style.fontSize = this._optionsService.rawOptions.fontSize + 'px';
222222
// Sync the textarea to the exact position of the composition view so the IME knows where the
223223
// text is.
224224
const compositionViewBounds = this._compositionView.getBoundingClientRect();

src/browser/public/Terminal.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,21 @@ export class Terminal implements ITerminalApi {
3030
this._core = new TerminalCore(options);
3131
this._addonManager = new AddonManager();
3232

33-
this._publicOptions = {};
33+
this._publicOptions = { ... this._core.options };
34+
const getter = (propName: string): any => {
35+
return this._core.options[propName];
36+
};
37+
const setter = (propName: string, value: any): void => {
38+
this._checkReadonlyOptions(propName);
39+
this._core.options[propName] = value;
40+
};
41+
3442
for (const propName in this._core.options) {
35-
Object.defineProperty(this._publicOptions, propName, {
36-
get: () => {
37-
return this._core.options[propName];
38-
},
39-
set: (value: any) => {
40-
this._checkReadonlyOptions(propName);
41-
this._core.options[propName] = value;
42-
}
43-
});
43+
const desc = {
44+
get: getter.bind(this, propName),
45+
set: setter.bind(this, propName)
46+
};
47+
Object.defineProperty(this._publicOptions, propName, desc);
4448
}
4549
}
4650

@@ -54,7 +58,7 @@ export class Terminal implements ITerminalApi {
5458
}
5559

5660
private _checkProposedApi(): void {
57-
if (!this._core.optionsService.options.allowProposedApi) {
61+
if (!this._core.optionsService.rawOptions.allowProposedApi) {
5862
throw new Error('You must set the allowProposedApi option to true to use proposed API');
5963
}
6064
}

0 commit comments

Comments
 (0)