| | "use strict"; |
| | |
| | |
| | |
| | |
| | Object.defineProperty(exports, "__esModule", { value: true }); |
| | var assert = require("assert"); |
| | var windowsTerminal_1 = require("./windowsTerminal"); |
| | var unixTerminal_1 = require("./unixTerminal"); |
| | var terminalConstructor = (process.platform === 'win32') ? windowsTerminal_1.WindowsTerminal : unixTerminal_1.UnixTerminal; |
| | var SHELL = (process.platform === 'win32') ? 'cmd.exe' : '/bin/bash'; |
| | var terminalCtor; |
| | if (process.platform === 'win32') { |
| | terminalCtor = require('./windowsTerminal'); |
| | } |
| | else { |
| | terminalCtor = require('./unixTerminal'); |
| | } |
| | describe('Terminal', function () { |
| | describe('constructor', function () { |
| | it('should do basic type checks', function () { |
| | assert.throws(function () { return new terminalCtor('a', 'b', { 'name': {} }); }, 'name must be a string (not a object)'); |
| | }); |
| | }); |
| | describe('automatic flow control', function () { |
| | it('should respect ctor flow control options', function () { |
| | var pty = new terminalConstructor(SHELL, [], { handleFlowControl: true, flowControlPause: 'abc', flowControlResume: '123' }); |
| | assert.equal(pty.handleFlowControl, true); |
| | assert.equal(pty._flowControlPause, 'abc'); |
| | assert.equal(pty._flowControlResume, '123'); |
| | }); |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | }); |
| | }); |
| | function stripEscapeSequences(data) { |
| | return data.replace(/\u001b\[0K/, ''); |
| | } |
| | |