@xterm/xterm 5.6.0-beta.70 → 5.6.0-beta.72
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.
- package/lib/xterm.js +1 -1
- package/lib/xterm.js.map +1 -1
- package/lib/xterm.mjs +9 -9
- package/lib/xterm.mjs.map +3 -3
- package/package.json +2 -2
- package/src/browser/services/ThemeService.ts +2 -2
- package/src/common/buffer/Buffer.ts +10 -6
- package/src/common/buffer/BufferReflow.ts +9 -6
- package/src/common/services/OptionsService.ts +1 -0
- package/src/common/services/Services.ts +1 -0
- package/typings/xterm.d.ts +7 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/xterm",
|
|
3
3
|
"description": "Full xterm terminal, in your browser",
|
|
4
|
-
"version": "5.6.0-beta.
|
|
4
|
+
"version": "5.6.0-beta.72",
|
|
5
5
|
"main": "lib/xterm.js",
|
|
6
6
|
"module": "lib/xterm.mjs",
|
|
7
7
|
"style": "css/xterm.css",
|
|
@@ -107,5 +107,5 @@
|
|
|
107
107
|
"ws": "^8.2.3",
|
|
108
108
|
"xterm-benchmark": "^0.3.1"
|
|
109
109
|
},
|
|
110
|
-
"commit": "
|
|
110
|
+
"commit": "318f3dc3786f0cbe5e4f3e45aaacca3c9106e314"
|
|
111
111
|
}
|
|
@@ -82,8 +82,8 @@ export class ThemeService extends Disposable implements IThemeService {
|
|
|
82
82
|
const colors = this._colors;
|
|
83
83
|
colors.foreground = parseColor(theme.foreground, DEFAULT_FOREGROUND);
|
|
84
84
|
colors.background = parseColor(theme.background, DEFAULT_BACKGROUND);
|
|
85
|
-
colors.cursor = parseColor(theme.cursor, DEFAULT_CURSOR);
|
|
86
|
-
colors.cursorAccent = parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT);
|
|
85
|
+
colors.cursor = color.blend(colors.background, parseColor(theme.cursor, DEFAULT_CURSOR));
|
|
86
|
+
colors.cursorAccent = color.blend(colors.background, parseColor(theme.cursorAccent, DEFAULT_CURSOR_ACCENT));
|
|
87
87
|
colors.selectionBackgroundTransparent = parseColor(theme.selectionBackground, DEFAULT_SELECTION);
|
|
88
88
|
colors.selectionBackgroundOpaque = color.blend(colors.background, colors.selectionBackgroundTransparent);
|
|
89
89
|
colors.selectionInactiveBackgroundTransparent = parseColor(theme.selectionInactiveBackground, colors.selectionBackgroundTransparent);
|
|
@@ -315,7 +315,8 @@ export class Buffer implements IBuffer {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
private _reflowLarger(newCols: number, newRows: number): void {
|
|
318
|
-
const
|
|
318
|
+
const reflowCursorLine = this._optionsService.rawOptions.reflowCursorLine;
|
|
319
|
+
const toRemove: number[] = reflowLargerGetLinesToRemove(this.lines, this._cols, newCols, this.ybase + this.y, this.getNullCell(DEFAULT_ATTR_DATA), reflowCursorLine);
|
|
319
320
|
if (toRemove.length > 0) {
|
|
320
321
|
const newLayoutResult = reflowLargerCreateNewLayout(this.lines, toRemove);
|
|
321
322
|
reflowLargerApplyNewLayout(this.lines, newLayoutResult.layout);
|
|
@@ -347,6 +348,7 @@ export class Buffer implements IBuffer {
|
|
|
347
348
|
}
|
|
348
349
|
|
|
349
350
|
private _reflowSmaller(newCols: number, newRows: number): void {
|
|
351
|
+
const reflowCursorLine = this._optionsService.rawOptions.reflowCursorLine;
|
|
350
352
|
const nullCell = this.getNullCell(DEFAULT_ATTR_DATA);
|
|
351
353
|
// Gather all BufferLines that need to be inserted into the Buffer here so that they can be
|
|
352
354
|
// batched up and only committed once
|
|
@@ -367,11 +369,13 @@ export class Buffer implements IBuffer {
|
|
|
367
369
|
wrappedLines.unshift(nextLine);
|
|
368
370
|
}
|
|
369
371
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
if (!reflowCursorLine) {
|
|
373
|
+
// If these lines contain the cursor don't touch them, the program will handle fixing up
|
|
374
|
+
// wrapped lines with the cursor
|
|
375
|
+
const absoluteY = this.ybase + this.y;
|
|
376
|
+
if (absoluteY >= y && absoluteY < y + wrappedLines.length) {
|
|
377
|
+
continue;
|
|
378
|
+
}
|
|
375
379
|
}
|
|
376
380
|
|
|
377
381
|
const lastLineLength = wrappedLines[wrappedLines.length - 1].getTrimmedLength();
|
|
@@ -20,8 +20,9 @@ export interface INewLayoutResult {
|
|
|
20
20
|
* @param newCols The columns after resize.
|
|
21
21
|
* @param bufferAbsoluteY The absolute y position of the cursor (baseY + cursorY).
|
|
22
22
|
* @param nullCell The cell data to use when filling in empty cells.
|
|
23
|
+
* @param reflowCursorLine Whether to reflow the line containing the cursor.
|
|
23
24
|
*/
|
|
24
|
-
export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, oldCols: number, newCols: number, bufferAbsoluteY: number, nullCell: ICellData): number[] {
|
|
25
|
+
export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, oldCols: number, newCols: number, bufferAbsoluteY: number, nullCell: ICellData, reflowCursorLine: boolean): number[] {
|
|
25
26
|
// Gather all BufferLines that need to be removed from the Buffer here so that they can be
|
|
26
27
|
// batched up and only committed once
|
|
27
28
|
const toRemove: number[] = [];
|
|
@@ -41,11 +42,13 @@ export function reflowLargerGetLinesToRemove(lines: CircularList<IBufferLine>, o
|
|
|
41
42
|
nextLine = lines.get(++i) as BufferLine;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
y
|
|
48
|
-
|
|
45
|
+
if (!reflowCursorLine) {
|
|
46
|
+
// If these lines contain the cursor don't touch them, the program will handle fixing up
|
|
47
|
+
// wrapped lines with the cursor
|
|
48
|
+
if (bufferAbsoluteY >= y && bufferAbsoluteY < i) {
|
|
49
|
+
y += wrappedLines.length - 1;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
|
|
51
54
|
// Copy buffer data to new locations
|
|
@@ -237,6 +237,7 @@ export interface ITerminalOptions {
|
|
|
237
237
|
macOptionIsMeta?: boolean;
|
|
238
238
|
macOptionClickForcesSelection?: boolean;
|
|
239
239
|
minimumContrastRatio?: number;
|
|
240
|
+
reflowCursorLine?: boolean;
|
|
240
241
|
rescaleOverlappingGlyphs?: boolean;
|
|
241
242
|
rightClickSelectsWord?: boolean;
|
|
242
243
|
rows?: number;
|
package/typings/xterm.d.ts
CHANGED
|
@@ -213,6 +213,13 @@ declare module '@xterm/xterm' {
|
|
|
213
213
|
*/
|
|
214
214
|
minimumContrastRatio?: number;
|
|
215
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Whether to reflow the line containing the cursor when the terminal is
|
|
218
|
+
* resized. Defaults to false, because shells usually handle this
|
|
219
|
+
* themselves.
|
|
220
|
+
*/
|
|
221
|
+
reflowCursorLine?: boolean;
|
|
222
|
+
|
|
216
223
|
/**
|
|
217
224
|
* Whether to rescale glyphs horizontally that are a single cell wide but
|
|
218
225
|
* have glyphs that would overlap following cell(s). This typically happens
|