Comparing version 3.13.0-beta10 to 3.13.0-beta11
@@ -7,2 +7,3 @@ "use strict"; | ||
var Buffer_1 = require("../Buffer"); | ||
var CharacterJoinerRegistry_1 = require("./CharacterJoinerRegistry"); | ||
var BaseRenderLayer = (function () { | ||
@@ -131,3 +132,3 @@ function BaseRenderLayer(_container, id, zIndex, _alpha, _colors) { | ||
BaseRenderLayer.prototype.drawChars = function (terminal, cell, x, y) { | ||
if (cell.isFgRGB() || cell.isBgRGB()) { | ||
if (cell.isFgRGB() || cell.isBgRGB() || cell instanceof CharacterJoinerRegistry_1.JoinedCellData) { | ||
this._drawUncachedChars(terminal, cell, x, y); | ||
@@ -134,0 +135,0 @@ return; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var BufferLine_1 = require("../BufferLine"); | ||
var Buffer_1 = require("../Buffer"); | ||
var JoinedCellData = (function (_super) { | ||
__extends(JoinedCellData, _super); | ||
function JoinedCellData(firstCell, chars, width) { | ||
var _this = _super.call(this) || this; | ||
_this.content = 0; | ||
_this.combinedData = ''; | ||
_this.fg = firstCell.fg; | ||
_this.bg = firstCell.bg; | ||
_this.combinedData = chars; | ||
_this._width = width; | ||
return _this; | ||
} | ||
JoinedCellData.prototype.isCombined = function () { | ||
return 2097152; | ||
}; | ||
JoinedCellData.prototype.getWidth = function () { | ||
return this._width; | ||
}; | ||
JoinedCellData.prototype.getChars = function () { | ||
return this.combinedData; | ||
}; | ||
JoinedCellData.prototype.getCode = function () { | ||
return 0x1FFFFF; | ||
}; | ||
JoinedCellData.prototype.setFromCharData = function (value) { | ||
throw new Error('not implemented'); | ||
}; | ||
JoinedCellData.prototype.getAsCharData = function () { | ||
return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; | ||
}; | ||
return JoinedCellData; | ||
}(BufferLine_1.AttributeData)); | ||
exports.JoinedCellData = JoinedCellData; | ||
var CharacterJoinerRegistry = (function () { | ||
@@ -6,0 +52,0 @@ function CharacterJoinerRegistry(_terminal) { |
@@ -20,2 +20,3 @@ "use strict"; | ||
var BufferLine_1 = require("../BufferLine"); | ||
var CharacterJoinerRegistry_1 = require("./CharacterJoinerRegistry"); | ||
var TextRenderLayer = (function (_super) { | ||
@@ -62,10 +63,3 @@ __extends(TextRenderLayer, _super); | ||
var range = joinedRanges.shift(); | ||
cell = BufferLine_1.CellData.fromCharData([ | ||
0, | ||
line.translateToString(true, range[0], range[1]), | ||
range[1] - range[0], | ||
0xFFFFFF | ||
]); | ||
cell.fg = this._workCell.fg; | ||
cell.bg = this._workCell.bg; | ||
cell = new CharacterJoinerRegistry_1.JoinedCellData(this._workCell, line.translateToString(true, range[0], range[1]), range[1] - range[0]); | ||
lastCharX = range[1] - 1; | ||
@@ -72,0 +66,0 @@ } |
{ | ||
"name": "xterm", | ||
"description": "Full xterm terminal, in your browser", | ||
"version": "3.13.0-beta10", | ||
"version": "3.13.0-beta11", | ||
"main": "lib/public/Terminal.js", | ||
@@ -6,0 +6,0 @@ "types": "typings/xterm.d.ts", |
@@ -159,3 +159,4 @@ # [![xterm.js logo](logo-full.png)](https://xtermjs.org) | ||
- [**CodeInterview.io**](https://codeinterview.io): A coding interview platform in 25+ languages and many web frameworks. Uses xterm.js to provide shell access. | ||
- [**Bastillion**](https://www.bastillion.io): Bastillion is an open-source web-based SSH console that centrally manages administrative access to systems. | ||
- [**Bastillion**](https://www.bastillion.io): Bastillion is an open-source web-based SSH console that centrally manages administrative access to systems. | ||
- [**PHP App Server**](https://github.com/cubiclesoft/php-app-server/): Create lightweight, installable almost-native applications for desktop OSes. ExecTerminal (nicely wraps the xterm.js Terminal), TerminalManager, and RunProcessSDK are self-contained, reusable ES5+ compliant Javascript components. | ||
@@ -162,0 +163,0 @@ [And much more...](https://github.com/xtermjs/xterm.js/network/dependents) |
@@ -13,2 +13,3 @@ /** | ||
import { WHITESPACE_CELL_CHAR, WHITESPACE_CELL_CODE } from '../Buffer'; | ||
import { JoinedCellData } from './CharacterJoinerRegistry'; | ||
@@ -265,3 +266,6 @@ export abstract class BaseRenderLayer implements IRenderLayer { | ||
// skip cache right away if we draw in RGB | ||
if (cell.isFgRGB() || cell.isBgRGB()) { | ||
// Note: to avoid bad runtime JoinedCellData will be skipped | ||
// in the cache handler (atlasDidDraw == false) itself and | ||
// fall through to uncached later down below | ||
if (cell.isFgRGB() || cell.isBgRGB() || cell instanceof JoinedCellData) { | ||
this._drawUncachedChars(terminal, cell, x, y); | ||
@@ -268,0 +272,0 @@ return; |
@@ -1,6 +0,51 @@ | ||
import { ITerminal, IBufferLine } from '../Types'; | ||
import { ITerminal, IBufferLine, ICellData, CharData } from '../Types'; | ||
import { ICharacterJoinerRegistry, ICharacterJoiner } from './Types'; | ||
import { CellData } from '../BufferLine'; | ||
import { CellData, Content, AttributeData } from '../BufferLine'; | ||
import { WHITESPACE_CELL_CHAR } from '../Buffer'; | ||
export class JoinedCellData extends AttributeData implements ICellData { | ||
private _width: number; | ||
// .content carries no meaning for joined CellData, simply nullify it | ||
// thus we have to overload all other .content accessors | ||
public content: number = 0; | ||
public fg: number; | ||
public bg: number; | ||
public combinedData: string = ''; | ||
constructor(firstCell: ICellData, chars: string, width: number) { | ||
super(); | ||
this.fg = firstCell.fg; | ||
this.bg = firstCell.bg; | ||
this.combinedData = chars; | ||
this._width = width; | ||
} | ||
public isCombined(): number { | ||
// always mark joined cell data as combined | ||
return Content.IS_COMBINED_MASK; | ||
} | ||
public getWidth(): number { | ||
return this._width; | ||
} | ||
public getChars(): string { | ||
return this.combinedData; | ||
} | ||
public getCode(): number { | ||
// code always gets the highest possible fake codepoint (read as -1) | ||
// this is needed as code is used by caches as identifier | ||
return 0x1FFFFF; | ||
} | ||
public setFromCharData(value: CharData): void { | ||
throw new Error('not implemented'); | ||
} | ||
public getAsCharData(): CharData { | ||
return [this.fg, this.getChars(), this.getWidth(), this.getCode()]; | ||
} | ||
} | ||
export class CharacterJoinerRegistry implements ICharacterJoinerRegistry { | ||
@@ -7,0 +52,0 @@ |
@@ -12,2 +12,3 @@ /** | ||
import { CellData, AttributeData, Content } from '../BufferLine'; | ||
import { JoinedCellData } from './CharacterJoinerRegistry'; | ||
@@ -93,11 +94,8 @@ /** | ||
// so we get the string and width representing it directly | ||
cell = CellData.fromCharData([ | ||
0, | ||
cell = new JoinedCellData( | ||
this._workCell, | ||
line.translateToString(true, range[0], range[1]), | ||
range[1] - range[0], | ||
0xFFFFFF | ||
]); | ||
// hacky: patch attrs | ||
cell.fg = this._workCell.fg; | ||
cell.bg = this._workCell.bg; | ||
range[1] - range[0] | ||
); | ||
@@ -104,0 +102,0 @@ // Skip over the cells occupied by this range in the loop |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2565983
38730
193