windowOptions on ctor options
This commit is contained in:
@@ -17,7 +17,6 @@ import { MockCoreService, MockBufferService, MockDirtyRowService, MockOptionsSer
|
||||
import { IBufferService } from 'common/services/Services';
|
||||
import { DEFAULT_OPTIONS } from 'common/services/OptionsService';
|
||||
import { clone } from 'common/Clone';
|
||||
import { WindowOptions } from 'common/WindowOptions';
|
||||
|
||||
function getCursor(term: TestTerminal): number[] {
|
||||
return [
|
||||
@@ -1270,7 +1269,6 @@ describe('InputHandler', () => {
|
||||
describe('windowOptions', () => {
|
||||
it('all should be disabled by default and not report', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10});
|
||||
assert.deepEqual(term.options.windowOptions, 0);
|
||||
const stack: string[] = [];
|
||||
term.onData(data => stack.push(data));
|
||||
term.writeSync('\x1b[14t');
|
||||
@@ -1281,8 +1279,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, []);
|
||||
});
|
||||
it('14 - GetWinSizePixels', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.getWinSizePixels});
|
||||
assert.deepEqual(term.options.windowOptions, 1 << 14);
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {getWinSizePixels: true}});
|
||||
const stack: string[] = [];
|
||||
term.onData(data => stack.push(data));
|
||||
term.writeSync('\x1b[14t');
|
||||
@@ -1290,8 +1287,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, []);
|
||||
});
|
||||
it('16 - GetCellSizePixels', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.getCellSizePixels});
|
||||
assert.deepEqual(term.options.windowOptions, 1 << 16);
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {getCellSizePixels: true}});
|
||||
const stack: string[] = [];
|
||||
term.onData(data => stack.push(data));
|
||||
term.writeSync('\x1b[16t');
|
||||
@@ -1299,8 +1295,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, []);
|
||||
});
|
||||
it('18 - GetWinSizeChars', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.getWinSizeChars});
|
||||
assert.deepEqual(term.options.windowOptions, 1 << 18);
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {getWinSizeChars: true}});
|
||||
const stack: string[] = [];
|
||||
term.onData(data => stack.push(data));
|
||||
term.writeSync('\x1b[18t');
|
||||
@@ -1310,8 +1305,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, ['\x1b[8;10;10t', '\x1b[8;20;50t']);
|
||||
});
|
||||
it('20 - GetIconTitle', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.getIconTitle});
|
||||
assert.deepEqual(term.options.windowOptions, 1 << 20);
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {getIconTitle: true}});
|
||||
const stack: string[] = [];
|
||||
term.onData(data => stack.push(data));
|
||||
term.writeSync('\x1b]1;hello world!\x07');
|
||||
@@ -1322,8 +1316,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, ['\x1b]Lhello world!\x1b\\', '\x1b]Lsome other\x1b\\']);
|
||||
});
|
||||
it('21 - GetWinTitle', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.getWinTitle});
|
||||
assert.deepEqual(term.options.windowOptions, 1 << 21);
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {getWinTitle: true}});
|
||||
const stack: string[] = [];
|
||||
term.onData(data => stack.push(data));
|
||||
term.writeSync('\x1b]2;hello world!\x07');
|
||||
@@ -1334,8 +1327,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, ['\x1b]lhello world!\x1b\\', '\x1b]lsome other\x1b\\']);
|
||||
});
|
||||
it('22/23 - PushTitle/PopTitle', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.pushTitle | WindowOptions.popTitle});
|
||||
assert.deepEqual(term.options.windowOptions, (1 << 22) | (1 << 23));
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {pushTitle: true, popTitle: true}});
|
||||
const stack: string[] = [];
|
||||
term.onTitleChange(data => stack.push(data));
|
||||
term.writeSync('\x1b]0;1\x07');
|
||||
@@ -1356,8 +1348,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, ['1', '2', '3', '3', '2', '1']);
|
||||
});
|
||||
it('22/23 - PushTitle/PopTitle with ;1', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.pushTitle | WindowOptions.popTitle});
|
||||
assert.deepEqual(term.options.windowOptions, (1 << 22) | (1 << 23));
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {pushTitle: true, popTitle: true}});
|
||||
const stack: string[] = [];
|
||||
term.onTitleChange(data => stack.push(data));
|
||||
term.writeSync('\x1b]0;1\x07');
|
||||
@@ -1378,8 +1369,7 @@ describe('InputHandler', () => {
|
||||
assert.deepEqual(stack, ['1', '2', '3']);
|
||||
});
|
||||
it('22/23 - PushTitle/PopTitle with ;2', () => {
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.pushTitle | WindowOptions.popTitle});
|
||||
assert.deepEqual(term.options.windowOptions, (1 << 22) | (1 << 23));
|
||||
const term = new TestTerminal({cols: 10, rows: 10, windowOptions: {pushTitle: true, popTitle: true}});
|
||||
const stack: string[] = [];
|
||||
term.onTitleChange(data => stack.push(data));
|
||||
term.writeSync('\x1b]0;1\x07');
|
||||
@@ -1407,7 +1397,7 @@ describe('InputHandler', () => {
|
||||
term.writeSync('\x1b[?3h');
|
||||
assert.equal((term as any)._bufferService.cols, 10);
|
||||
// enabled
|
||||
const term2 = new TestTerminal({cols: 10, rows: 10, windowOptions: WindowOptions.setWinLines});
|
||||
const term2 = new TestTerminal({cols: 10, rows: 10, windowOptions: {setWinLines: true}});
|
||||
term2.writeSync('\x1b[?3l');
|
||||
assert.equal((term2 as any)._bufferService.cols, 80);
|
||||
term2.writeSync('\x1b[?3h');
|
||||
|
||||
Reference in New Issue
Block a user