parent
a681de42d1
commit
1c7194ad5d
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { app, ipcMain as ipc, systemPreferences, shell, Event, contentTracing, protocol } from 'electron';
|
||||
import { app, ipcMain as ipc, systemPreferences, shell, Event, contentTracing, protocol, powerMonitor } from 'electron';
|
||||
import { IProcessEnvironment, isWindows, isMacintosh } from 'vs/base/common/platform';
|
||||
import { WindowsManager } from 'vs/code/electron-main/windows';
|
||||
import { IWindowsService, OpenContext, ActiveWindowManager } from 'vs/platform/windows/common/windows';
|
||||
|
@ -260,6 +260,12 @@ export class CodeApplication extends Disposable {
|
|||
ipc.on('vscode:openDevTools', (event: Event) => event.sender.openDevTools());
|
||||
|
||||
ipc.on('vscode:reloadWindow', (event: Event) => event.sender.reload());
|
||||
|
||||
powerMonitor.on('resume', () => { // After waking up from sleep
|
||||
if (this.windowsMainService) {
|
||||
this.windowsMainService.sendToAll('vscode:osResume', undefined);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private onUnexpectedError(err: Error): void {
|
||||
|
|
|
@ -427,6 +427,11 @@ export interface ITerminalInstance {
|
|||
*/
|
||||
dispose(immediate?: boolean): void;
|
||||
|
||||
/**
|
||||
* Forces the terminal to redraw its viewport.
|
||||
*/
|
||||
forceRedraw(): void;
|
||||
|
||||
/**
|
||||
* Registers a link matcher, allowing custom link patterns to be matched and handled.
|
||||
* @param regex The regular expression the search for, specifically this searches the
|
||||
|
|
|
@ -620,6 +620,10 @@ export class TerminalInstance implements ITerminalInstance {
|
|||
this._disposables = lifecycle.dispose(this._disposables);
|
||||
}
|
||||
|
||||
public forceRedraw(): void {
|
||||
this._xterm.refresh(0, this._xterm.rows - 1);
|
||||
}
|
||||
|
||||
public focus(force?: boolean): void {
|
||||
if (!this._xterm) {
|
||||
return;
|
||||
|
|
|
@ -69,6 +69,9 @@ export class TerminalService extends AbstractTerminalService implements ITermina
|
|||
});
|
||||
}
|
||||
});
|
||||
ipc.on('vscode:osResume', () => {
|
||||
this.getActiveTab().terminalInstances.forEach(instance => instance.forceRedraw());
|
||||
});
|
||||
}
|
||||
|
||||
public createTerminal(shell: IShellLaunchConfig = {}, wasNewTerminalAction?: boolean): ITerminalInstance {
|
||||
|
|
Loading…
Reference in New Issue