Skip to content

Commit ef6f0db

Browse files
committed
Merge branch 'master' into reuse_bufferlines
2 parents 22e4a2d + e4e5b96 commit ef6f0db

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

src/EscapeSequenceParser.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,8 @@ describe('EscapeSequenceParser', function (): void {
369369
parser.currentState = ParserState.ESCAPE_INTERMEDIATE;
370370
parser.parse(collect[i]);
371371
chai.expect(parser.currentState).equal(ParserState.GROUND);
372-
testTerminal.compare([['esc', '', collect[i]]]);
372+
// '\x5c' --> ESC + \ (7bit ST) parser does not expose this as it already got handled
373+
testTerminal.compare((collect[i] === '\x5c') ? [] : [['esc', '', collect[i]]]);
373374
parser.reset();
374375
testTerminal.clear();
375376
}
@@ -1051,6 +1052,13 @@ describe('EscapeSequenceParser', function (): void {
10511052
['csi', '<', [0, 0], 'c']
10521053
], null);
10531054
});
1055+
it('7bit ST should be swallowed', function(): void {
1056+
test('abc\x9d123tzf\x1b\\defg', [
1057+
['print', 'abc'],
1058+
['osc', '123tzf'],
1059+
['print', 'defg']
1060+
], null);
1061+
});
10541062
});
10551063
});
10561064

@@ -1089,7 +1097,7 @@ describe('EscapeSequenceParser', function (): void {
10891097
parser.reset();
10901098
testTerminal.clear();
10911099
parser.currentState = ParserState.GROUND;
1092-
parser.parse('\x1e');
1100+
parser.parse('\x9c');
10931101
chai.expect(parser.currentState).equal(ParserState.GROUND);
10941102
testTerminal.compare([]);
10951103
parser.reset();

src/EscapeSequenceParser.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class TransitionTable {
6666
const PRINTABLES = r(0x20, 0x7f);
6767
const EXECUTABLES = r(0x00, 0x18);
6868
EXECUTABLES.push(0x19);
69-
EXECUTABLES.concat(r(0x1c, 0x20));
69+
EXECUTABLES.push.apply(EXECUTABLES, r(0x1c, 0x20));
7070
const DEFAULT_TRANSITION = ParserAction.ERROR << 4 | ParserState.GROUND;
7171

7272
/**
@@ -261,6 +261,9 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
261261
this._dcsHandlers = Object.create(null);
262262
this._activeDcsHandler = null;
263263
this._errorHandler = this._errorHandlerFb;
264+
265+
// swallow 7bit ST (ESC+\)
266+
this.setEscHandler('\\', () => {});
264267
}
265268

266269
public dispose(): void {

src/Terminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
990990
: 65;
991991
break;
992992
case 'wheel':
993-
button = (<WheelEvent>ev).wheelDeltaY > 0
993+
button = (<WheelEvent>ev).deltaY < 0
994994
? 64
995995
: 65;
996996
break;

src/renderer/dom/DomRenderer.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,14 @@ export class DomRenderer extends EventEmitter implements IRenderer {
123123
` display: inline-block;` +
124124
` height: 100%;` +
125125
` vertical-align: top;` +
126-
` width: ${this._terminal.charMeasure.width}px` +
126+
` width: ${this.dimensions.actualCellWidth}px` +
127127
`}`;
128128

129129
this._dimensionsStyleElement.innerHTML = styles;
130130

131131
this._selectionContainer.style.height = (<any>this._terminal)._viewportElement.style.height;
132-
this._rowContainer.style.width = `${this.dimensions.canvasWidth}px`;
133-
this._rowContainer.style.height = `${this.dimensions.canvasHeight}px`;
134-
this._terminal.screenElement.style.width = '';
135-
this._terminal.screenElement.style.height = '';
132+
this._terminal.screenElement.style.width = `${this.dimensions.canvasWidth}px`;
133+
this._terminal.screenElement.style.height = `${this.dimensions.canvasHeight}px`;
136134
}
137135

138136
public setTheme(theme: ITheme | undefined): IColorSet {

0 commit comments

Comments
 (0)