Fix virtual process resize and debounce event

This commit is contained in:
Daniel Imms
2019-07-02 17:40:25 -07:00
parent 5e804dc4ed
commit 9d01ac8949
4 changed files with 84 additions and 12 deletions

View File

@@ -264,8 +264,9 @@ export class MainThreadTerminalService implements MainThreadTerminalServiceShape
this._terminalProcessesReady[proxy.terminalId](proxy);
delete this._terminalProcessesReady[proxy.terminalId];
// Note that onReisze is not being listened to here as it needs to fire when max dimensions
// change, excluding the dimension override
proxy.onInput(data => this._proxy.$acceptProcessInput(proxy.terminalId, data));
proxy.onResize(dimensions => this._proxy.$acceptProcessResize(proxy.terminalId, dimensions.cols, dimensions.rows));
proxy.onShutdown(immediate => this._proxy.$acceptProcessShutdown(proxy.terminalId, immediate));
proxy.onRequestCwd(() => this._proxy.$acceptProcessRequestCwd(proxy.terminalId));
proxy.onRequestInitialCwd(() => this._proxy.$acceptProcessRequestInitialCwd(proxy.terminalId));

View File

@@ -433,13 +433,20 @@ export class ExtHostTerminalService implements ExtHostTerminalServiceShape {
}
public $acceptTerminalMaximumDimensions(id: number, cols: number, rows: number): void {
this._getTerminalByIdEventually(id).then(() => {
// When a terminal's dimensions change, a renderer's _maximum_ dimensions change
const renderer = this._getTerminalRendererById(id);
if (renderer) {
renderer._setMaximumDimensions(cols, rows);
}
});
if (this._terminalProcesses[id]) {
// Virtual processes only - when virtual process resize fires it means that the
// terminal's maximum dimensions changed
this._terminalProcesses[id].resize(cols, rows);
} else {
// Terminal renderer
this._getTerminalByIdEventually(id).then(() => {
// When a terminal's dimensions change, a renderer's _maximum_ dimensions change
const renderer = this._getTerminalRendererById(id);
if (renderer) {
renderer._setMaximumDimensions(cols, rows);
}
});
}
}
public $acceptTerminalRendererInput(id: number, data: string): void {