Skip to content

Commit 59f5d47

Browse files
committed
Fix winpty resize and reduce test flakiness
1 parent 055cd3f commit 59f5d47

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/windowsPtyAgent.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,10 @@ export class WindowsPtyAgent {
145145
if (this._exitCode !== undefined) {
146146
throw new Error('Cannot resize a pty that has already exited');
147147
}
148-
this._ptyNative.resize(this._pty, cols, rows, this._useConptyDll);
148+
(this._ptyNative as IConptyNative).resize(this._pty, cols, rows, this._useConptyDll);
149149
return;
150150
}
151-
this._ptyNative.resize(this._pid, cols, rows, this._useConptyDll);
151+
(this._ptyNative as IWinptyNative).resize(this._pid, cols, rows);
152152
}
153153

154154
public clear(): void {

src/windowsTerminal.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ if (process.platform === 'win32') {
9898
(<any>term)._defer(done);
9999
});
100100
it('should kill the process tree', function (done: Mocha.Done): void {
101-
this.timeout(5000);
101+
this.timeout(10000);
102102
const term = new WindowsTerminal('cmd.exe', [], { useConpty });
103103
// Start sub-processes
104104
term.write('powershell.exe\r');
@@ -134,7 +134,7 @@ if (process.platform === 'win32') {
134134
it('should throw a non-native exception when resizing a killed terminal', (done) => {
135135
const term = new WindowsTerminal('cmd.exe', [], { useConpty });
136136
(<any>term)._defer(() => {
137-
term.on('exit', () => {
137+
term.once('exit', () => {
138138
assert.throws(() => term.resize(1, 1));
139139
done();
140140
});

0 commit comments

Comments
 (0)