Skip to content

Commit

Permalink
Merge branch 'master' into true_color
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyriar committed Apr 4, 2019
2 parents e6333bd + b591db8 commit 46f3b3f
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 29 deletions.
2 changes: 1 addition & 1 deletion demo/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function runFakeTerminal(): void {
term.prompt();
} else if (ev.keyCode === 8) {
// Do not delete the prompt
if (term.x > 2) {
if (term._core.buffer.x > 2) {
term.write('\b \b');
}
} else if (printable) {
Expand Down
2 changes: 1 addition & 1 deletion src/AccessibilityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import * as Strings from './Strings';
import { ITerminal, IBuffer } from './Types';
import { isMac } from './core/Platform';
import { isMac } from './common/Platform';
import { RenderDebouncer } from './ui/RenderDebouncer';
import { addDisposableDomListener } from './ui/Lifecycle';
import { Disposable } from './common/Lifecycle';
Expand Down
2 changes: 1 addition & 1 deletion src/InputHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ export class InputHandler extends Disposable implements IInputHandler {

while (param--) {
buffer.lines.splice(buffer.ybase + buffer.scrollBottom, 1);
buffer.lines.splice(buffer.ybase + buffer.scrollBottom, 0, buffer.getBlankLine(DEFAULT_ATTR_DATA));
buffer.lines.splice(buffer.ybase + buffer.scrollTop, 0, buffer.getBlankLine(DEFAULT_ATTR_DATA));
}
// this.maxRange();
this._terminal.updateRange(buffer.scrollTop);
Expand Down
2 changes: 1 addition & 1 deletion src/SelectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { ITerminal, ISelectionManager, IBuffer, IBufferLine } from './Types';
import { XtermListener } from './common/Types';
import { MouseHelper } from './ui/MouseHelper';
import * as Browser from './core/Platform';
import * as Browser from './common/Platform';
import { CharMeasure } from './ui/CharMeasure';
import { EventEmitter } from './common/EventEmitter';
import { SelectionModel } from './SelectionModel';
Expand Down
2 changes: 1 addition & 1 deletion src/Terminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { Renderer } from './renderer/Renderer';
import { Linkifier } from './Linkifier';
import { SelectionManager } from './SelectionManager';
import { CharMeasure } from './ui/CharMeasure';
import * as Browser from './core/Platform';
import * as Browser from './common/Platform';
import { addDisposableDomListener } from './ui/Lifecycle';
import * as Strings from './Strings';
import { MouseHelper } from './ui/MouseHelper';
Expand Down
3 changes: 1 addition & 2 deletions src/common/EventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
* @license MIT
*/

import { XtermListener } from './Types';
import { IEventEmitter, IDisposable } from 'xterm';
import { IDisposable, IEventEmitter, XtermListener } from './Types';
import { Disposable } from './Lifecycle';

export class EventEmitter extends Disposable implements IEventEmitter, IDisposable {
Expand Down
2 changes: 1 addition & 1 deletion src/common/Lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @license MIT
*/

import { IDisposable } from 'xterm';
import { IDisposable } from './Types';

/**
* A base class that can be extended to provide convenience methods for managing the lifecycle of an
Expand Down
10 changes: 10 additions & 0 deletions src/core/Platform.ts → src/common/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
* @license MIT
*/

interface INavigator {
userAgent: string;
language: string;
platform: string;
}

// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but
// we want this module to live in common.
declare const navigator: INavigator;

const isNode = (typeof navigator === 'undefined') ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;
const platform = (isNode) ? 'node' : navigator.platform;
Expand Down
11 changes: 10 additions & 1 deletion src/common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@
* @license MIT
*/

import { IEventEmitter } from 'xterm';
export interface IDisposable {
dispose(): void;
}

export interface IEventEmitter {
on(type: string, listener: (...args: any[]) => void): void;
off(type: string, listener: (...args: any[]) => void): void;
emit(type: string, data?: any): void;
addDisposableListener(type: string, handler: (...args: any[]) => void): IDisposable;
}

export type XtermListener = (...args: any[]) => void;

Expand Down
9 changes: 5 additions & 4 deletions src/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"extends": "../tsconfig-library-base",
"compilerOptions": {
"outDir": "../../lib"
"outDir": "../../lib",
"types": [
"../../node_modules/@types/mocha"
]
},
"include": [
"./**/*"
]
"include": [ "./**/*" ]
}
9 changes: 5 additions & 4 deletions src/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"extends": "../tsconfig-library-base",
"compilerOptions": {
"outDir": "../../lib"
"outDir": "../../lib",
"types": [
"../../node_modules/@types/mocha"
]
},
"include": [
"./**/*"
],
"include": [ "./**/*" ],
"references": [
{ "path": "../common" }
]
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/atlas/CharAtlasGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { FontWeight } from 'xterm';
import { isFirefox, isSafari } from '../../core/Platform';
import { isFirefox, isSafari } from '../../common/Platform';
import { IColor } from '../Types';
import { ICharAtlasConfig, CHAR_ATLAS_CELL_SPACING } from './Types';

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/atlas/DynamicCharAtlas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import BaseCharAtlas from './BaseCharAtlas';
import { DEFAULT_ANSI_COLORS } from '../ColorManager';
import { clearColor } from './CharAtlasGenerator';
import LRUMap from './LRUMap';
import { isFirefox, isSafari } from '../../core/Platform';
import { isFirefox, isSafari } from '../../common/Platform';
import { IColor } from '../Types';

// In practice we're probably never going to exhaust a texture this large. For debugging purposes,
Expand Down
4 changes: 1 addition & 3 deletions src/tsconfig-base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"removeComments": true,
"pretty": true,

"incremental": true,

"skipLibCheck": true
"incremental": true
}
}
4 changes: 0 additions & 4 deletions src/tsconfig-library-base.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{
"extends": "./tsconfig-base.json",
"compilerOptions": {
"types": [
"../../node_modules/@types/mocha",
"../../"
],
"composite": true,
"strict": true
}
Expand Down
3 changes: 1 addition & 2 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"rootDir": ".",
"outDir": "../lib",

"noUnusedLocals": true,
"noImplicitAny": true
},
Expand All @@ -27,4 +27,3 @@
{ "path": "./core" }
]
}

2 changes: 1 addition & 1 deletion src/ui/TestUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { IColorSet, IRenderer, IRenderDimensions, IColorManager } from '../rende
import { IInputHandlingTerminal, IViewport, ICompositionHelper, ITerminal, IBuffer, IBufferSet, IBrowser, ICharMeasure, ISelectionManager, ITerminalOptions, ILinkifier, IMouseHelper, ILinkMatcherOptions, CharacterJoinerHandler, IBufferLine, IBufferStringIterator, ICellData, IAttributeData } from '../Types';
import { ICircularList, XtermListener } from '../common/Types';
import { Buffer } from '../Buffer';
import * as Browser from '../core/Platform';
import * as Browser from '../common/Platform';
import { ITheme, IDisposable, IMarker } from 'xterm';
import { Terminal } from '../Terminal';
import { AttributeData } from '../BufferLine';
Expand Down

0 comments on commit 46f3b3f

Please sign in to comment.