diff --git a/.npmignore b/.npmignore index 5f10c1c79..1b9f6b628 100644 --- a/.npmignore +++ b/.npmignore @@ -39,6 +39,7 @@ *.test.js.map lib/test/ tslint.json +webpack.config.js docs/ /.idea/ @@ -48,3 +49,4 @@ build/ fixtures/ demo/ .devcontainer/ +out/ diff --git a/fixtures/typings-test/typings-test.ts b/fixtures/typings-test/typings-test.ts index 53938611e..04f54920b 100644 --- a/fixtures/typings-test/typings-test.ts +++ b/fixtures/typings-test/typings-test.ts @@ -147,7 +147,6 @@ namespace methods_core { const r18: (data: string) => void = t.getOption('handler'); const r19: string = t.getOption('bellSound'); const r20: string = t.getOption('bellStyle'); - const r21: boolean = t.getOption('enableBold'); const r22: number = t.getOption('letterSpacing'); const r23: boolean = t.getOption('macOptionIsMeta'); const r24: string = t.getOption('fontWeight'); @@ -167,7 +166,6 @@ namespace methods_core { t.setOption('cursorBlink', true); t.setOption('debug', true); t.setOption('disableStdin', true); - t.setOption('enableBold', true); t.setOption('fontWeight', 'normal'); t.setOption('fontWeight', 'bold'); t.setOption('fontWeightBold', 'normal'); diff --git a/src/InputHandler.ts b/src/InputHandler.ts index b75b89bd4..e8f476703 100644 --- a/src/InputHandler.ts +++ b/src/InputHandler.ts @@ -953,6 +953,7 @@ export class InputHandler extends Disposable implements IInputHandler { this._terminal.buffer.x + (params[0] || 1), this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()) ); + this._terminal.updateRange(this._terminal.buffer.y); } /** diff --git a/src/Terminal.ts b/src/Terminal.ts index 5ee34f62c..eac6aca47 100644 --- a/src/Terminal.ts +++ b/src/Terminal.ts @@ -92,7 +92,6 @@ const DEFAULT_OPTIONS: ITerminalOptions = { bellSound: DEFAULT_BELL_SOUND, bellStyle: 'none', drawBoldTextInBrightColors: true, - enableBold: true, fontFamily: 'courier-new, courier, monospace', fontSize: 15, fontWeight: 'normal', @@ -495,7 +494,6 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II } break; case 'drawBoldTextInBrightColors': - case 'enableBold': case 'letterSpacing': case 'lineHeight': case 'fontWeight': diff --git a/src/public/Terminal.ts b/src/public/Terminal.ts index 86a9cce1a..b6f6ba67e 100644 --- a/src/public/Terminal.ts +++ b/src/public/Terminal.ts @@ -146,7 +146,7 @@ export class Terminal implements ITerminalApi { this._core.writeUtf8(data); } public getOption(key: 'bellSound' | 'bellStyle' | 'cursorStyle' | 'fontFamily' | 'fontWeight' | 'fontWeightBold' | 'rendererType' | 'termName'): string; - public getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell'): boolean; + public getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell'): boolean; public getOption(key: 'colors'): string[]; public getOption(key: 'cols' | 'fontSize' | 'letterSpacing' | 'lineHeight' | 'rows' | 'tabStopWidth' | 'scrollback'): number; public getOption(key: 'handler'): (data: string) => void; @@ -158,7 +158,7 @@ export class Terminal implements ITerminalApi { public setOption(key: 'fontWeight' | 'fontWeightBold', value: 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900'): void; public setOption(key: 'bellStyle', value: 'none' | 'visual' | 'sound' | 'both'): void; public setOption(key: 'cursorStyle', value: 'block' | 'underline' | 'bar'): void; - public setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell', value: boolean): void; + public setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell', value: boolean): void; public setOption(key: 'colors', value: string[]): void; public setOption(key: 'fontSize' | 'letterSpacing' | 'lineHeight' | 'tabStopWidth' | 'scrollback', value: number): void; public setOption(key: 'handler', value: (data: string) => void): void; diff --git a/src/renderer/BaseRenderLayer.ts b/src/renderer/BaseRenderLayer.ts index 333ce8950..f61df580f 100644 --- a/src/renderer/BaseRenderLayer.ts +++ b/src/renderer/BaseRenderLayer.ts @@ -288,7 +288,7 @@ export abstract class BaseRenderLayer implements IRenderLayer { this._currentGlyphIdentifier.code = cell.getCode() || WHITESPACE_CELL_CODE; this._currentGlyphIdentifier.bg = bg; this._currentGlyphIdentifier.fg = fg; - this._currentGlyphIdentifier.bold = cell.isBold() && terminal.options.enableBold; + this._currentGlyphIdentifier.bold = !!cell.isBold(); this._currentGlyphIdentifier.dim = !!cell.isDim(); this._currentGlyphIdentifier.italic = !!cell.isItalic(); const atlasDidDraw = this._charAtlas && this._charAtlas.draw( @@ -316,7 +316,7 @@ export abstract class BaseRenderLayer implements IRenderLayer { */ private _drawUncachedChars(terminal: ITerminal, cell: ICellData, x: number, y: number): void { this._ctx.save(); - this._ctx.font = this._getFont(terminal, cell.isBold() && terminal.options.enableBold, !!cell.isItalic()); + this._ctx.font = this._getFont(terminal, !!cell.isBold(), !!cell.isItalic()); this._ctx.textBaseline = 'middle'; if (cell.isInverse()) { diff --git a/src/renderer/dom/DomRendererRowFactory.test.ts b/src/renderer/dom/DomRendererRowFactory.test.ts index 5747eeb25..e3b26e5dc 100644 --- a/src/renderer/dom/DomRendererRowFactory.test.ts +++ b/src/renderer/dom/DomRendererRowFactory.test.ts @@ -19,7 +19,6 @@ describe('DomRendererRowFactory', () => { beforeEach(() => { dom = new jsdom.JSDOM(''); - options.enableBold = true; options.drawBoldTextInBrightColors = true; rowFactory = new DomRendererRowFactory(options, dom.window.document); diff --git a/src/renderer/dom/DomRendererRowFactory.ts b/src/renderer/dom/DomRendererRowFactory.ts index 85ef586e2..d3685923f 100644 --- a/src/renderer/dom/DomRendererRowFactory.ts +++ b/src/renderer/dom/DomRendererRowFactory.ts @@ -77,7 +77,7 @@ export class DomRendererRowFactory { } } - if (this._workCell.isBold() && this._terminalOptions.enableBold) { + if (this._workCell.isBold()) { charElement.classList.add(BOLD_CLASS); } @@ -104,8 +104,7 @@ export class DomRendererRowFactory { charElement.setAttribute('style', style); } else if (this._workCell.isFgPalette()) { let fg = this._workCell.getFgColor(); - if (this._workCell.isBold() && fg < 8 && !swapColor && - this._terminalOptions.enableBold && this._terminalOptions.drawBoldTextInBrightColors) { + if (this._workCell.isBold() && fg < 8 && !swapColor && this._terminalOptions.drawBoldTextInBrightColors) { fg += 8; } charElement.classList.add(`xterm-${swapColor ? 'b' : 'f'}g-${fg}`); diff --git a/src/xterm.ts b/src/xterm.ts deleted file mode 100644 index 81b95805d..000000000 --- a/src/xterm.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Copyright (c) 2017 The xterm.js authors. All rights reserved. - * @license MIT - * - * This file is the entry point for browserify. - */ - -import { Terminal } from './public/Terminal'; - -module.exports = Terminal; diff --git a/typings/xterm.d.ts b/typings/xterm.d.ts index 7ca072d73..0b0ce9d5a 100644 --- a/typings/xterm.d.ts +++ b/typings/xterm.d.ts @@ -76,13 +76,6 @@ declare module 'xterm' { */ drawBoldTextInBrightColors?: boolean; - /** - * Whether to enable the rendering of bold text. - * - * @deprecated Use fontWeight and fontWeightBold instead. - */ - enableBold?: boolean; - /** * The font size used to render text. */ @@ -750,7 +743,7 @@ declare module 'xterm' { * Retrieves an option's value from the terminal. * @param key The option key. */ - getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode'): boolean; + getOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'rightClickSelectsWord' | 'popOnBell' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode'): boolean; /** * Retrieves an option's value from the terminal. * @param key The option key. @@ -801,7 +794,7 @@ declare module 'xterm' { * @param key The option key. * @param value The option value. */ - setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'enableBold' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode', value: boolean): void; + setOption(key: 'allowTransparency' | 'cancelEvents' | 'convertEol' | 'cursorBlink' | 'debug' | 'disableStdin' | 'macOptionIsMeta' | 'popOnBell' | 'rightClickSelectsWord' | 'screenKeys' | 'useFlowControl' | 'visualBell' | 'windowsMode', value: boolean): void; /** * Sets an option on the terminal. * @param key The option key. diff --git a/webpack.config.js b/webpack.config.js index d62cba20e..5e0a27547 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,6 +13,17 @@ const path = require('path'); */ module.exports = { entry: './out/public/Terminal.js', + devtool: 'source-map', + module: { + rules: [ + { + test: /\.js$/, + use: ["source-map-loader"], + enforce: "pre", + exclude: /node_modules/ + } + ] + }, resolve: { modules: ['./node_modules'], extensions: [ '.js' ],