mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge branch 'master' into waiton
This commit is contained in:
@@ -9,6 +9,7 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js 18.x
|
||||
@@ -55,6 +56,7 @@ jobs:
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js 18.x
|
||||
@@ -63,13 +65,16 @@ jobs:
|
||||
node-version: 18.x
|
||||
cache: 'yarn'
|
||||
- name: Install dependencies
|
||||
run: yarn --frozen-lockfile
|
||||
run: |
|
||||
yarn --frozen-lockfile
|
||||
yarn install-addons
|
||||
- name: Lint code
|
||||
run: yarn lint
|
||||
- name: Lint API
|
||||
run: yarn lint-api
|
||||
|
||||
unit-tests:
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16, 18]
|
||||
@@ -104,9 +109,10 @@ jobs:
|
||||
run: yarn test-unit --forbid-only
|
||||
|
||||
integration-tests:
|
||||
timeout-minutes: 20
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [18]
|
||||
node-version: [18] # just one as integration tests are about testing in browser
|
||||
runs-on: [ubuntu, windows] # macos is flaky
|
||||
browser: [chromium, firefox]
|
||||
runs-on: ${{ matrix.runs-on }}-latest
|
||||
|
||||
@@ -6,10 +6,11 @@
|
||||
import { ICharacterJoinerService, ICharSizeService, ICoreBrowserService, IRenderService, ISelectionService, IThemeService } from 'browser/services/Services';
|
||||
import { ITerminal } from 'browser/Types';
|
||||
import { CanvasRenderer } from './CanvasRenderer';
|
||||
import { IBufferService, ICoreService, IDecorationService, IOptionsService } from 'common/services/Services';
|
||||
import { IBufferService, ICoreService, IDecorationService, ILogService, IOptionsService } from 'common/services/Services';
|
||||
import { ITerminalAddon, Terminal } from 'xterm';
|
||||
import { EventEmitter, forwardEvent } from 'common/EventEmitter';
|
||||
import { Disposable, toDisposable } from 'common/Lifecycle';
|
||||
import { setTraceLogger } from 'common/services/LogService';
|
||||
|
||||
export class CanvasAddon extends Disposable implements ITerminalAddon {
|
||||
private _terminal?: Terminal;
|
||||
@@ -44,8 +45,13 @@ export class CanvasAddon extends Disposable implements ITerminalAddon {
|
||||
const charSizeService: ICharSizeService = unsafeCore._charSizeService;
|
||||
const coreBrowserService: ICoreBrowserService = unsafeCore._coreBrowserService;
|
||||
const decorationService: IDecorationService = unsafeCore._decorationService;
|
||||
const logService: ILogService = unsafeCore._logService;
|
||||
const themeService: IThemeService = unsafeCore._themeService;
|
||||
|
||||
// Set trace logger just in case it hasn't been yet which could happen when the addon is
|
||||
// bundled separately to the core module
|
||||
setTraceLogger(logService);
|
||||
|
||||
this._renderer = new CanvasRenderer(terminal, screenElement, linkifier, bufferService, charSizeService, optionsService, characterJoinerService, coreService, coreBrowserService, decorationService, themeService);
|
||||
this.register(forwardEvent(this._renderer.onChangeTextureAtlas, this._onChangeTextureAtlas));
|
||||
this.register(forwardEvent(this._renderer.onAddTextureAtlasCanvas, this._onAddTextureAtlasCanvas));
|
||||
|
||||
+2
-1
@@ -41,8 +41,9 @@
|
||||
"test-unit-coverage": "node ./bin/test.js --coverage",
|
||||
"test-unit-dev": "cross-env NODE_PATH='./out' mocha",
|
||||
"build": "tsc -b ./tsconfig.all.json",
|
||||
"install-addons": "node ./bin/install-addons.js",
|
||||
"presetup": "npm run install-addons",
|
||||
"setup": "npm run build",
|
||||
"postinstall": "node ./bin/install-addons.js",
|
||||
"postsetup": "npm run inwasm",
|
||||
"prepublishOnly": "npm run package",
|
||||
"watch": "tsc -b -w ./tsconfig.all.json --preserveWatchOutput",
|
||||
|
||||
@@ -279,6 +279,9 @@ export class Viewport extends Disposable implements IViewport {
|
||||
}
|
||||
|
||||
public scrollLines(disp: number): void {
|
||||
if (disp === 0) {
|
||||
return;
|
||||
}
|
||||
if (!this._optionsService.rawOptions.smoothScrollDuration) {
|
||||
this._onRequestScrollLines.fire({ amount: disp, suppressScrollEvent: false });
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user